Skip to content

Could not connect to Google Storage bucket #810

@metuck2

Description

@metuck2

Bug Description

I am experiencing a persistent "Could not connect to Google Storage bucket" notice from the WP-Stateless plugin. The connection was working previously but suddenly stopped. My site is currently non-functional due to a fatal error caused by this connection failure.

Symptoms

WP-Stateless Settings Page: I see the following notice: "Could not connect to Google Storage bucket. Please be sure that bucket with name stateless-bacons-castle exists and the access credentials are correct."

Error Log (/nas/content/live/baconscastlebc/wp-content/debug.log): The log shows a recurring fatal error:

PHP Fatal error: Uncaught Google\Cloud\Core\Exception\ServiceException: {
"error": {
"code": 401,
"message": "Invalid Credentials",
"errors": [
{
"message": "Invalid Credentials",
"domain": "global",
"reason": "authError",
"locationType": "header",
"location": "Authorization"
}
]
}
}
This fatal error is triggered by the mailchimp-for-wp plugin attempting to use WP-Stateless's file handling, as evidenced by the stack trace: wp-content/plugins/mailchimp-for-wp/includes/functions.php is calling file_put_contents which then calls the WP-Stateless library.

Environment

Server Architecture: Linux 5.15.0-1081-gke x86_64

Web server: nginx

MySQL Version: 8.0.42-33

PHP Version: 8.2.29

WordPress Version: 6.8.2

WP-Stateless Version: 4.2.0

Hosting Provider: Pantheon

Plugins: A complete list of active plugins is available in the provided site status report. Key plugins of note are WP-Stateless, WPBakery Page Builder (js_composer), and Mailchimp for WordPress.

Troubleshooting Steps Taken

Verified Google Cloud Setup:

I confirmed that the bucket stateless-bacons-castle exists.

I checked the permissions for the service account stateless-bacons-castle-183@.... It has the Storage Admin role, as shown in the attached screenshot.

I created a new JSON key for the service account on Sep 3, 2025, and confirmed it is "Active."

I have repeatedly re-copied the new JSON key and pasted it into the WP-Stateless settings field.

Cleared Caching:

I manually cleared the wp-content/cache/wpsol-minification folder via FTP.

I have no direct access to the Pantheon dashboard to clear its cache, but I've been advised this could be a factor.

Attempted Data Optimization:

WP-Stateless is prompting for a "Data Optimization" due to an update. I attempted to run this process. (Please specify if this process completed or also failed).

Expected Behavior

WP-Stateless should successfully connect to the Google Cloud Storage bucket using the provided credentials, and the "Could not connect" notice should disappear. The data optimization process should complete without error.

My Analysis

The recurring Invalid Credentials fatal error, coupled with the PHP warnings in WP-Stateless code, suggests that even with a new, active key, the plugin is failing to establish a connection. This could be caused by:

Stale credentials being held in a caching layer (e.g., Pantheon's platform cache).

A plugin conflict (likely with Mailchimp for WP) that prevents the plugin from correctly loading or using the credentials, leading to a fatal error.

The required data optimization process failing or being blocked, leaving the plugin in an unstable state.

I'm seeking guidance on how to move forward, particularly with the Pantheon caching layer and the potential plugin conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions