{"action":"created","issue":{"url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1107","labels_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1107/labels{/name}","comments_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1107/comments","events_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1107/events","html_url":"https://github.com/sharetribe/sharetribe/issues/1107","id":64811222,"number":1107,"title":"rake assets:precompile fail with aws S3","user":{"login":"Pequi-eu","id":10832444,"avatar_url":"https://avatars.githubusercontent.com/u/10832444?v=3","gravatar_id":"","url":"https://api.github.com/users/Pequi-eu","html_url":"https://github.com/Pequi-eu","followers_url":"https://api.github.com/users/Pequi-eu/followers","following_url":"https://api.github.com/users/Pequi-eu/following{/other_user}","gists_url":"https://api.github.com/users/Pequi-eu/gists{/gist_id}","starred_url":"https://api.github.com/users/Pequi-eu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pequi-eu/subscriptions","organizations_url":"https://api.github.com/users/Pequi-eu/orgs","repos_url":"https://api.github.com/users/Pequi-eu/repos","events_url":"https://api.github.com/users/Pequi-eu/events{/privacy}","received_events_url":"https://api.github.com/users/Pequi-eu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-27T17:26:00Z","updated_at":"2015-04-02T14:24:27Z","closed_at":null,"body":"Hi everyone and first, thanks for the great job to the sharetribe team!\r\n\r\nI deployed Sharetribe on my Mac without any problem and I'm now trying to do it on AWS (EC2 + RDS + S3).\r\nEverything was fine, I just did some modifications (to avoid mistakes) like:\r\n\r\n- add 'mercury/rails’ in config/application.rb\r\n- modified config.assets.compile = false by true in config/environments/production.rb\r\n\r\nI created a 'aws_access_key_id' and a 'aws_secret_access_key' for S3 with the IAM (the user with the id has a complete access to S3)\r\n\r\nI'm now since 2 days at rake assets:precompile, and nothing seems to happen. I have the following:\r\n\r\n----------------------------\r\n[ec2-user@ip-XXX-XXX-XXX sharetribe]$ rake assets:precompile\r\nDigest::Digest is deprecated; use Digest\r\n/usr/local/rvm/rubies/ruby-2.1.2/bin/ruby /usr/local/rvm/gems/ruby-2.1.2/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets\r\nDigest::Digest is deprecated; use Digest\r\nAssetSync: using /home/ec2-user/sharetribe/config/initializers/asset_sync.rb\r\n\r\nAssetSync enabled: false\r\n\r\nUsing the following AssetSync configuration:\r\naws_access_key_id:     XXXXXXXXXXXXXXXXXXXXXXXX\r\naws_secret_access_key: ****************************************\r\nfog_directory:         Not available\r\nfog_provider:          Not available\r\n\r\nDigest::Digest is deprecated; use Digest\r\nAssetSync: using /home/ec2-user/sharetribe/config/initializers/asset_sync.rb\r\n\r\nAssetSync enabled: false\r\n\r\nUsing the following AssetSync configuration:\r\naws_access_key_id:     XXXXXXXXXXXXXXXXXXXXXXXX\r\naws_secret_access_key: ****************************************\r\nfog_directory:         Not available\r\nfog_provider:          Not available\r\n\r\n--------------\r\nThat's all it does, and of course 'rake RAILS_ENV=production jobs:work' does not work after that. I thought it was a S3 mistake so a follow instructions here https://github.com/sharetribe/sharetribe/issues/665 by creating the same CORS. But it still does not work.\r\n\r\nRegarding fog, I don't if I have to specify something and if yes, where ;-).\r\n\r\nIf you have any idea/suggestion, feel free to tell :-)\r\n\r\nThanks a lot"},"comment":{"url":"https://api.github.com/repos/sharetribe/sharetribe/issues/comments/88927152","html_url":"https://github.com/sharetribe/sharetribe/issues/1107#issuecomment-88927152","issue_url":"https://api.github.com/repos/sharetribe/sharetribe/issues/1107","id":88927152,"user":{"login":"Pequi-eu","id":10832444,"avatar_url":"https://avatars.githubusercontent.com/u/10832444?v=3","gravatar_id":"","url":"https://api.github.com/users/Pequi-eu","html_url":"https://github.com/Pequi-eu","followers_url":"https://api.github.com/users/Pequi-eu/followers","following_url":"https://api.github.com/users/Pequi-eu/following{/other_user}","gists_url":"https://api.github.com/users/Pequi-eu/gists{/gist_id}","starred_url":"https://api.github.com/users/Pequi-eu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pequi-eu/subscriptions","organizations_url":"https://api.github.com/users/Pequi-eu/orgs","repos_url":"https://api.github.com/users/Pequi-eu/repos","events_url":"https://api.github.com/users/Pequi-eu/events{/privacy}","received_events_url":"https://api.github.com/users/Pequi-eu/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T14:24:27Z","updated_at":"2015-04-02T14:24:27Z","body":"When looking at config/initializers/asset_sync.rb, it is coded:\r\n\r\naws_access_key_id = app_config.aws_access_key_id\r\naws_secret_access_key = app_config.aws_secret_access_key\r\nfog_directory = app_config.FOG_DIRECTORY\r\nfog_provider = app_config.FOG_PROVIDER\r\n\r\nWhere 'fog_directory' refers not to 's3_bucket_name' but to 'FOG_DIRECTORY'. However, there is no parameter in any Sharetribe files, to specify FOG_DIRECTORY. I suppose it is maybe because it's an Heroku parameter (I'm not using Heroku)? That's why I added FOG_DIRECTORY = mybucket.\r\n\r\nThen always in config/initializers/asset_sync.rb, Asset Sync is enable when:\r\n\r\nenabled = [aws_access_key_id, aws_secret_access_key, fog_directory].all? { |x| x.is_some? }\r\n\r\nSo, with that, I activate Active Sync.\r\n\r\nWhen I run rake assets:precompile, I have now:\r\n-----------------\r\nAssetSync: using /home/ec2-user/sharetribe/config/initializers/asset_sync.rb\r\n\r\nAssetSync enabled: true\r\n\r\nUsing the following AssetSync configuration:\r\naws_access_key_id:     AAAAAAAAAAAAAAAAAAAAAAA\r\naws_secret_access_key: ****************************************\r\nfog_directory:         mybuket\r\nfog_provider:          AWS\r\n\r\nAssetSync: Syncing.\r\n--------------\r\nBut then it fails with a HTTP error 400 (and finally not 301, because I made a mistake in the Region).\r\nExcon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request)\r\n\r\nWhen I activate EXCON_DEBUG, I can check that it is trying to access to the good server, but I don't understand why the request is not good.\r\n-----------\r\n\r\nexcon.request  {:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>false, :debug_response=>false, :headers=>{\"User-Agent\"=>\"excon/0.25.3\", \"Date\"=>\"Thu, 02 Apr 2015 11:56:05 +0000\", \"Authorization\"=>\"REDACTED\", \"Host\"=>\"mybucket.s3-eu-central-1.amazonaws.com:443\"}, :idempotent=>true, :instrumentor_name=>\"excon\", :middlewares=>[Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>\"mybucket.s3-eu-central-1.amazonaws.com\", :path=>\"/\", :port=>\"443\", :query=>{\"prefix\"=>\"assets\"}, :scheme=>\"https\", :user=>nil, :password=>\"REDACTED\", :instrumentor=>Excon::StandardInstrumentor, :expects=>200, :method=>\"GET\", :response_block=>#<Proc:0x000000096f0668@/usr/local/rvm/gems/ruby-2.1.2/gems/fog-1.9.0/lib/fog/core/connection.rb:17 (lambda)>, :retries_remaining=>4, :connection=>#<Excon::Connection:96f25f8 @data={:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>false, :debug_response=>false, :headers=>{\"User-Agent\"=>\"excon/0.25.3\"}, :idempotent=>false, :instrumentor_name=>\"excon\", :middlewares=>[Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>\"s3-eu-central-1.amazonaws.com\", :path=>\"/\", :port=>\"443\", :query=>nil, :scheme=>\"https\", :user=>nil, :password=>nil, :instrumentor=>Excon::StandardInstrumentor} @socket_key=\"https://s3-eu-central-1.amazonaws.com:443\">, :stack=>#<Excon::Middleware::ResponseParser:0x000000096efd58 @stack=#<Excon::Middleware::Expects:0x000000096efda8 @stack=#<Excon::Middleware::Idempotent:0x000000096efdd0 @stack=#<Excon::Middleware::Instrumentor:0x000000096efdf8 @stack=#<Excon::Middleware::Mock:0x000000096efe70 @stack=#<Excon::Connection:96f25f8 @data={:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>false, :debug_response=>false, :headers=>{\"User-Agent\"=>\"excon/0.25.3\"}, :idempotent=>false, :instrumentor_name=>\"excon\", :middlewares=>[Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>false, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>\"s3-eu-central-1.amazonaws.com\", :path=>\"/\", :port=>\"443\", :query=>nil, :scheme=>\"https\", :user=>nil, :password=>nil, :instrumentor=>Excon::StandardInstrumentor} @socket_key=\"https://s3-eu-central-1.amazonaws.com:443\">>>>>>}"}}