Hi, everytime I try to gett media from the frontend I faced some 404 error, meanwhile I have access read true in both my media and collection config and auth false in both but I still facing this, I need response very fast because it's in production
Can you send the exact error in? Have you configured CORS already?
If it helps, 404 usually indicates that the file cannot be found. Can you find it in your filesystem / storage?
there is no exact error actually, and yes Im using cors accross the project
yeah, you're right but that file with this url exist in DB but it doesn't shows anything at all when i put the URL externally
@jesschow
I get this everytime
I understand now that all of my files start to disappearing after a few minutes and is not showing on the cms even
I can share the config file for collection
or if you give me email I can give access to source code
It sounds like you haven't configured persistent storage for your files on the server.
What kind of server / hosting service are you using?
I'm using payload cloud for the cms and vercel for frontend
I'm reading it now
what if I don't want to use any kind of EC2 or digital ocean ?
@jessesivonen if you don't mind can you help me to configure S3 ?
It isn't automatically configured in Payload Cloud? I haven't used it so I don't know.
Sorry, I cannot help now. It's night here and I'll try to get some sleep.
I find it, thank you for mentioning but
have a good night
Im trying to solve the problem with s3
no should do it manually
@jesschow I configured my payload config file with s3, is there anything needed to be config?
check out the
plugin-cloud-storage
and the instructions here for s3
https://github.com/payloadcms/plugin-cloud-storage#s3-adapter
this error happens when I installed the plugin as the documentation
@jesschow
Hi @muperdev apologies I sent the wrong link yesterday, this should be the plugin you need:
https://github.com/payloadcms/plugin-cloudand I'll be available today to help you figure this out
so what about the s3?
I would not configure that?
since you are using Payload Cloud, this will be automatically configured for you - you should be able to see your file storage details by going to
https://payloadcms.com/cloud/YOUR-TEAMNAME/PROJECT-NAME/file-storage(replace teamname and project name with your own)
ok I'll check it
@muperdev I can help here. To add to what Jess said, if you pull in that plugin, the S3 storage provided by Payload Cloud will automatically be configured. Were you able to give that a shot? Proper usage of the plugin can be seen here:
https://github.com/payloadcms/template-blank/blob/main/src/payload.config.ts#L26well if it is automatically here so why my pictures dissapear after a while
this is my file storage in cloud
@denolfe @jesschow I need your help ASAP
look I miss every file after few minutes
But they did display prior?
yes they did
multiple times
even when they are displaying after I reload the url they disapear
So to confirm, they display when you enter the absolute url to the image
but then on reload they dissapear?
Or they display in the admin panel, and then display after refresh of the admin panel?
Maybe we can figure out the origin by this information
yes, and after a while they will not display even when I enter the URL
So you have access to the server hosting the content?
like ssh access?
I didn't try but it's S3
here
If you enable logging on your S3 bucket, it can show you why a file was deleted
Perhaps that can get us closer as well
If there is an expiry policy enabled for uploads, that will be evident in the logs as well
let me find out how to login there
stay with me but 😂
the Payload team will likely have a more direct way to debug this, but this may assist in uncovering whats happening
yes, the problem is I cannot find out how to login there in the aws with the details they provide in the cloud setting
Ah I see
This may require waiting for help from Payload - though they respond quickly. I'm running to lunch right now, but I can help more when I return. In the meantime, I'd check out how to trace the S3 log, once you do gain access
you are my friend, thank you for your kindness
@jesschow @denolfe if you know how to solve this it would be very great because we already in the production and the project goes very fast
@muperdev Any progress on this issue? Back from lunch
Hey @muperdev , looking at this now
No not really, been searching for a while
Thanks friend
Can you grab your project ID from Settings -> Billing? (Didn't see it above)
Sure now
643c23085fdfce9b59524a89
here is the ID
@denolfe
@muperdev I do not see any S3 bucket associated with your project (which means no assets have been uploaded). Can you paste the
plugins
section of your payload config?
there's no plugin section actually
that's what Im looking for
I should add it as you mentioned above?
Yes, correct.
let me
Add the package
@payloadcms/plugin-cloud
Then import it like the template-blank example above
I added that version
now I can simply add images to the website without any problem?
or I need more configuration
@denolfe
it looks like it's fixed now
thank you all guys for your help
I think you better to mention it in cloud deployment that everybody needs to install this plugin before cloud deployment
Agreed, it's included in our cloud templates, but we definitely need to document this better 👍
yes because you are the best CMS Provider out there, I want to see your company shining
👏🏼
also I have a problem in one of my other projects that it is already in cloud but isn't deploying because of a bug, could you help me in it? @denolfe
Sure, what are you running into?
I have another project named "exolo" on the cloud and I cannot deploy it, I also opened a community help for it but can't find it anymore
Sure, project ID?
6471bee2f198730ae31ecd5d
here is the ID
Thanks, I'll be able to take a look in a bit
@denolfe hey elliot, sorry for mentioning did you find any sollution for that case?
@denolfe
can you find out what is this error?
it is for previous projec that we solved together
Looking into this now 👍
What payload and plugin-cloud version from package.json?
@muperdev
this is my version
Ah, so plugin-cloud version 2 requires payload version 1.8.2 or greater.
Two options to resolve this:
- upgrade payload to 1.8.2
- downgrade plugin-cloud to 1.x.x. However, that version does not have Payload Cloud email support.
I'll look into why the peerDependencies on plugin-cloud didn't warn you about your Payload version.
ok then what's the command to upgrade the payload?
yarn add payload@latest
or
npm install payload@latest
that's fine will do that now
Okay, let me know if you run into anything else 👌
think it's done, thank you for your help @denolfe
@denolfe I lost my medias again after a while
why is that for?
can you find the reason
also I like the song you're listening 🔥
our project is in production and customers arguing for this bug that I don't know how to handle it
would be good if you can help for that
@muperdev can you confirm that your payload version updated correctly?
What does your package.json list
yes it's updated
What version does your package.json list?
It looks like your payload version is acceptable hmm
yes, but all pictures disappear after a while
Well, the pictures are still uploaded to your S3 bucket right
It's just that the mongo DB loses reference, right?
OR is your S3 bucket purging uploads?
I guess so
there's no way to troubleshoot since I don't have access to non of them
But for example, you see the images for a little while
Does that mean those images got to S3
?
Prior to deletion
yes I guess, maybe it doesn't reach there and still in the mongo remains till mongo refresh the cluster then it lost all
it's hard to troubleshoot without access but what you think?
Well, if you upload an image, can you then share the URL to that image
it should have some indicitation it is being served from S3 or not, right?
Versus something being served from your server
I'm just trying to hlep you cross off some possibilities so we can narrow down what is happening
Yes I feel you
this is the url for one of our pictures
https://panel.routepackers.com/media/car-shipping-on-road.webp
this is the url that we cannot access through the website
but it shows here
dont know why
@muperdev sounds like a permission issue
Can you open dev tools where the image wont load
And show us any errors
Or go to the Network tab in dev tools, find that image listed and the status
and post it here
yes
404 is for permission, but the thing is why the permission allow me at the first, but after a while it blocks the access
hmm
Well it would be a 403
But it shows up here
So the 404 is indeed confusing
yes because not found is not related cause the picture is shows up here
you think it might be for mongodb access?
I set for public access to all urls
Shouldn't be, one sec
And this is on production?
yes
It appears to be hitting cloudflare - could it be an issue there?
you think cloudflare may make trouble?
@muperdev I'd like to confirm. You were able to see the image being served successfully at least once after upload?
Are you able to see the image successfully if viewed in Payload admin?
yes I saw it after 8 hours also
no it is not there even
that's not scary?
but. it shows here
@muperdev I see your assets now. Which asset is the one that disappeared? Filename?
So since the URL for the asset resolves at
https://panel.routepackers.com/media/car-shipping-on-road.webp, that narrows it down a bit.
Can you share your cors and csrf sections of your payload config?
At this point, it feels like it must be something with your frontend.
it shows now but it didn't before
but not only in my frontend. didn't see even at the URL
can you link me to the page where you are seeing a broken image?
you may need to whitelist your
https://panel.routepackers.com
domain as well as just the
https://routepackers.com
domain
this is in the panel
https://www.routepackers.com/blog
this is in the website
both not showing anthing
strangely enough, it loads for me:
thank you for checking
if it disappear again I'll let you know
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.