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

When changing month on calendar , image paths change #712

Closed
angpao opened this issue Feb 1, 2024 · 37 comments
Closed

When changing month on calendar , image paths change #712

angpao opened this issue Feb 1, 2024 · 37 comments
Assignees
Milestone

Comments

@angpao
Copy link

angpao commented Feb 1, 2024

I have some problem when changing month , Image url change

for example,

from "gcp/2024/01/a.png" to "gcp/2024/02/a.png"

and Media cannot see last month images.

Seting mode is stateless.

The problem occur with Feature Images only but image in content no problem.
Why? and How to solve?

@ewsopp
Copy link
Member

ewsopp commented Feb 2, 2024

Image paths are stored in the database, and changing the File URL setting in WP-Stateless would not break previously uploaded images.

@angpao
Copy link
Author

angpao commented Feb 5, 2024

  • For image added on content that is image path in database "year/month/imagename.png" no problem , but Feature image of post no have "year/month" in image path on database.
  • Media setting cannot display all images in google storage but display on this month only when changing month can not display image last month.

Why? and How to solve?

@planv
Copy link
Contributor

planv commented Feb 5, 2024

Hello @angpao

but Feature image of post no have "year/month" in image path on database.

The Feature image should work the same as other Medias.
I've just checked - I see Feature Images that were added in the previous month.

Have you tried disabling other Plugins and using the default Theme for test it?

@angpao
Copy link
Author

angpao commented Apr 1, 2024

I tried to create new server and install wordpress (bitnami) and add wp-stateless again but the features images url is incorrect everymonth Why?
last month is url
https://storage.googleapis.com/bucketname/2024/03/a83d22f4-ironman4.jpeg
current month is url
https://storage.googleapis.com/bucketname/2024/04/a83d22f4-ironman4.jpeg

How to check code file url ? Can I change file url to use GUID instead of that ?

and when choose features images again no show as attached file as below
Screenshot 2567-04-05 at 09 06 19

@angpao
Copy link
Author

angpao commented Apr 23, 2024

How to solve ?

@balexey88
Copy link
Contributor

Hello @angpao,

I've tried several combinations of the settings, but still your issue does not reproduce. Most likely it is related to your environment.
Our latest version, v4.0.3, now offers an easy way to share relevant technical information with us.

Please visit Media Libary/Stateless Settings/Status tab, copy the information there and share with us here.

Thanks in advance.

@angpao
Copy link
Author

angpao commented Apr 25, 2024

I copied that as below

### Server

Server architecture: Linux 6.1.0-18-cloud-amd64 x86_64
Web server: nginx/1.25.4
MySQL version: 11.2.3-MariaDB
PHP Version: 8.2.17
PHP Memory Limit: 512M
PHP Max Input Vars: 1000
PHP Max Post Size: 80M
PHP Time Limit: 30
Max Upload Size: 80M
Allow URL-aware fopen Wrappers: Yes
Loaded Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, intl, SPL, ldap, mbstring, session, standard, pcntl, exif, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, readline, Reflection, mysqli, SimpleXML, soap, sockets, sodium, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imagick, memcached, Zend OPcache

### WordPress

Version: 6.5.2
Multisite: No
Memory Limit: 40M
Total Attachments: 21
Image Sizes: thumbnail, medium, medium_large, large, 1536x1536, 2048x2048
Theme: Twenty Twenty-Four 1.0
Active Plugins: AMP 2.5.3, Jetpack 13.2.2, WP-Stateless 4.0.3

### WP-Stateless

Version: 4.0.3
Database Version: 1.0
Mode: Stateless
File URL Replacement: Enable Editor & Meta
Supported File Types: jpg jpeg png gif pdf
Bucket: Set
Bucket Accessible: Yes
Service Account JSON: Set
Cache-Control: Default: public, max-age=36000, must-revalidate
Delete GCS File: Disable
Folder: %date_year/date_month%
Domain: Not set
Cache-Busting: Enable
Dynamic Image Support: Disable
Use Post Meta: Disable
Total Files: 12
Total File Sizes: 0
Compatibility Files: 0

@balexey88 balexey88 self-assigned this Apr 26, 2024
@ewsopp
Copy link
Member

ewsopp commented Apr 26, 2024

@angpao What features have you activated within Jetpack? Did you upload images in your new test environment?

@angpao
Copy link
Author

angpao commented Apr 29, 2024

Now , I deleted jetpack plugins and yes test environment.

### Server

