The user wanghaisheng is experiencing an error when running rake uploads:migrate_to_s3 on Discourse 2.4.0.beta9, with the error NoMethodError: undefined method name’ for :vapid_public_key:Symboloriginating from theprocourse-custom-homepage` plugin. Despite the plugin not being present in the filesystem wanghaisheng, the error persists. Falco suggests the plugin is the root cause, and codinghorror recommends removing it and rebuilding. The user reports that the migration fails to complete, leaving 2 uploads unmigrated, and the process is inconsistent after rebuilds. The issue appears unrelated to Cloudflare’s Fortify settings or S3 headers wanghaisheng, as the error occurs during initialization.
still when i git pull source code and rebuild app to (f7a7263164)
rake uploads:migrate_to_s3
Checking if default already migrated...
2 of 300 uploads are not migrated to S3. S3 migration failed for db 'default'.
Looking for missing uploads on: default
0 post uploads are missing.
No posts require rebaking
Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files => 284 files
- Listing S3 files. => 285 files
- Syncing files to S3
............................................................................................................................................................................................................................................................................................
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
3 posts were flagged for a rebake
rake aborted!
2 of 300 uploads are not migrated to S3. S3 migration failed for db 'default'.
/var/www/discourse/lib/tasks/uploads.rake:238:in `migration_successful?'
/var/www/discourse/lib/tasks/uploads.rake:551:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:216:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.0.7/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.0.7/lib/rails_multisite/connection_management.rb:73:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:214:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:210:in `block in <top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => uploads:migrate_to_s3
(See full trace by running task with --trace)
** Invoke uploads:migrate_to_s3 (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute uploads:migrate_to_s3
Checking if default already migrated...
2 of 301 uploads are not migrated to S3. S3 migration failed for db 'default'.
** Invoke posts:missing_uploads (first_time)
** Invoke environment
** Execute posts:missing_uploads
Looking for missing uploads on: default
0 post uploads are missing.
54 posts still require rebaking and will be rebaked during regular job
Migrating uploads to S3 for 'default'...
Uploading files to S3...
- Listing local files => 286 files
- Listing S3 files. => 294 files
- Syncing files to S3
..............................................................................................................................................................................................................................................................................................
Updating the URLs in the database...
Removing old optimized images...
Flagging all posts containing lightboxes for rebake...
69 posts were flagged for a rebake
rake aborted!
2 of 301 uploads are not migrated to S3. S3 migration failed for db 'default'.
/var/www/discourse/lib/tasks/uploads.rake:238:in `migration_successful?'
/var/www/discourse/lib/tasks/uploads.rake:551:in `migrate_to_s3'
/var/www/discourse/lib/tasks/uploads.rake:216:in `block in migrate_to_s3_all_sites'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.0.7/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.0.7/lib/rails_multisite/connection_management.rb:73:in `each_connection'
/var/www/discourse/lib/tasks/uploads.rake:214:in `migrate_to_s3_all_sites'
/var/www/discourse/lib/tasks/uploads.rake:210:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:281:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:160:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `each'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:116:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:125:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:110:in `top_level'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli/exec.rb:63:in `load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli/exec.rb:63:in `kernel_load'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli.rb:476:in `exec'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli.rb:30:in `dispatch'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/cli.rb:24:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/exe/bundle:46:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-2.1.1/exe/bundle:34:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => uploads:migrate_to_s3
make a fresh installation of discourse to test,with the same s3 setting ,successfully run rebake and migrate command ,when images upload done ,url is still not the cdn url + image filename https://cp.antivte.com/t/topic/14
it seems i use Fortify in cloudflare for Nine out of ten doctors agree that [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), [HSTS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security), and [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) Headers are part of a well-balanced breakfast.
and just add s3 to header like this ,woola