-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't update fields of an already uploaded media using the S3 adapter #7037
Comments
Any news on this one ? Is there anything I can help you with @PatrikKozak ? |
Hey @fofoy - we'll get right on this! |
Hi @fofoy - I did some testing on my end and was not able to reproduce the above issue. It may have something to do with your S3 storage setup - do you have a reverse proxy setup? Is this purely local? Just want to get some additional information before I can dig deeper into this - thank you! |
Hi @PatrikKozak I have the same issue in local (using a dockerized MinIO instance) and on my staging environment using an AWS S3 bucket so it doesn't seem to be a setup issue. |
@fofoy Thanks for the info - hmm unfortunately there isn't enough here to fully understand what could be causing this issue. A couple things though, could you try and log out some of the info in that function where the error is coming from (in your node_modules) - this may be able to give us some more information Also, could you update your payload packages versions to latest (just in case) - I'd like to get to the bottom of this but just will need more info to continue |
@PatrikKozak Thanks, I had the time to update my project to latest beta version 91 and the problem remains, I'll dig further to see where it's going wrong and I'll let you know. |
Hi @PatrikKozak here is the result of logging the Promise
and here is the actual error when trying to fetch the file :
So it seems like it's something to do with the network. I'm running everything in Docker with several containers for the postgres db, the S3 instance (minIO) and the payload admin but it also does the same on our dev cluster (kubernetes) with an AWS S3 instance connected to it. |
Hi @PatrikKozak and @fofoy I'm having the same problem as well. I can't edit any fields of an already uploaded file, and I got the same error as described above. We also run our environments in kubernetes and we use Google cloud storage for storing files. I have however noticed that when I'm running payload locally (and still using google cloud storage for storing files) it works. When I'm running payload in docker I get the same error we got in our kubernetes environments. @fofoy Have you found any temporary workaround for this problem? |
Hi @nickejoha, I didn't have the time to dig any further than this yet as I need to make progress on my current project but that's definitely something that needs to be sorted, I'll try to invest more time in a bit. |
I also attempted to recreate this issue, but I was unable to. I'm not sure there's much more we can do on our end to troubleshoot this. Please try and recreate this in the latest beta to ensure it is still an issue. |
Hi @denolfe, I updated to the latest version of beta v122 and the same problem remains, let me know if I can help you in any way to help you debug this. |
This issue has been marked as stale due to lack of activity. To keep this issue open, please indicate that it is still relevant in a comment below. |
This issue was automatically closed due to lack of activity. |
@denolfe @fofoy In short, the problem in our case seems to be connected our firewall in Google cloud plattform and locally that we use a different external port in our docker build. The problem here seems to be that when we edit a field of media file that has been uploaded already, payload tries to fetch the file but the fetch fails. The problem in our case was that when payload tries to fetch the file, it uses the external url which works fine when used from a frontend client or when running a docker config that doesn't alter the ports, but because the request is executed from the container itself the url is invalid. In our local docker config the external url is localhost:3077, but inside the container the app runs on port 3000. So when we access file from outside the container localhost:3077 is valid, but when trying to fetch the same file from inside the container the url is invalid because the application runs on port 3000. The problem in our Google cloud plattform was due to the same fact that the external url isn't valid from inside the cluster. So with that figured out we implemented a bit of a hack as a workaround. By temporarily changing the files url to a valid url (from the containers perspective) with a hook, and the error is gone and editing the file works :)
|
Link to reproduction
No response
Payload Version
3.0.0-beta.56
Node Version
20.12.2
Next.js Version
15.0.0-rc.0
Describe the Bug
Whenever I want to update a field (e.g. Alt field), I get a 500 error when I try to submit the form.
Here is the log from the console
Reproduction Steps
Install
Payload
v3.0.0-beta.56 with the defaultMedia
CollectionInstall
@payloadcms/storage-s3
v3.0.0-beta.56Set up S3 storage (I tried both on minIO and AWS S3 and I get the same behavior)
Upload a first Media
Update the Alt field and submit the form
Adapters and Plugins
@payloadcms/db-postgres v3.0.0-beta.56
@payloadcms/storage-s3 v3.0.0-beta.56
The text was updated successfully, but these errors were encountered: