@Falco I this still the case? I thought I read something about recent issues using AWS but I can’t find the topic again.
I am having numerous using AWS S3 using the various relevant topics as guides.
Backups are working as expected but using Cloudfront as CDN or uncommenting DISCOURSE_USE_S3 and/or DISCOURSE_S3_BUCKET causes a perpetual throbber to happen.
I suspect I have something misconfigured in the uploads bucket and/or the Cloudfront distribution but I have not been able to find a mistake. Both upload and backup buckets are behind the distribution and backups work fine so???
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -E -u discourse bundle exec rake s3:upload_assets failed with return #<Process::Status: pid 8484 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.3.0/lib/pups/exec_command.rb:131: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.
as always… Any thoughts or suggestions would be appreciated.
./launcher enter app
rake posts:rebake
rake uploads:migrate_to_s3
rake posts:rebake_uncooked_posts
Throbber persists.
rake uploads:migrate_to_s3 does yield an error
Migrating uploads to S3 for 'default'...
Some uploads were not migrated to the new scheme. Running the migration, this may take a while...
rake aborted!
FileStore::ToS3MigrationError: Some uploads could not be migrated to the new scheme. You need to fix this manually. (FileStore::ToS3MigrationError)
/var/www/discourse/lib/file_store/to_s3_migration.rb:156:in `migrate_to_s3'
/var/www/discourse/lib/file_store/to_s3_migration.rb:59:in `migrate'
/var/www/discourse/lib/tasks/uploads.rake:126:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:106:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:49:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management/null_instance.rb:36:in `each_connection'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rails_multisite-7.0.0/lib/rails_multisite/connection_management.rb:17:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:104:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:100:in `block in <main>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => uploads:migrate_to_s3
The assets are called from the cdn, but are they there? If not, are they in the bucket? Are they accessible from the bucket?
You likely have some uploads in a different bucket or something that keeps them from being in the expected place. If so, you’ll need to fix those by hand like it sats. You’ll need to access the console and see where they are on the upload record.
Does the upload assets task seem to be working? The throbber keeps running because the other assets are no loading.
Only two buckets, uploads and backups. Backups are working fine.
rake s3:upload_assets gave error:
rake aborted!
Aws::S3::Errors::AccessControlListNotSupported: The bucket does not allow ACLs (Aws::S3::Errors::AccessControlListNotSupported)
Switched to ACLs enabled and ran s3:upload_assetsedit: uploads:migrate_to_s3 again but…
FileStore::ToS3MigrationError: Some uploads could not be migrated to the new scheme. You need to fix this manually. (FileStore::ToS3MigrationError)
??? You need to fix this manually. (FileStore::ToS3MigrationError)
It sounds like you fixed the bucket and it’s now able to upload assets, so the site should work now. Dealing with the uploads that won’t migrate is another (complicated) issue.
Yes. The cert doesn’t match the host name. It matches *.cloudfront.net
This works: https://repeal-obbba-discuss-uploads.s3.us-east-1.amazonaws.com/assets/logo-815195ae.png
This does not work: https://discourse-cdn.repealobbba.org/assets/start-discourse-6f03a463.br.js
This works: https://repeal-obbba-discuss-uploads.s3.us-east-1.amazonaws.com/assets/start-discourse-6f03a463.br.js
So you need to change your s3 CDN to https://repeal-obbba-discuss-uploads.s3.us-east-1.amazonaws.com – oh, I guess that’s the bucket address, so that wouldn’t be ideal, but it would work.
Maybe it is just me but adding a CDN that @Discourse uses internally should maybe not be so difficult and require the kind support from folks like @pfaffman
Maybe @Falco or @sam and @team (can’t mention team) can chime in??
Thanks for confirming! After seeing this I re-adjusted DISCOURSE_S3_CDN_URL: back to amazonassigned.cloudfront.net hoping it my clear the cert and url issues.
The rebuilt and re ran all the rakes mentioned in docs.
rake posts:rebake
rake uploads:migrate_to_s3 still generates FileStore::ToS3MigrationError
rake posts:rebake_uncooked_posts