Images get deleted on Northflank

default discord avatar
olivier_vd
last month
17

I need some uploading media. Whenever I upload something on Payload it seems to be working or resolving for a while but then the link breaks and the resource can't be fetched any longer.



fe.

https://p01--admin-cms--qbt6mytl828m.code.run/media/collection_ding_ex-1.png



this is my code for adding media to the collection;


https://github.com/oliviervd/cms-studios/blob/main/src/collections/Media.ts

do I perhaps need to change some settings on MongoAtlasDB?

  • default discord avatar
    thisisnotchris
    last month

    Good morning @olivier_vd, this is definitely a weird issue.



    I'm not sure that it's related to Payload, but happy to help troubleshoot

  • default discord avatar
    olivier_vd
    last month

    could it be related to updating the code for the collection? - it seems stable now without changing anything to the repo

  • default discord avatar
    thisisnotchris
    last month

    Ah, changing your collection may have been related



    But it's hard to know for sure

  • discord user avatar
    jmikrut
    Payload Team
    last month

    @olivier_vd where are you deploying to? where are you storing your media?

  • default discord avatar
    Alessio 🍣
    last month

    judging from the domain, he's deploying to northflank



    (which uses ephemeral storage by default)

  • default discord avatar
    olivier_vd
    last month

    Yes northflank!



    MongoAtlas for storage

  • default discord avatar
    Alessio 🍣
    last month

    You mean for the database?



    On northflank, everything stored on it actually gets deleted every time the project is re-built



    Including the images



    Because the default storage isn't persistent



    So you'd either need to store the images somewhere else (the cloud storage plugin may be helpful), or alternatively you can also set up permanent storage inside of notquests and mount that (I think in your Dockerfile) ^^

  • discord user avatar
    Jarrod
    Payload Team
    last month

    Images get deleted on Northflank

  • default discord avatar
    olivier_vd
    4 weeks ago

    can the plugin be connected to an MongoAtlasDB? @Alessio 🍣

  • default discord avatar
    Alessio 🍣
    4 weeks ago

    Yep



    The plugin stores the images on some external service (like s3, cloudinary, imagekit etc) and on your Mongodb database, it just stores the

    link

    to the image, not the image itself

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.