Server architecture: Linux 6.1.0-18-cloud-amd64 x86_64
Web server: nginx/1.25.4
MySQL version: 11.2.3-MariaDB
PHP Version: 8.2.17
PHP Memory Limit: 512M
PHP Max Input Vars: 1000
PHP Max Post Size: 80M
PHP Time Limit: 30
Max Upload Size: 80M
Allow URL-aware fopen Wrappers: Yes
Loaded Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, intl, SPL, ldap, mbstring, session, standard, pcntl, exif, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, readline, Reflection, mysqli, SimpleXML, soap, sockets, sodium, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imagick, memcached, Zend OPcache

### WordPress

Version: 6.5.2
Multisite: No
Memory Limit: 40M
Total Attachments: 21
Image Sizes: thumbnail, medium, medium_large, large, 1536x1536, 2048x2048
Theme: Twenty Twenty-Four 1.0
Active Plugins: AMP 2.5.3, WP-Stateless 4.0.3

### WP-Stateless

Version: 4.0.3
Database Version: 1.0
Mode: Stateless
File URL Replacement: Enable Editor & Meta
Supported File Types: jpg jpeg png gif pdf
Bucket: Set
Bucket Accessible: Yes
Service Account JSON: Set
Cache-Control: Default: public, max-age=36000, must-revalidate
Delete GCS File: Disable
Folder: %date_year/date_month%
Domain: Not set
Cache-Busting: Enable
Dynamic Image Support: Disable
Use Post Meta: Disable
Total Files: 12
Total File Sizes: 0
Compatibility Files: 0

But the same problem no show feature images in last month.

@angpao
Copy link
Author

angpao commented Apr 29, 2024

I configed wp-stateless with google cloud storage using wp-stateless -> config File URL -> Folder -> Single site -> /%date_year/date_month%/ and mode is "stateless" and File URL Replacement is "Enable Editor & Meta" and more default.

When I uploaded features images of post by wordpress , The images path was saved correct in google cloud storage.

But the problem have just happened on changing month , the file url was changed and also the images is not show on media library . I want to know how wp-stateless plugins work getting file url for features images? Could you explain in details coding? I will help you check this issue.

@balexey88
Copy link
Contributor

Hello @angpao,

There seems to be a problem with image sizes on your site.
You have number of image sizes in WP:

Image Sizes: thumbnail, medium, medium_large, large, 1536x1536, 2048x2048

But seems like image sizes are not generated upon image upload. In the status you have 12 files in Media Library, nut 0 file sizes.

Total Files: 12
Total File Sizes: 0

Seems like the upload process breaks at some point, without generating image sizes and most likely without saving correct post meta for images.

Could you please open any image for editing:
image

then go to the very button of the page and check the Stateless section, does it have links for different image sizes?

image

Also, if this is possible for you, could you please enable debugging, upload an image and check log for errors?

@angpao
Copy link
Author

angpao commented Apr 30, 2024

I try to debug mode but no log because no error. when I edited images , no show Thumbnails any sizes.

Screenshot 2567-04-30 at 13 04 16 Screenshot 2567-04-30 at 10 43 28

As below when i tested upload one image , Google cloud storage have 3 files

Screenshot 2567-04-30 at 11 07 26 Screenshot 2567-04-30 at 15 56 04 Screenshot 2567-04-30 at 16 00 19 Screenshot 2567-04-30 at 16 06 41 Screenshot 2567-04-30 at 16 07 17 Screenshot 2567-04-30 at 16 13 48 Screenshot 2567-04-30 at 16 17 35

and google cloud storage location type "Region".

As above in details of our wordpress config and settings.
I think that Wordpress have cropped image size because I saw the images in google cloud storage such as 150x150,300 , and original size. Now this month is April (.../2024/04/...) and tomorrow I will check file url again that file url change or not ? and send to you again.

@ewsopp
Copy link
Member

ewsopp commented Apr 30, 2024

Do you have the same problem after disabling the AMP 2.5.3 plugin?

@angpao
Copy link
Author

angpao commented May 1, 2024

I don't disable AMP.
Today , I checked file url changed every month (from 30 apr to 1 may) and image not shown as figure below
Screenshot 2567-05-01 at 08 47 21

Screenshot 2567-05-01 at 08 42 03

Please see file url from "/2024/04/..." to "/2024/05/...". Why auto just changed year and month folder?

How to fix this issue? , I don't want to change folder year and month.

How to solve?

@angpao
Copy link
Author

angpao commented May 2, 2024

I found that when I cleared config of wp-stateless setting at Folder is blank (single site) then File URL of images will no have year/month appended.
So I think that wp-stateless get parameter current year/month of setting to replace file URL.
from
Screenshot 2567-05-02 at 15 29 46

to

Screenshot 2567-05-02 at 15 33 16

