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

Open
angpao opened this issue Feb 1, 2024 · 29 comments
Open

When changing month on calendar , image paths change #712

angpao opened this issue Feb 1, 2024 · 29 comments
Assignees

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

@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
Collaborator

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
Collaborator

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!

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

4 participants