{"action":"created","issue":{"url":"https://api.github.com/repos/amro/gibbon/issues/165","labels_url":"https://api.github.com/repos/amro/gibbon/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/amro/gibbon/issues/165/comments","events_url":"https://api.github.com/repos/amro/gibbon/issues/165/events","html_url":"https://github.com/amro/gibbon/issues/165","id":119924266,"number":165,"title":"403 Error in Production on Heroku, No Error Message","user":{"login":"travisjtodd","id":47908,"avatar_url":"https://avatars.githubusercontent.com/u/47908?v=3","gravatar_id":"","url":"https://api.github.com/users/travisjtodd","html_url":"https://github.com/travisjtodd","followers_url":"https://api.github.com/users/travisjtodd/followers","following_url":"https://api.github.com/users/travisjtodd/following{/other_user}","gists_url":"https://api.github.com/users/travisjtodd/gists{/gist_id}","starred_url":"https://api.github.com/users/travisjtodd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisjtodd/subscriptions","organizations_url":"https://api.github.com/users/travisjtodd/orgs","repos_url":"https://api.github.com/users/travisjtodd/repos","events_url":"https://api.github.com/users/travisjtodd/events{/privacy}","received_events_url":"https://api.github.com/users/travisjtodd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-02T11:41:45Z","updated_at":"2015-12-02T14:15:04Z","closed_at":"2015-12-02T13:53:42Z","body":"I'm trying to determine if this is a Gibbon problem or a Heroku one. My upsert code is working fine in development, locally and in the remote heroku rails console. It's only failing in my controller and with a very unhelpful error message.\r\n\r\nHere is the controller code (list_id and API Key removed):\r\n\r\n```\r\n  def subscribe\r\n    gibbon = Gibbon::Request.new(api_key: \"[API KEY]\")\r\n    # newsletter list: a2308943f1\r\n    gibbon.lists('abcdefg12345').members(Digest::MD5.hexdigest(params[\"email\"][\"email\"])).upsert(body: {\r\n      email_address: params[\"email\"][\"email\"], \r\n      status: \"subscribed\"\r\n    })\r\n\r\n    respond_to do |format|\r\n      format.html\r\n      format.js\r\n    end \r\n\r\n  rescue Gibbon::MailChimpError => error\r\n    @error = {\r\n      title: error.title, \r\n      detail: error.detail, \r\n      body: error.body, \r\n      raw_body: error.raw_body, \r\n      status_code: error.status_code\r\n    }\r\n\r\n    logger.info('Error saving email:')\r\n    logger.info(@error.inspect)\r\n\r\n    respond_to do |format|\r\n      format.html\r\n      format.js\r\n    end \r\n\r\n  end\r\n```\r\n\r\nAnd here's the console output (cleaned of timestamps and ip addresses):\r\n\r\n```\r\napp[web.1]: Started POST \"/mailchimp/subscribe\"\r\napp[web.1]: Completed 200 OK in 25ms (Views: 0.9ms | ActiveRecord: 0.0ms)\r\napp[web.1]: Processing by MailchimpController#subscribe as JS\r\napp[web.1]:   Parameters: {\"utf8\"=>\"✓\", \"authenticity_token\"=>\"nMaj0GAxGCneJySytVx65S8gScXq+li6IV5QbfRsLsA=\", \"email\"=>{\"email\"=>\"travis@example.com\"}, \"commit\"=>\"Keep me updated\"}\r\napp[web.1]: Error saving email:\r\napp[web.1]: {:title=>nil, :detail=>nil, :body=>nil, :raw_body=>nil, :status_code=>403}\r\napp[web.1]:   Rendered mailchimp/subscribe.js.erb (0.1ms)\r\n```\r\n\r\nAs you can see the captured error contains no information. Should I be looking at heroku for why it isn't working or is there something I forgot to do with Gibbon to get it working in production?\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/amro/gibbon/issues/comments/161308868","html_url":"https://github.com/amro/gibbon/issues/165#issuecomment-161308868","issue_url":"https://api.github.com/repos/amro/gibbon/issues/165","id":161308868,"user":{"login":"amro","id":16900,"avatar_url":"https://avatars.githubusercontent.com/u/16900?v=3","gravatar_id":"","url":"https://api.github.com/users/amro","html_url":"https://github.com/amro","followers_url":"https://api.github.com/users/amro/followers","following_url":"https://api.github.com/users/amro/following{/other_user}","gists_url":"https://api.github.com/users/amro/gists{/gist_id}","starred_url":"https://api.github.com/users/amro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amro/subscriptions","organizations_url":"https://api.github.com/users/amro/orgs","repos_url":"https://api.github.com/users/amro/repos","events_url":"https://api.github.com/users/amro/events{/privacy}","received_events_url":"https://api.github.com/users/amro/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T14:15:04Z","updated_at":"2015-12-02T14:15:04Z","body":"This is unfortunate. I've heard that sending email from EC2, in general, is problematic. I once had the pleasure of working MailChimp so it's easy for me to see their perspective. If they're not careful in handling abuse, then their IPs are blacklisted and their deliverability is negatively impacted. They take this very seriously (and I don't blame them!).\r\n\r\nIt stinks that devs are caught in the middle of it. I'm sorry to hear it."}}