File url changed from "/2024/05/test.png" to "test.png".

Because It should only be used when uploading an image. It should not affect images that have already been uploaded in the previous month.

How to avoid this process?

@planv
Copy link
Contributor

planv commented May 2, 2024

@angpao

For some reason WP-Stateless attachment metadata is not saved to the DB in your case.
That's why it creates path automatically and uses current year/month every time instead fetching it from the DB.

It is a wrong behaviour, all metadata should be saved to DB.

Can you please check tables wp_stateless_files and wp_stateless_file_sizes? Do they contain data?

Also please check wp_postmeta table and run this query to check WP-Stateless metadata there:

SELECT * FROM wp_postmeta
WHERE meta_key = "sm_cloud"

@angpao
Copy link
Author

angpao commented May 2, 2024

Screenshot 2567-05-02 at 21 34 48 Screenshot 2567-05-02 at 21 37 09 Screenshot 2567-05-02 at 21 33 11 Screenshot 2567-05-02 at 21 34 41

but guid in wp_posts table is correct as below
Screenshot 2567-05-02 at 21 50 04

@planv
Copy link
Contributor

planv commented May 2, 2024

Thank you @angpao

We are preparing a version for you where we can figure out the reason why it is not working properly.
It will be ready soon, we will keep you in touch.

@balexey88
Copy link
Contributor

Hello @angpao ,

We prepared test version of the plugin with extended diagnostics, please download zip from https://github.com/udx/wp-stateless/releases/tag/4.0.3-test712 and install.
Then please upload any image file and send logs to us.

Thank you!

@angpao
Copy link
Author

angpao commented May 9, 2024

I tested and logs as below

[09-May-2024 13:17:45 UTC] $image_sizes:
[09-May-2024 13:17:45 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"/opt/bitnami/wordpress/wp-content/uploads/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769}}
[09-May-2024 13:17:45 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:47 UTC] $image_sizes:
[09-May-2024 13:17:47 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769},"medium":{"gs_name":"2024/05/c7071258-superman-300x167.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-300x167.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":300,"height":167}}
[09-May-2024 13:17:47 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:47 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:47 UTC] $image_sizes:
[09-May-2024 13:17:47 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769},"medium":{"gs_name":"2024/05/c7071258-superman-300x167.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-300x167.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":300,"height":167},"large":{"gs_name":"2024/05/c7071258-superman-1024x571.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-1024x571.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":1024,"height":571}}
[09-May-2024 13:17:47 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:47 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:47 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:48 UTC] $image_sizes:
[09-May-2024 13:17:48 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769},"medium":{"gs_name":"2024/05/c7071258-superman-300x167.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-300x167.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":300,"height":167},"large":{"gs_name":"2024/05/c7071258-superman-1024x571.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-1024x571.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":1024,"height":571},"thumbnail":{"gs_name":"2024/05/c7071258-superman-150x150.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-150x150.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":150,"height":150}}
[09-May-2024 13:17:48 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:48 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:48 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:48 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] $image_sizes:
[09-May-2024 13:17:49 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769},"medium":{"gs_name":"2024/05/c7071258-superman-300x167.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-300x167.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":300,"height":167},"large":{"gs_name":"2024/05/c7071258-superman-1024x571.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-1024x571.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":1024,"height":571},"thumbnail":{"gs_name":"2024/05/c7071258-superman-150x150.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-150x150.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":150,"height":150},"medium_large":{"gs_name":"2024/05/c7071258-superman-768x429.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-768x429.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":768,"height":429}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] $image_sizes:
[09-May-2024 13:17:49 UTC] {"__full":{"gs_name":"2024/05/c7071258-superman.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman.jpeg","sm_meta":true,"is_thumb":false,"mime_type":"image/jpeg","width":1378,"height":769},"medium":{"gs_name":"2024/05/c7071258-superman-300x167.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-300x167.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":300,"height":167},"large":{"gs_name":"2024/05/c7071258-superman-1024x571.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-1024x571.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":1024,"height":571},"thumbnail":{"gs_name":"2024/05/c7071258-superman-150x150.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-150x150.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":150,"height":150},"medium_large":{"gs_name":"2024/05/c7071258-superman-768x429.jpeg","path":"gs://intl-web-storage-lb3/2024/05/c7071258-superman-768x429.jpeg","sm_meta":true,"is_thumb":true,"mime_type":"image/jpeg","width":768,"height":429}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}
[09-May-2024 13:17:49 UTC] {"error":{"code":400,"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","errors":[{"message":"Cannot update access control for an object when uniform bucket-level access is enabled. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access","domain":"global","reason":"invalid"}]}}

@balexey88
Copy link
Contributor

Hello @angpao,

Please switch bucket permission control from Uniform to Fine-grained. To do this in Google Cloud Console open your bucket, open Configuration tab, in the Permissions section edit Access Control and switch to Fine-grained.

image

Then try to upload an image again. After upload please open the edit page for this last uploaded image and check Stateless section as we did previously.
The list of image sizes with links should be there. Also wp_stateless_file_sizes table should contain the new records.

Please let us know the result.

Thanks!

@angpao
Copy link
Author

angpao commented May 9, 2024

Now , I cannot switch permission because no have "icon edit".
Screenshot 2567-05-09 at 21 33 33

How to do? and all images were uploaded , how to solve?

@balexey88
Copy link
Contributor

@angpao, seems like you don't have the required permissions in Google Cloud.

You can also try to set WP_STATELESS_SKIP_ACL_SET constant in your WordPress config file. This can also help.

For existing images please try to run Media Library Images sync from Stateless Settings.

Please let us know the result. Thanks!

@angpao
Copy link
Author

angpao commented May 10, 2024

I configed in wp-config.php as figure out
Screenshot 2567-05-10 at 14 39 33

and tried to upload new image no have thumbnails.
Screenshot 2567-05-10 at 14 40 56

and sync again have the same problem.

and old images no show.

Screenshot 2567-05-10 at 14 43 21

I think that wp-stateless plugin cannot support access uniform of gcp , right?

It can support ACL.

How to migrate from uniform to ACL of all images ?

I think that I have to create new google cloud storage for ACL and upload old images again , right? I don't want to do that
because i have a lot of images and spend times.

Do you have any solution?

@balexey88
Copy link
Contributor

balexey88 commented May 10, 2024

Hello @angpao,

Google does not allow to change bucket access control after 90 days, so this is probably the reason why edit button is disabled for you.
image

We've prepared another test version, which supports WP_STATELESS_SKIP_ACL_SET constant for your use case. Please install and test the update:
https://github.com/udx/wp-stateless/archive/refs/tags/4.0.3-test712.zip

For existing images sync will not work in Stateless mode. You can switch to CDN or Ephemeral mode and run Sync for images. This will download the images to your hard drive and re-process them. Then you can switch to Stateless mode again.

As always, please let us know the result.

Thank you!

@angpao
Copy link
Author

angpao commented May 12, 2024

I installed this "https://github.com/udx/wp-stateless/archive/refs/tags/4.0.3-test712.zip" and tested already.
It can support uniform of gcp and awesome. When I uploaded new images that have thumbnail all path of gcp and also meta value. this version can solved my issue.

Even though the previous images of last month such as "2024/04/..." , I have to manual copy to folder "2024/05" of gcp before then change to
"Ephemeral" and sync again. All images have thumbnail and meta.

Thank you very much for your willingness and support.

Can you update plugins in production? , I will download and install again.

@planv
Copy link
Contributor

planv commented May 15, 2024

Can you update plugins in production? , I will download and install again.

It will be included in next release.

Thank you for your help!

@angpao
Copy link
Author

angpao commented May 15, 2024

Thanks, About when will you release it?

@balexey88
Copy link
Contributor

Hello @angpao ,

Currently we are working on the next release. Once it is done we will let you know.

Thank you for your patience and collaboration!

@andreibryk
Copy link

Any updates here?
Yesterday all my media files links changed from https://storage.googleapis.com/*/2024/05/* to https://storage.googleapis.com/*/2024/06/*.

@MouMohsen
Copy link

Is there any temporary fix? , the website is broken
The URL changed and images are not displayed

This was referenced Jun 27, 2024
@ewsopp ewsopp added this to the 4.0.4 milestone Jun 27, 2024
@balexey88
Copy link
Contributor

Hello,

Thanks for your polite patience. Please try our new release 4.0.4, it should fix the issue.

@planv
Copy link
Contributor

planv commented Jun 28, 2024

@angpao @andreibryk @MouMohsen Please let us know how it works for you.

@FlorianValery
Copy link

@planv We are running 4.0.4 and ran into the same issue today. All our image URLs changed to current month and broke production. Any suggestions so it doesn't happen again next month?

@planv
Copy link
Contributor

planv commented Aug 1, 2024

hey @FlorianValery

Do you use this constant WP_STATELESS_SKIP_ACL_SET ?

https://stateless.udx.io/docs/constants/

More information - #712 (comment)

@ewsopp ewsopp closed this as completed Aug 16, 2024
@MedElevus
Copy link

