Uploads to S3 broken, Backups to S3 work

(Jim) #1

I’m attempting to integrate S3 uploads with my Discourse instance. I’m using version running in a docker container. I’ve filled in all the settings related to S3 uploads and S3 backups.

The Uploads aren’t showing up on S3 but when I ran a backup it did show on S3.

Sidekiq shows the following:

I’ve tried to find more detailed error info but have come up empty handed. From what I gather it may be an issue with my S3 settings, yet those settings did work for the backup.

Any ideas?

(Régis Hanol) #2

Do you see anything related to S3 in /logs?

(Jim) #3

I didn’t know /logs existed :smiley:

Here’s the error info on the sideqik failure I previously posted:

exception: Discourse::InvalidParameters
context: {"retry"=>true, "queue"=>"default", "class"=>"Jobs::GenerateAvatars", "args"=>[{"user_id"=>1, "upload_id"=>1, "current_site_id"=>"default"}], "jid"=>"d1bb096491d830411122e584", "enqueued_at"=>1399608853.587885, "error_message"=>"Discourse::InvalidParameters", "error_class"=>"Discourse::InvalidParameters", "failed_at"=>1399608853.612114, "retry_count"=>4, "retried_at"=>1399609285.6210868}
backtrace: /var/www/discourse/lib/file_helper.rb:10:in `download'
/var/www/discourse/lib/file_store/s3_store.rb:52:in `download'
/var/www/discourse/app/jobs/regular/generate_avatars.rb:18:in `execute'
/var/www/discourse/app/jobs/base.rb:131:in `block (2 levels) in perform'

Here’s the backtrace:

Here’s a db error that seems to be occuring during the GenerateAvatars job:

PG::Error: ERROR:  missing FROM-clause entry for table "users"
LINE 1: ...  WHERE (user_stats.has_custom_avatar = false AND users.trus...
: SELECT  "user_stats".* FROM "user_stats"  WHERE (user_stats.has_custom_avatar = false AND users.trust_level > 0)  ORDER BY random() LIMIT 500

Here’s the backtrace for that error:

(Jeff Atwood) #4

Is this a logster bug @sam?


I’m getting the same error in my installation

(Sam Saffron) #6

I am cleaning up the backtraces, its sort of a bug, I need to pass through more context.

(Régis Hanol) #7

Could you tell me what Upload.find(1).url returns?

(Justin Leveck) #8

I receive the following error:

Excon::Errors::MovedPermanently (Expected(200) <=> Actual(301 Moved Permanently)
  response => #<Excon::Response:0x007f6a8c61cb98 @data={:body=>"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message>


  lib/file_store/s3_store.rb:125:in `get_or_create_directory'
  lib/file_store/s3_store.rb:139:in `upload'
  lib/file_store/s3_store.rb:84:in `store_file'
  lib/file_store/s3_store.rb:11:in `store_upload'
  app/models/upload.rb:99:in `create_for'
  app/controllers/uploads_controller.rb:9:in `create'
  lib/middleware/anonymous_cache.rb:119:in `call'
  config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
  config/initializers/silence_logger.rb:24:in `call'
  lib/middleware/unicorn_oobgc.rb:95:in `process_client'

(Jeff Atwood) #9

Did this get resolved?

(Thomas Wilson) #10

I’m getting the same error when attempting to backup to s3

(Jong Eun Lee) #11

I’ve got the same error message with Tokyo(ap-northeast-1).
After change region to US standard region(us-east-1), it works properly.

But I don’t know why backup doesn’t work with ap-northeast-1 region.