כיצד לנקות את נקודת הקצה של S3 בעת מעבר מדלי GCP ל-AWS S3?

סיכום מבוסס בינה מלאכותית

In a Support discussion titled How to clear S3 endpoint when moving from GCP bucket to AWS s3?, pfaffman explains that their Discourse site still uses a GCP S3 endpoint (https://storage.googleapis.com) stored in the database, despite setting DISCOURSE_S3_ENDPOINT: "" in the environment — which has no effect. Attempts to manually set the correct AWS endpoint previously failed due to uncertainty about the exact regional URL. pfaffman is now considering removing ENV variables, manually updating site settings via the admin interface, then rebuilding the container with proper AWS credentials. P16 confirms that manually changing site settings before adding ENV variables and rebuilding worked for them in the past. pfaffman adds that their setup is further complicated by Kubernetes, requiring configmap edits and redeployments. P16 shares that they’ve also experienced ENV variable propagation issues (e.g., with CORS) requiring multiple rebuilds to take effect, and wishes pfaffman luck. The core issue remains: how to properly clear or override a hardcoded S3 endpoint in Discourse’s site settings without manual intervention or rebuild cycles.

I’ve got a site with S3 buckets on GCP, so it has an endpoint set. That endpoint is in the sitesettings in the database somehow, so including DISCOURSE_S3_ENDPOINT: "" in the ENV does . . . nothing. Rather than clearing the value so that Discourse will substitute the “right” one, it insists on using the GCP endpoint with the AWS bucket keys and such.

I tried explicitly setting the endpoint to the AWS one, but the one that I guessed wasn’t quite right somehow, so it wouldn’t work (that was weeks ago so I can’t remember the particulars).

My idea now is to remove the ENV variables when I crank up the container, manually change over the settings to the new AWS ones, so THEN I can set the env variables as described here and build a new container. Is there something easier that I’m overlooking?

Is there some way to set a NULL environment variable, maybe?

@pfaffman the last time I had to reset them I changed the site settings, added the ENV variables and then rebuilt.

PS: is the current (incorrect one) set to https://storage.googleapis.com?

That’s what I’m working on now. It’s further complicated because it’s a k8s deployment, so I have to jiggle the configmap, then redeploy, then change the settings, and on like that.

Yes, that’s the current endpoint. I found the AWS endpoint for the region once, but there are apparently a couple different permutations of it.

A bit unrelated but when I have had issues with ENV variables being taken up (with CORS settings for example) I have had to do several rounds of different combinations to get the variables in.

Hopefully you get it sorted soon!