Hello, I have this issue.
First of all it happens with me on October 1st and I wasn't know the problem is where, so I upload my all media again. Yesterday it happened again and all my media path changed from 2024/10 to 2024/11 and doesn't load correctly. I read all the above comments but don't find the solution or the only solution I found is to copy data in the bucket file 10 to 11. Please tell me if there is any recommendations or solutions.

My settings for GCP bucket is uniform
My settings for WP-Stateless:

That's my status:

### Server

Server architecture: Linux 6.1.0-25-cloud-amd64 x86_64
Web server: Apache
MySQL version: 11.4.3-MariaDB
MySQL default engine: InnoDB
PHP Version: 8.2.24
PHP Memory Limit: 512M
PHP Max Input Vars: 1000
PHP Max Post Size: 80M
PHP Time Limit: 30
Max Upload Size: 80M
Allow URL-aware fopen Wrappers: Yes
Loaded Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, intl, SPL, ldap, mbstring, session, standard, pcntl, exif, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, random, readline, Reflection, mysqli, SimpleXML, soap, sockets, sodium, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, cgi-fcgi, imagick, memcached, Zend OPcache

### WordPress

Home URL: https://medelevus.com
Site URL: https://medelevus.com
Version: 6.6.2
Multisite: No
Memory Limit: 40M
Total Attachments: 416
Image Sizes (14): (150x150) thumbnail, (300x300) medium, (768x0) medium_large, (1024x1024) large, 1536x1536, 2048x2048, (0x0) woocommerce_thumbnail, (0x0) woocommerce_single, (0x0) woocommerce_gallery_thumbnail, (0x0) profile_24, (0x0) profile_48, (0x0) profile_96, (0x0) profile_150, (0x0) profile_300
Theme: FSE Education School 2.0.3
Active Plugins: Adminimize 1.11.11, All-in-One WP Migration Unlimited 6.77, Better Search Replace 1.4.7, Big File Uploads 2.1.3, Code Snippets 3.6.5.1, Contact Form 7 5.9.8, CURCY - Multi Currency for WooCommerce 2.2.3, Disable User Gravatar 3.1, Elementor 3.25.3, Essential Blocks 5.0.7, Flamingo 2.5, FV Player 7.5.48.7212, Google Analytics for WordPress by MonsterInsights 9.2.1, Google for WooCommerce 2.8.6, LearnPress 4.2.7.2, LearnPress - Certificates 4.1.2, LearnPress - Content Drip 4.0.6, LearnPress - Course Review 4.1.4, LearnPress - Course Wishlist 4.0.8, LearnPress - Mobile App 4.0.3, LearnPress - Prerequisites Courses 4.0.7, LearnPress - Students List 4.0.2, LearnPress - WooCommerce Payment Methods Integration 4.1.4, LoginPress 3.2.2, Mailchimp for WooCommerce 4.4.1, Paymob for WooCommerce 2.0.2, Redirection 5.5.0, Ultimate Member 2.8.9, UpdraftPlus - Backup/Restore 1.24.6, UserFeedback Lite 1.2.0, User Profile Picture 2.6.3, WooCommerce 9.3.3, WooCommerce PayPal Payments 2.9.3, Wordfence Security 7.11.7, WP-Stateless 4.1.2, WP Activity Log 5.2.1, WP Content Copy Protection & No Right Click 3.6.1, WP Fastest Cache 1.3.1, WP Mail SMTP 4.1.1, WP phpMyAdmin 5.2.1.13, Yoast SEO 23.7

### WP-Stateless

Version: 4.1.2
Database Version: 1.2
Mode: Stateless
File URL Replacement: Enable Editor & Meta
Supported File Types: jpg jpeg png gif pdf mp4 mov avi mkv webm
Bucket: Set
Bucket Accessible: Yes
Service Account JSON: Set
Cache-Control: Default: public, max-age=36000, must-revalidate
Delete GCS File: Enable
Folder: %date_year/date_month%
Domain: Not set
Cache-Busting: Enable
Dynamic Image Support: Disable
Use Site URL for REST API Requests: WP_HOME
REST API Status: %api_status%
AJAX Status: %ajax_status%
Use Post Meta: Enable
Total Files: 1
Total File Sizes: 0
Compatibility Files: 0
Data Optimization: 20240423174109: Skipped, 20240219175240: Finished

### Google Cloud

Storage Class: STANDARD
Public Access Prevention: Inherited
Access Control: Uniform
Versioning: Enabled
Soft Delete: Enabled

@MedElevus
Copy link

Hello again,
I found one solution which is exhausting but will work.
In the StateLess setting choose custom and enter a folder name inside the bucket for example "site media".
Then go to your bucket file of each month and move the files from it to the new created file.

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

8 participants