The backup has failed.
Here’s the log:
undefined method `start_with?' for nil /var/www/discourse/app/models/site_setting.rb:172:in `use_dualstack_endpoint’
/var/www/discourse/lib/s3_helper.rb:269:in `s3_options' /var/www/discourse/lib/backup_restore/s3_backup_store.rb:14:in `initialize’
/var/www/discourse/lib/backup_restore/backup_store.rb:17:in `new'`
after a very recent rebuild to latest.
In my case S3 is hosted with a vanilla AWS bucket.
I use minio object storage for my s3 and get this error:
rake aborted!
Aws::S3::Errors::Http504Error: Aws::S3::Errors::Http504Error (Aws::S3::Errors::Http504Error)
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/raise_response_errors.rb:17: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'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/dualstack.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/plugins/accelerate.rb:43:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/checksum_algorithm.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:16:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/idempotency_token.rb:19:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/param_converter.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/request_callback.rb:89:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/response_paging.rb:12:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/plugins/response_target.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/seahorse/client/request.rb:72:in `send_request'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/client.rb:11285:in `list_objects_v2'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/bucket.rb:1304:in `block (2 levels) in objects'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/plugins/user_agent.rb:28:in `feature'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-s3-1.143.0/lib/aws-sdk-s3/bucket.rb:1303:in `block in objects'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:101:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:101:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:101:in `block in non_empty_batches'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:52:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:52:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:52:in `block in each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:58:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:58:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/aws-sdk-core-3.191.3/lib/aws-sdk-core/resources/collection.rb:58:in `each'
/var/www/discourse/lib/tasks/s3.rake:14:in `map'
/var/www/discourse/lib/tasks/s3.rake:14:in `existing_assets'
/var/www/discourse/lib/tasks/s3.rake:210:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => s3:expire_missing_assets
(See full trace by running task with --trace)
I, [2024-11-11T08:02:51.942337 #1] INFO -- : Checking for stale S3 assets...
I, [2024-11-11T08:02:51.944197 #1] INFO -- : Terminating async processes
I, [2024-11-11T08:02:51.944334 #1] INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 39
I, [2024-11-11T08:02:51.944432 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 107
2024-11-11 08:02:51.944 UTC [39] LOG: received fast shutdown request
107:signal-handler (1731312171) Received SIGTERM scheduling shutdown...
2024-11-11 08:02:51.945 UTC [39] LOG: aborting any active transactions
2024-11-11 08:02:51.949 UTC [39] LOG: background worker "logical replication launcher" (PID 54) exited with exit code 1
2024-11-11 08:02:51.950 UTC [49] LOG: shutting down
107:M 11 Nov 2024 08:02:51.960 # User requested shutdown...
107:M 11 Nov 2024 08:02:51.960 * Saving the final RDB snapshot before exiting.
2024-11-11 08:02:52.047 UTC [39] LOG: database system is shut down
107:M 11 Nov 2024 08:02:52.207 * DB saved on disk
107:M 11 Nov 2024 08:02:52.208 # Redis is now ready to exit, bye bye...
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:expire_missing_assets failed with return #<Process::Status: pid 3550 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.
4f601885ffad64bcd29f6dbd06df1f0f86ad301341d40e752df7447809a32eff
No. That’s the issue, I’m pretty sure. They are using S3 for backups, but not for uploads, which is a pretty common setup for self-hosters. It’s easy to configure S3 backups, and doesn’t require a CDN or changing the YML to upload assets to precompile.
It’s blank because they aren’t using S3 for uploads.
I have the same… logged into my storage provider to check if I paid the bill, and I did.
Why would such a breaking change be pushed without any announcement?
Are we meant to enter all details in app.yml now?
Why are all settings removed from the admin backend? How can we retrieve those settings? I’ve set this up once years ago and have no clue what my key or secret is and I’m not even sure if I can retrieve this without resetting the key (which would affect other services I use the same s3 endpoints for…)
Because it wasn’t supposed to break anything, but the s3 code has to support a whole bunch of edge cases, and unless you wrote that code or paid attention to its development over the years it’s pretty hard to jump in and see just how big the problem really is.
Sorry all, I was off sick for a couple of days. This should fix the problem:
I tried this locally with S3 uploads disabled and S3 backups enabled before and after the fix, I was able to replicate the same error and then resolve it.