Skip to content
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

Fails to write to object store with media_handle_sideload #750

Open
traed opened this issue Jun 13, 2024 · 2 comments
Open

Fails to write to object store with media_handle_sideload #750

traed opened this issue Jun 13, 2024 · 2 comments

Comments

@traed
Copy link

traed commented Jun 13, 2024

We're importing data from a third party in a cron job and use media_handle_sideload to import images. This has worked fine in the past but about a week or two ago it stopped working. As far as I can tell images are imported to WP and posts are created just fine but the image doesn't exist in our object store and therefore fails to load when displaying the content.

The attachments in WP looks fine though. They have URL:s pointing to the object store (Google Cloud Storage) for the main image as well as thumbnails along with meta data such as file size, but when following these URL:s they point to nothing (and of course the bucket is empty when checking in google cloud console).

We don't get any errors in the logs as far as I can see and uploading files directly to the WP media library works fine.

We're using stateless mode and have the latest version of the plugin. Any ideas on what might cause this?

@traed
Copy link
Author

traed commented Jun 13, 2024

Update: Seems like the images are deleted as soon as they are uploaded to the bucket. I added soft-delete policy to the bucket and now I can see the files as deleted. "Delete GCS File" is disabled in the plugin settings if that matters. What's going on?

@traed
Copy link
Author

traed commented Jun 13, 2024

Something on this line goes wrong. $img['path'] points to a resource in cloud storage, not on disk, so it appears to delete the file from the bucket instead of the disk? If I set the filter wp_stateless_skip_remove_media to return true it seems to work better, but why would I need to do this? Surely it can't be intentional to delete files from the bucket when uploading them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant