Images get deleted on Northflank

default discord avatar
olivier_vd
10 months ago
10

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
    notchr
    10 months ago

    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
    10 months ago

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

  • default discord avatar
    notchr
    10 months ago

    Ah, changing your collection may have been related



    But it's hard to know for sure

  • discord user avatar
    jmikrut
    Payload Team
    10 months ago

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

  • discord user avatar
    alessiogr
    Payload Team
    10 months ago

    judging from the domain, he's deploying to northflank



    (which uses ephemeral storage by default)

  • default discord avatar
    olivier_vd
    10 months ago

    Yes northflank!



    MongoAtlas for storage

  • discord user avatar
    alessiogr
    Payload Team
    10 months ago

    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_not_jared
    Payload Team
    10 months ago

    Images get deleted on Northflank

  • default discord avatar
    olivier_vd
    10 months ago

    can the plugin be connected to an MongoAtlasDB? @alessiogr

  • discord user avatar
    alessiogr
    Payload Team
    10 months 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.