Rebuild issue: [Cannot set dual-stack in combination with a custom endpoint.]

Hello :wave:

Cannot rebuild with the following issue.

I, [2024-11-07T08:00:56.758061 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets
rake aborted!
ArgumentError: Cannot set dual-stack in combination with a custom endpoint. (ArgumentError)

          raise ArgumentError, "Cannot set dual-stack in combination with a custom endpoint."
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FAILED

--------------------

Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets failed with return #<Process::Status: pid 3349 exit 1>

Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'

exec failed with the params {"cd"=>"$home", "cmd"=>["sudo -E -u discourse bundle exec rake s3:upload_assets", "sudo -E -u discourse bundle exec rake s3:expire_missing_assets"]}

bootstrap failed with exit code 1

** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

./discourse-doctor may help diagnose the problem.

567dc9e1f9a4e662de6024b8504915d8b6ef1ee2d9b4303af75323ba478679e4

Probably related commit: FIX: Use dualstack S3 endpoint for direct uploads (#29611) · discourse/discourse@0568d36 · GitHub

I use S3 object storage upload to DO Spaces. The issue is probably with this.

Thanks :slight_smile:

1 Like

I commented out these lines which makes the rebuild run successfully but the site stuck on splash I think because cannot load assets. :thinking: Safe mode same…

  after_assets_precompile:
    - exec:
        cd: $home
        cmd:
          - sudo -E -u discourse bundle exec rake s3:upload_assets
          - sudo -E -u discourse bundle exec rake s3:expire_missing_assets

Any idea? I know it’s a bad timing… :confused:

1 Like

Hey Don, we’ll have a look. Thanks for reporting.

1 Like

Thanks Natalie :hugs:

For quick fix I’ve rebuild with cc01555fce59e116b76c912b4c5195e111a652b2 version, which is one commit behind this FIX: Use dualstack S3 endpoint for direct uploads (#29611) · discourse/discourse@0568d36 · GitHub

2 Likes

My rebuild with a Digital Ocean Spaces S3 setup started failing with this error:

, [2024-11-07T19:09:38.615466 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets                                                   
rake aborted!                                                                                                                                                                     
ArgumentError: Cannot set dual-stack in combination with a custom endpoint. (ArgumentError)
                                                                                         
          raise ArgumentError, "Cannot set dual-stack in combination with a custom endpoint."                                                                                     
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/endpoint_provider.rb:34:in `resolve_endpoint'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/endpoints.rb:37:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/endpoint.rb:47:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/param_validator.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/sse_cpk.rb:24:in `call'

But omitting setting it to whatever makes the build fail like this:

                                                                                         
I, [2024-11-07T19:15:31.060936 #1]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets                                                   
ERROR: Ensure S3 is configured in config/discourse.conf or environment vars              
I, [2024-11-07T19:15:36.056204 #1]  INFO -- :                                            
                                                                                         
                                           

I found this:

and this:

Maybe S3_REGION should be cleared if an endpoint is set here?

EDIT: Oops. I thought I’d searched. Sorry Falco.

1 Like

(post deleted by author)

2 Likes

Strangely, that gives me this error:

Gem::LoadError: can't activate webrick-1.9.0, already activated webrick-1.8.2 (Gem::LoadError)

which I’d just seen on an instance I was using to run an import, which I “fixed” by upgrading.

I guess I just can’t upgrade this server right now. :frowning:

I am not sure but maybe worth a try. I did a rebuild succesfully before do this.

And just after this try to rebuild with pick the commit. Second time run the rebuild successfully.

1 Like

@martin usually what we do here is providing a GlobalSetting to disable the behavior that people running incompatible S3 clones can then opt-in to make it work.

IMO, the current behavior should stay as the default, but provide toggles to increase compatibility.

See prior art in DISCOURSE_S3_HTTP_CONTINUE_TIMEOUT, DISCOURSE_S3_INSTALL_CORS_RULE, etc.

2 Likes