I am new to mailers in rails. I have deployed to heroku and the emails are sending and being received fine. The issue is that none of the mailers are rendering the views.
That was not always the case. I must have moved something vital to that connection and broke the connection. Can you tell me how to reconnect the views to the mailer?
I am on rails 3.2 and here is the information you may need to answer:
In the invitation model:
after_create do |invitation|
InvitationMailer.delay.invitation_email(self)
end
And in mailers:
class InvitationMailer < ActionMailer::Base
helper ActionView::Helpers::UrlHelper
default from: "noreply#lumeo.com"
def invitation_email(invite)
#invitation = invite
mail(to: invite.recipient_email,
subject: "Invitation",
:template_path => 'mailers/invitation_email')
end
end
And finally, the view is located at views/mailers:
You are invited to join our beta!
<%= link_to 'Sign Up', signup_with_token_url(#invitation.token) %>
This line is routed correctly and is working as I have tested it in the past, but the view is no longer rendered in the body of the email...
Dev Logs:
Started POST "/invitations" for 127.0.0.1 at 2012-11-04 17:00:22 -0800
Processing by InvitationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"SwmmoRObXNI5PoXYhGFc4zsqLulSJ4iq0v9VbcRBJ3E=", "invitation"=>{"recipient_email"=>"brian#labyrinth.com"}, "commit"=>"Send Invite"}
User Load (0.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
(0.2ms) BEGIN
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'brian#labyrinth.com' LIMIT 1
(0.2ms) UPDATE "users" SET "invitation_limit" = 6, "updated_at" = '2012-11-05 01:00:22.236722' WHERE "users"."id" = 2
SQL (0.3ms) INSERT INTO "invitations" ("created_at", "recipient_email", "sender_id", "sent_at", "token", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 05 Nov 2012 01:00:22 UTC +00:00], ["recipient_email", "brian#labyrinth.com"], ["sender_id", 2], ["sent_at", nil], ["token", "650e4773e64a1120355e5392ecfea2fefb47dabf"], ["updated_at", Mon, 05 Nov 2012 01:00:22 UTC +00:00]]
Sent mail to brian#labyrinth.com (917ms)
Date: Sun, 04 Nov 2012 17:00:22 -0800
From: noreply#lumeo.com
To: brian#labyrinth.com
Message-ID: <50970fa63e33c_6673fd1a1035ae061987#Retina.local.mail>
Subject: Invitation
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
(1.6ms) COMMIT
Redirected to http://localhost:3000/invitations
Completed 302 Found in 942ms (ActiveRecord: 3.3ms)
Started GET "/invitations" for 127.0.0.1 at 2012-11-04 17:00:23 -0800
Processing by InvitationsController#index as HTML
User Load (0.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Invitation Load (0.3ms) SELECT "invitations".* FROM "invitations"
Rendered invitations/index.html.erb within layouts/application (1.5ms)
Rendered layouts/_stylesheets.html.erb (4.7ms)
Image Load (0.5ms) SELECT "images".* FROM "images" WHERE "images"."parent_id" = 2 AND "images"."parent_type" = 'User' LIMIT 1
Role Load (0.4ms) SELECT "roles".* FROM "roles" INNER JOIN "assignments" ON "roles"."id" = "assignments"."role_id" WHERE "assignments"."user_id" = 2
Rendered layouts/_header.html.erb (9.6ms)
Rendered layouts/_footer.html.erb (0.6ms)
Completed 200 OK in 31ms (Views: 26.4ms | ActiveRecord: 2.0ms)
Heroku Logs:
2012-11-05T01:09:21+00:00 app[web.2]: Started POST "/invitations" for 76.175.198.239 at 2012-11-05 01:09:21 +0000
2012-11-05T01:09:22+00:00 app[worker.1]: [Worker(host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2)] Starting job worker
2012-11-05T01:09:22+00:00 app[worker.1]: Starting the New Relic Agent.
2012-11-05T01:09:22+00:00 app[worker.1]: [Worker(host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2)] New Relic Ruby Agent Monitoring DJ worker host:4ba7555d-5659-4f95-a8fb-13326b458480 pid:2
2012-11-05T01:09:23+00:00 app[web.2]: Processing by InvitationsController#create as HTML
2012-11-05T01:09:23+00:00 app[web.2]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"Utls4PaX/7TkwyZkhZnkm3pf8llGoX/j5LskL+9rO40=", "invitation"=>{"recipient_email"=>"brian#labyrinthvisuals.com"}, "commit"=>"Send Invite"}
2012-11-05T01:09:23+00:00 app[web.2]: User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4528 LIMIT 1
2012-11-05T01:09:23+00:00 app[web.2]: (3.2ms) BEGIN
2012-11-05T01:09:23+00:00 app[web.2]: User Load (3.4ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'brian#labyrinthvisuals.com' LIMIT 1
2012-11-05T01:09:23+00:00 app[web.2]: (0.8ms) UPDATE "users" SET "invitation_limit" = 90, "updated_at" = '2012-11-05 01:09:21.797013' WHERE "users"."id" = 4528
2012-11-05T01:09:23+00:00 app[web.2]: SQL (1.6ms) INSERT INTO "invitations" ("created_at", "recipient_email", "sender_id", "sent_at", "token", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["created_at", Mon, 05 Nov 2012 01:09:21 UTC +00:00], ["recipient_email", "brian#labyrinthvisuals.com"], ["sender_id", 4528], ["sent_at", nil], ["token", "53e21931e3481036c9019f8245e518b5ce8343aa"], ["updated_at", Mon, 05 Nov 2012 01:09:21 UTC +00:00]]
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]: Sent mail to brian#labyrinthvisuals.com (886ms)
2012-11-05T01:09:23+00:00 app[web.2]: Date: Mon, 05 Nov 2012 01:09:22 +0000
2012-11-05T01:09:23+00:00 app[web.2]: From: noreply#lumeo.com
2012-11-05T01:09:23+00:00 app[web.2]: To: brian#labyrinthvisuals.com
2012-11-05T01:09:23+00:00 app[web.2]: Message-ID: <509711c25d54a_2fc899c84342#52b7b88c-4573-408e-8219-a12f9c4087fb.mail>
2012-11-05T01:09:23+00:00 app[web.2]: Subject: Invitation
2012-11-05T01:09:23+00:00 app[web.2]: Mime-Version: 1.0
2012-11-05T01:09:23+00:00 app[web.2]: Content-Type: text/plain;
2012-11-05T01:09:23+00:00 app[web.2]: charset=UTF-8
2012-11-05T01:09:23+00:00 app[web.2]: Content-Transfer-Encoding: 7bit
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 heroku[router]: POST www.lumeo.com/invitations dyno=web.2 queue=0 wait=0ms service=1857ms status=302 bytes=98
2012-11-05T01:09:23+00:00 app[web.2]: (3.7ms) COMMIT
2012-11-05T01:09:23+00:00 app[web.2]: Redirected to http://www.lumeo.com/invitations
2012-11-05T01:09:23+00:00 app[web.2]: Completed 302 Found in 1543ms (ActiveRecord: 22.2ms)
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]:
2012-11-05T01:09:23+00:00 app[web.2]: Started GET "/invitations" for 76.175.198.239 at 2012-11-05 01:09:23 +0000
2012-11-05T01:09:24+00:00 heroku[router]: GET www.lumeo.com/invitations dyno=web.2 queue=0 wait=0ms service=727ms status=200 bytes=8052
2012-11-05T01:09:24+00:00 app[web.2]: Role Load (1.5ms) SELECT "roles".* FROM "roles" INNER JOIN "assignments" ON "roles"."id" = "assignments"."role_id" WHERE "assignments"."user_id" = 4528
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_header.html.erb (544.9ms)
2012-11-05T01:09:24+00:00 app[web.2]: User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = 4528 LIMIT 1
2012-11-05T01:09:24+00:00 app[web.2]: Invitation Load (2.3ms) SELECT "invitations".* FROM "invitations"
2012-11-05T01:09:24+00:00 app[web.2]: Processing by InvitationsController#index as HTML
2012-11-05T01:09:24+00:00 app[web.2]: Rendered invitations/index.html.erb within layouts/application (4.8ms)
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_stylesheets.html.erb (0.8ms)
2012-11-05T01:09:24+00:00 app[web.2]: Image Load (1.6ms) SELECT "images".* FROM "images" WHERE "images"."parent_id" = 4528 AND "images"."parent_type" = 'User' LIMIT 1
2012-11-05T01:09:24+00:00 app[web.2]: Rendered layouts/_footer.html.erb (1.3ms)
2012-11-05T01:09:24+00:00 app[web.2]: Completed 200 OK in 708ms (Views: 664.3ms | ActiveRecord: 39.2ms)
2012-11-05T01:09:24+00:00 app[web.1]: => Booting Thin
2012-11-05T01:09:24+00:00 app[web.1]: => Rails 3.2.3 application starting in production on http://0.0.0.0:59079
2012-11-05T01:09:24+00:00 app[web.1]: => Call with -d to detach
2012-11-05T01:09:24+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : Dispatcher: thin
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : Application: sharp-flower-5688
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:23 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : New Relic Ruby Agent 3.4.1 Initialized: pid = 2
2012-11-05T01:09:24+00:00 app[web.1]: ** [NewRelic][11/05/12 01:09:24 +0000 1a2f3028-d8e6-415a-889a-de99cac2c096 (2)] INFO : NewRelic::Agent::Samplers::DelayedJobSampler sampler not available: No DJ worker present
2012-11-05T01:09:24+00:00 app[web.2]: Connected to NewRelic Service at collector-5.newrelic.com
2012-11-05T01:09:24+00:00 app[web.2]: ** [NewRelic][11/05/12 01:09:24 +0000 52b7b88c-4573-408e-8219-a12f9c4087fb (2)] INFO : Reporting performance data every 60 seconds.
Please help. These are some of the last things I need to do before I launch publicly...tomorrow...
The view will not render if the file name or path is incorrect.
In this case, you should have:
app/views/invitation_mailer/invitation_email.text.erb
and if you want html also:
app/views/invitation_mailer/invitation_email.html.erb
You shouldn't have to set :template_path
Related
I've been running into an issue with ActiveStorage attachments where making multiple requests for attachments never resolve.
This seems to occur when the server is newly restarted and is replicable until a single attachment is requested, after which all subsequent requests are fine. This only seems to be an issue using the local disk storage. I am returning URLs to the client with rails_blob_url.
Here is a group of requests happening when the client app opens. The server will hang at this point and I am forced to kill the process.
ActiveStorage::Attachment Load (1.5ms) SELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_type" = $1 AND "active_storage_attachments"."record_id" IN ($2, $3, $4, $5, $6) AND "active_storage_attachments"."name" = $7 [["record_type", "PlantClassification"], [nil, "efae55e9-09da-4ab8-875a-714e4ae65c69"], [nil, "bd5bb0bc-f15b-46a3-90db-ff56dc10288a"], [nil, "70e5ae23-0cbf-4d4f-a7bf-11c0cae76b23"], [nil, "37c8f87b-19ef-4617-b27b-467760015df6"], [nil, "bedc432c-9b84-4066-ac36-9b1d35f18515"], ["name", "illustration"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
ActiveStorage::Blob Load (1.0ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" IN ($1, $2, $3, $4) [[nil, "ce43a46b-3b91-407a-8d58-bc977d8f14e9"], [nil, "32ab0730-6fdd-4f13-b07f-d1bf9a510baf"], [nil, "f3d02026-ea9a-4ac3-b055-644f40e212c5"], [nil, "c1edc152-0c44-4256-9aff-753052028c24"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
Completed 200 OK in 249ms (Views: 0.6ms | ActiveRecord: 42.1ms | Allocations: 71673)
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqWlRRellUUTJZaTB6WWpreExUUXdOMkV0T0dRMU9DMWlZemszTjJRNFpqRTBaVGtHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--f8d183c94d1d3851a5b4dbc92e3e44ea47c66d2d/Thaumatophyllum%20bipinnatifidum.png" for localhost at 2022-08-23 10:03:36 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqTVdWa1l6RTFNaTB3WXpRMExUUXlOVFl0T1dGbVppMDNOVE13TlRJd01qaGpNalFHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--6956b9a336f7ebd930d519a5458007096bdba559/Dioscorea%20elephantipes.png" for localhost at 2022-08-23 10:03:36 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt6TW1GaU1EY3pNQzAyWm1Sa0xUUm1NVE10WWpBM1ppMWtNV0ptT1dFMU1UQmlZV1lHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--e46cc15d446e6c99255b6a571ece8d7d257671fa/Hevea%20brasiliensis.png" for localhost at 2022-08-23 10:03:36 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxtTTJRd01qQXlOaTFsWVRsaExUUmhZek10WWpBMU5TMDJORFJtTkRCbE1qRXlZelVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--1bafcabb5204a30aeceb13e71981eb57e3212724/Spathiphyllum%20cochlearispathum.png" for localhost at 2022-08-23 10:03:36 -0400
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxtTTJRd01qQXlOaTFsWVRsaExUUmhZek10WWpBMU5TMDJORFJtTkRCbE1qRXlZelVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--1bafcabb5204a30aeceb13e71981eb57e3212724", "filename"=>"Spathiphyllum cochlearispathum"}
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt6TW1GaU1EY3pNQzAyWm1Sa0xUUm1NVE10WWpBM1ppMWtNV0ptT1dFMU1UQmlZV1lHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--e46cc15d446e6c99255b6a571ece8d7d257671fa", "filename"=>"Hevea brasiliensis"}
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqWlRRellUUTJZaTB6WWpreExUUXdOMkV0T0dRMU9DMWlZemszTjJRNFpqRTBaVGtHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--f8d183c94d1d3851a5b4dbc92e3e44ea47c66d2d", "filename"=>"Thaumatophyllum bipinnatifidum"}
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqTVdWa1l6RTFNaTB3WXpRMExUUXlOVFl0T1dGbVppMDNOVE13TlRJd01qaGpNalFHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--6956b9a336f7ebd930d519a5458007096bdba559", "filename"=>"Dioscorea elephantipes"}
After restarting the server, I can either grab a URL from the console or act as a user with only one attachment and see the request resolve.
ActiveStorage::Attachment Load (0.7ms) SELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_type" = $1 AND "active_storage_attachments"."record_id" = $2 AND "active_storage_attachments"."name" = $3 [["record_type", "PlantClassification"], ["record_id", "bfcb78c3-8195-4c5c-a133-5d1576406bf3"], ["name", "illustration"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
ActiveStorage::Blob Load (0.4ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 [["id", "1ffd9d73-252d-443c-9e3b-3327d36e7945"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
Completed 200 OK in 139ms (Views: 0.2ms | ActiveRecord: 25.5ms | Allocations: 60451)
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt4Wm1aa09XUTNNeTB5TlRKa0xUUTBNMk10T1dVellpMHpNekkzWkRNMlpUYzVORFVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--defe6fea4a9c4ede750f7ad4ecbd49c7c4e4ccc8/Sansevieria%20trifasciata.png" for localhost at 2022-08-23 10:05:24 -0400
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt4Wm1aa09XUTNNeTB5TlRKa0xUUTBNMk10T1dVellpMHpNekkzWkRNMlpUYzVORFVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--defe6fea4a9c4ede750f7ad4ecbd49c7c4e4ccc8", "filename"=>"Sansevieria trifasciata"}
ActiveStorage::Blob Load (0.4ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", "1ffd9d73-252d-443c-9e3b-3327d36e7945"], ["LIMIT", 1]]
Disk Storage (599.0ms) Generated URL for file at key: hca1bx77xw2k3u5fbn7scuhk0gsn (http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhR05oTVdKNE56ZDRkekpyTTNVMVptSnVOM05qZFdock1HZHpiZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWTJsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOaGJuTmxkbWxsY21saElIUnlhV1poYzJOcFlYUmhMbkJ1WnlJN0lHWnBiR1Z1WVcxbEtqMVZWRVl0T0NjblUyRnVjMlYyYVdWeWFXRWxNakIwY21sbVlYTmphV0YwWVM1d2JtY0dPd1pVT2hGamIyNTBaVzUwWDNSNWNHVkpJZzVwYldGblpTOXdibWNHT3daVU9oRnpaWEoyYVdObFgyNWhiV1U2Q20xbFpHbGgiLCJleHAiOiIyMDIyLTA4LTIzVDE0OjEwOjI1LjMwM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--181e38b4367576b0639af1b202beaa64696a0870/Sansevieria%20trifasciata.png)
Redirected to http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhR05oTVdKNE56ZDRkekpyTTNVMVptSnVOM05qZFdock1HZHpiZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWTJsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOaGJuTmxkbWxsY21saElIUnlhV1poYzJOcFlYUmhMbkJ1WnlJN0lHWnBiR1Z1WVcxbEtqMVZWRVl0T0NjblUyRnVjMlYyYVdWeWFXRWxNakIwY21sbVlYTmphV0YwWVM1d2JtY0dPd1pVT2hGamIyNTBaVzUwWDNSNWNHVkpJZzVwYldGblpTOXdibWNHT3daVU9oRnpaWEoyYVdObFgyNWhiV1U2Q20xbFpHbGgiLCJleHAiOiIyMDIyLTA4LTIzVDE0OjEwOjI1LjMwM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--181e38b4367576b0639af1b202beaa64696a0870/Sansevieria%20trifasciata.png
Completed 302 Found in 606ms (ActiveRecord: 0.4ms | Allocations: 394334)
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhR05oTVdKNE56ZDRkekpyTTNVMVptSnVOM05qZFdock1HZHpiZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWTJsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOaGJuTmxkbWxsY21saElIUnlhV1poYzJOcFlYUmhMbkJ1WnlJN0lHWnBiR1Z1WVcxbEtqMVZWRVl0T0NjblUyRnVjMlYyYVdWeWFXRWxNakIwY21sbVlYTmphV0YwWVM1d2JtY0dPd1pVT2hGamIyNTBaVzUwWDNSNWNHVkpJZzVwYldGblpTOXdibWNHT3daVU9oRnpaWEoyYVdObFgyNWhiV1U2Q20xbFpHbGgiLCJleHAiOiIyMDIyLTA4LTIzVDE0OjEwOjI1LjMwM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--181e38b4367576b0639af1b202beaa64696a0870/Sansevieria%20trifasciata.png" for localhost at 2022-08-23 10:05:25 -0400
Processing by ActiveStorage::DiskController#show as PNG
Parameters: {"encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhR05oTVdKNE56ZDRkekpyTTNVMVptSnVOM05qZFdock1HZHpiZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWTJsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOaGJuTmxkbWxsY21saElIUnlhV1poYzJOcFlYUmhMbkJ1WnlJN0lHWnBiR1Z1WVcxbEtqMVZWRVl0T0NjblUyRnVjMlYyYVdWeWFXRWxNakIwY21sbVlYTmphV0YwWVM1d2JtY0dPd1pVT2hGamIyNTBaVzUwWDNSNWNHVkpJZzVwYldGblpTOXdibWNHT3daVU9oRnpaWEoyYVdObFgyNWhiV1U2Q20xbFpHbGgiLCJleHAiOiIyMDIyLTA4LTIzVDE0OjEwOjI1LjMwM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--181e38b4367576b0639af1b202beaa64696a0870", "filename"=>"Sansevieria trifasciata"}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms | Allocations: 216)
Now I can make the same group of requests as the first log, but see successful redirects for each request.
ActiveStorage::Attachment Load (0.6ms) SELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_type" = $1 AND "active_storage_attachments"."record_id" IN ($2, $3, $4, $5, $6) AND "active_storage_attachments"."name" = $7 [["record_type", "PlantClassification"], [nil, "efae55e9-09da-4ab8-875a-714e4ae65c69"], [nil, "bd5bb0bc-f15b-46a3-90db-ff56dc10288a"], [nil, "70e5ae23-0cbf-4d4f-a7bf-11c0cae76b23"], [nil, "37c8f87b-19ef-4617-b27b-467760015df6"], [nil, "bedc432c-9b84-4066-ac36-9b1d35f18515"], ["name", "illustration"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
ActiveStorage::Blob Load (0.5ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" IN ($1, $2, $3, $4) [[nil, "ce43a46b-3b91-407a-8d58-bc977d8f14e9"], [nil, "32ab0730-6fdd-4f13-b07f-d1bf9a510baf"], [nil, "f3d02026-ea9a-4ac3-b055-644f40e212c5"], [nil, "c1edc152-0c44-4256-9aff-753052028c24"]]
↳ app/graphql/loaders/active_storage_loader.rb:19:in `perform'
Completed 200 OK in 102ms (Views: 0.7ms | ActiveRecord: 8.7ms | Allocations: 24607)
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxtTTJRd01qQXlOaTFsWVRsaExUUmhZek10WWpBMU5TMDJORFJtTkRCbE1qRXlZelVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--1bafcabb5204a30aeceb13e71981eb57e3212724/Spathiphyllum%20cochlearispathum.png" for localhost at 2022-08-23 10:06:00 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqTVdWa1l6RTFNaTB3WXpRMExUUXlOVFl0T1dGbVppMDNOVE13TlRJd01qaGpNalFHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--6956b9a336f7ebd930d519a5458007096bdba559/Dioscorea%20elephantipes.png" for localhost at 2022-08-23 10:06:00 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt6TW1GaU1EY3pNQzAyWm1Sa0xUUm1NVE10WWpBM1ppMWtNV0ptT1dFMU1UQmlZV1lHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--e46cc15d446e6c99255b6a571ece8d7d257671fa/Hevea%20brasiliensis.png" for localhost at 2022-08-23 10:06:00 -0400
Started GET "/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqWlRRellUUTJZaTB6WWpreExUUXdOMkV0T0dRMU9DMWlZemszTjJRNFpqRTBaVGtHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--f8d183c94d1d3851a5b4dbc92e3e44ea47c66d2d/Thaumatophyllum%20bipinnatifidum.png" for localhost at 2022-08-23 10:06:00 -0400
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxtTTJRd01qQXlOaTFsWVRsaExUUmhZek10WWpBMU5TMDJORFJtTkRCbE1qRXlZelVHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--1bafcabb5204a30aeceb13e71981eb57e3212724", "filename"=>"Spathiphyllum cochlearispathum"}
ActiveStorage::Blob Load (0.8ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", "f3d02026-ea9a-4ac3-b055-644f40e212c5"], ["LIMIT", 1]]
Disk Storage (0.6ms) Generated URL for file at key: kctramb83yjmxe73y6y4th2snwo9 (http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhMk4wY21GdFlqZ3plV3B0ZUdVM00zazJlVFIwYURKemJuZHZPUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOd1lYUm9hWEJvZVd4c2RXMGdZMjlqYUd4bFlYSnBjM0JoZEdoMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFOd1lYUm9hWEJvZVd4c2RXMGxNakJqYjJOb2JHVmhjbWx6Y0dGMGFIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNTg5WiIsInB1ciI6ImJsb2Jfa2V5In19--6f956c4338844d0b05141a50b9fcd54ab365bd8a/Spathiphyllum%20cochlearispathum.png)
Redirected to http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhMk4wY21GdFlqZ3plV3B0ZUdVM00zazJlVFIwYURKemJuZHZPUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOd1lYUm9hWEJvZVd4c2RXMGdZMjlqYUd4bFlYSnBjM0JoZEdoMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFOd1lYUm9hWEJvZVd4c2RXMGxNakJqYjJOb2JHVmhjbWx6Y0dGMGFIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNTg5WiIsInB1ciI6ImJsb2Jfa2V5In19--6f956c4338844d0b05141a50b9fcd54ab365bd8a/Spathiphyllum%20cochlearispathum.png
Completed 302 Found in 6ms (ActiveRecord: 0.8ms | Allocations: 1358)
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhMk4wY21GdFlqZ3plV3B0ZUdVM00zazJlVFIwYURKemJuZHZPUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOd1lYUm9hWEJvZVd4c2RXMGdZMjlqYUd4bFlYSnBjM0JoZEdoMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFOd1lYUm9hWEJvZVd4c2RXMGxNakJqYjJOb2JHVmhjbWx6Y0dGMGFIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNTg5WiIsInB1ciI6ImJsb2Jfa2V5In19--6f956c4338844d0b05141a50b9fcd54ab365bd8a/Spathiphyllum%20cochlearispathum.png" for localhost at 2022-08-23 10:06:00 -0400
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqTVdWa1l6RTFNaTB3WXpRMExUUXlOVFl0T1dGbVppMDNOVE13TlRJd01qaGpNalFHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--6956b9a336f7ebd930d519a5458007096bdba559", "filename"=>"Dioscorea elephantipes"}
ActiveStorage::Blob Load (0.8ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", "c1edc152-0c44-4256-9aff-753052028c24"], ["LIMIT", 1]]
Disk Storage (0.6ms) Generated URL for file at key: weqbvcjhz76cwpausnzeo02rcae7 (http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkMlZ4WW5aamFtaDZOelpqZDNCaGRYTnVlbVZ2TURKeVkyRmxOd1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtScGIzTmpiM0psWVNCbGJHVndhR0Z1ZEdsd1pYTXVjRzVuSWpzZ1ptbHNaVzVoYldVcVBWVlVSaTA0SnlkRWFXOXpZMjl5WldFbE1qQmxiR1Z3YUdGdWRHbHdaWE11Y0c1bkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSU9hVzFoWjJVdmNHNW5CanNHVkRvUmMyVnlkbWxqWlY5dVlXMWxPZ3B0WldScFlRPT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYyM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--84b254beeaa2411e5704dd83407a07c8d8dc2797/Dioscorea%20elephantipes.png)
Redirected to http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkMlZ4WW5aamFtaDZOelpqZDNCaGRYTnVlbVZ2TURKeVkyRmxOd1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtScGIzTmpiM0psWVNCbGJHVndhR0Z1ZEdsd1pYTXVjRzVuSWpzZ1ptbHNaVzVoYldVcVBWVlVSaTA0SnlkRWFXOXpZMjl5WldFbE1qQmxiR1Z3YUdGdWRHbHdaWE11Y0c1bkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSU9hVzFoWjJVdmNHNW5CanNHVkRvUmMyVnlkbWxqWlY5dVlXMWxPZ3B0WldScFlRPT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYyM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--84b254beeaa2411e5704dd83407a07c8d8dc2797/Dioscorea%20elephantipes.png
Completed 302 Found in 6ms (ActiveRecord: 0.8ms | Allocations: 1439)
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWt6TW1GaU1EY3pNQzAyWm1Sa0xUUm1NVE10WWpBM1ppMWtNV0ptT1dFMU1UQmlZV1lHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--e46cc15d446e6c99255b6a571ece8d7d257671fa", "filename"=>"Hevea brasiliensis"}
ActiveStorage::Blob Load (0.5ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", "32ab0730-6fdd-4f13-b07f-d1bf9a510baf"], ["LIMIT", 1]]
Disk Storage (0.7ms) Generated URL for file at key: frmxxn5e9opkrct18suxv1utz5vl (http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhabkp0ZUhodU5XVTViM0JyY21OME1UaHpkWGgyTVhWMGVqVjJiQVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpV1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtobGRtVmhJR0p5WVhOcGJHbGxibk5wY3k1d2JtY2lPeUJtYVd4bGJtRnRaU285VlZSR0xUZ25KMGhsZG1WaEpUSXdZbkpoYzJsc2FXVnVjMmx6TG5CdVp3WTdCbFE2RVdOdmJuUmxiblJmZEhsd1pVa2lEbWx0WVdkbEwzQnVad1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9LYldWa2FXRT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYzOVoiLCJwdXIiOiJibG9iX2tleSJ9fQ==--1987211a5046bb567ad47cf466a0b4887380b1c8/Hevea%20brasiliensis.png)
Redirected to http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhabkp0ZUhodU5XVTViM0JyY21OME1UaHpkWGgyTVhWMGVqVjJiQVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpV1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtobGRtVmhJR0p5WVhOcGJHbGxibk5wY3k1d2JtY2lPeUJtYVd4bGJtRnRaU285VlZSR0xUZ25KMGhsZG1WaEpUSXdZbkpoYzJsc2FXVnVjMmx6TG5CdVp3WTdCbFE2RVdOdmJuUmxiblJmZEhsd1pVa2lEbWx0WVdkbEwzQnVad1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9LYldWa2FXRT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYzOVoiLCJwdXIiOiJibG9iX2tleSJ9fQ==--1987211a5046bb567ad47cf466a0b4887380b1c8/Hevea%20brasiliensis.png
Completed 302 Found in 5ms (ActiveRecord: 0.5ms | Allocations: 1383)
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkMlZ4WW5aamFtaDZOelpqZDNCaGRYTnVlbVZ2TURKeVkyRmxOd1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtScGIzTmpiM0psWVNCbGJHVndhR0Z1ZEdsd1pYTXVjRzVuSWpzZ1ptbHNaVzVoYldVcVBWVlVSaTA0SnlkRWFXOXpZMjl5WldFbE1qQmxiR1Z3YUdGdWRHbHdaWE11Y0c1bkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSU9hVzFoWjJVdmNHNW5CanNHVkRvUmMyVnlkbWxqWlY5dVlXMWxPZ3B0WldScFlRPT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYyM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--84b254beeaa2411e5704dd83407a07c8d8dc2797/Dioscorea%20elephantipes.png" for localhost at 2022-08-23 10:06:00 -0400
Processing by ActiveStorage::Blobs::RedirectController#show as PNG
Parameters: {"signed_id"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxqWlRRellUUTJZaTB6WWpreExUUXdOMkV0T0dRMU9DMWlZemszTjJRNFpqRTBaVGtHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6ImJsb2JfaWQifX0=--f8d183c94d1d3851a5b4dbc92e3e44ea47c66d2d", "filename"=>"Thaumatophyllum bipinnatifidum"}
ActiveStorage::Blob Load (0.6ms) SELECT "active_storage_blobs".* FROM "active_storage_blobs" WHERE "active_storage_blobs"."id" = $1 LIMIT $2 [["id", "ce43a46b-3b91-407a-8d58-bc977d8f14e9"], ["LIMIT", 1]]
Disk Storage (0.4ms) Generated URL for file at key: m6fa3kbkvwvpy017x1s1eun9g95v (http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiVFptWVROclltdDJkM1p3ZVRBeE4zZ3hjekZsZFc0NVp6azFkZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxSb1lYVnRZWFJ2Y0doNWJHeDFiU0JpYVhCcGJtNWhkR2xtYVdSMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFSb1lYVnRZWFJ2Y0doNWJHeDFiU1V5TUdKcGNHbHVibUYwYVdacFpIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNjQ5WiIsInB1ciI6ImJsb2Jfa2V5In19--31ea0854ee9e5eb2b85455486c5bce6ce4a0b095/Thaumatophyllum%20bipinnatifidum.png)
Redirected to http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiVFptWVROclltdDJkM1p3ZVRBeE4zZ3hjekZsZFc0NVp6azFkZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxSb1lYVnRZWFJ2Y0doNWJHeDFiU0JpYVhCcGJtNWhkR2xtYVdSMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFSb1lYVnRZWFJ2Y0doNWJHeDFiU1V5TUdKcGNHbHVibUYwYVdacFpIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNjQ5WiIsInB1ciI6ImJsb2Jfa2V5In19--31ea0854ee9e5eb2b85455486c5bce6ce4a0b095/Thaumatophyllum%20bipinnatifidum.png
Completed 302 Found in 4ms (ActiveRecord: 0.6ms | Allocations: 1313)
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhabkp0ZUhodU5XVTViM0JyY21OME1UaHpkWGgyTVhWMGVqVjJiQVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpV1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtobGRtVmhJR0p5WVhOcGJHbGxibk5wY3k1d2JtY2lPeUJtYVd4bGJtRnRaU285VlZSR0xUZ25KMGhsZG1WaEpUSXdZbkpoYzJsc2FXVnVjMmx6TG5CdVp3WTdCbFE2RVdOdmJuUmxiblJmZEhsd1pVa2lEbWx0WVdkbEwzQnVad1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9LYldWa2FXRT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYzOVoiLCJwdXIiOiJibG9iX2tleSJ9fQ==--1987211a5046bb567ad47cf466a0b4887380b1c8/Hevea%20brasiliensis.png" for localhost at 2022-08-23 10:06:00 -0400
Started GET "/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiVFptWVROclltdDJkM1p3ZVRBeE4zZ3hjekZsZFc0NVp6azFkZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxSb1lYVnRZWFJ2Y0doNWJHeDFiU0JpYVhCcGJtNWhkR2xtYVdSMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFSb1lYVnRZWFJ2Y0doNWJHeDFiU1V5TUdKcGNHbHVibUYwYVdacFpIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNjQ5WiIsInB1ciI6ImJsb2Jfa2V5In19--31ea0854ee9e5eb2b85455486c5bce6ce4a0b095/Thaumatophyllum%20bipinnatifidum.png" for localhost at 2022-08-23 10:06:00 -0400
Processing by ActiveStorage::DiskController#show as PNG
Parameters: {"encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhMk4wY21GdFlqZ3plV3B0ZUdVM00zazJlVFIwYURKemJuZHZPUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxOd1lYUm9hWEJvZVd4c2RXMGdZMjlqYUd4bFlYSnBjM0JoZEdoMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFOd1lYUm9hWEJvZVd4c2RXMGxNakJqYjJOb2JHVmhjbWx6Y0dGMGFIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNTg5WiIsInB1ciI6ImJsb2Jfa2V5In19--6f956c4338844d0b05141a50b9fcd54ab365bd8a", "filename"=>"Spathiphyllum cochlearispathum"}
Completed 200 OK in 2ms (ActiveRecord: 0.0ms | Allocations: 192)
Processing by ActiveStorage::DiskController#show as PNG
Parameters: {"encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkMlZ4WW5aamFtaDZOelpqZDNCaGRYTnVlbVZ2TURKeVkyRmxOd1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWVdsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtScGIzTmpiM0psWVNCbGJHVndhR0Z1ZEdsd1pYTXVjRzVuSWpzZ1ptbHNaVzVoYldVcVBWVlVSaTA0SnlkRWFXOXpZMjl5WldFbE1qQmxiR1Z3YUdGdWRHbHdaWE11Y0c1bkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSU9hVzFoWjJVdmNHNW5CanNHVkRvUmMyVnlkbWxqWlY5dVlXMWxPZ3B0WldScFlRPT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYyM1oiLCJwdXIiOiJibG9iX2tleSJ9fQ==--84b254beeaa2411e5704dd83407a07c8d8dc2797", "filename"=>"Dioscorea elephantipes"}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms | Allocations: 190)
Processing by ActiveStorage::DiskController#show as PNG
Parameters: {"encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiVFptWVROclltdDJkM1p3ZVRBeE4zZ3hjekZsZFc0NVp6azFkZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpY1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWxSb1lYVnRZWFJ2Y0doNWJHeDFiU0JpYVhCcGJtNWhkR2xtYVdSMWJTNXdibWNpT3lCbWFXeGxibUZ0WlNvOVZWUkdMVGduSjFSb1lYVnRZWFJ2Y0doNWJHeDFiU1V5TUdKcGNHbHVibUYwYVdacFpIVnRMbkJ1WndZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraURtbHRZV2RsTDNCdVp3WTdCbFE2RVhObGNuWnBZMlZmYm1GdFpUb0tiV1ZrYVdFPSIsImV4cCI6IjIwMjItMDgtMjNUMTQ6MTE6MDAuNjQ5WiIsInB1ciI6ImJsb2Jfa2V5In19--31ea0854ee9e5eb2b85455486c5bce6ce4a0b095", "filename"=>"Thaumatophyllum bipinnatifidum"}
Completed 200 OK in 2ms (ActiveRecord: 0.0ms | Allocations: 182)
Processing by ActiveStorage::DiskController#show as PNG
Parameters: {"encoded_key"=>"eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhabkp0ZUhodU5XVTViM0JyY21OME1UaHpkWGgyTVhWMGVqVjJiQVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpV1dsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SWtobGRtVmhJR0p5WVhOcGJHbGxibk5wY3k1d2JtY2lPeUJtYVd4bGJtRnRaU285VlZSR0xUZ25KMGhsZG1WaEpUSXdZbkpoYzJsc2FXVnVjMmx6TG5CdVp3WTdCbFE2RVdOdmJuUmxiblJmZEhsd1pVa2lEbWx0WVdkbEwzQnVad1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9LYldWa2FXRT0iLCJleHAiOiIyMDIyLTA4LTIzVDE0OjExOjAwLjYzOVoiLCJwdXIiOiJibG9iX2tleSJ9fQ==--1987211a5046bb567ad47cf466a0b4887380b1c8", "filename"=>"Hevea brasiliensis"}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms | Allocations: 182)
I'm currently trying to find a way to change my redirection url upon unlocking an account. Currently when an account is locked the user is getting a email to unlock is account but then the te user get redirect on a default url. Since my rails project is an api it would be nice to redirect to my front-end
Started GET "/api/auth/unlock?unlock_token=YvR4nNssxhB9h8hvDAse" for
127.0.0.1 at 2017-12-04 15:28:08 -0500
Processing by Devise::UnlocksController#show as JSON
Parameters: {"unlock_token"=>"YvR4nNssxhB9h8hvDAse"}
User Load (0.8ms) SELECT "users".* FROM "users" WHERE
"users"."unlock_token" = $1 ORDER BY "users"."id" ASC LIMIT $2
[["unlock_token",
"6f3c4d7aa5254e143f89cd7f187e22ce56b11e6abe1f5eb252e34d86ac101908"],
["LIMIT", 1]]
(0.1ms) BEGIN
SQL (0.7ms) UPDATE "users" SET "locked_at" = $1, "failed_attempts" = $2,
"unlock_token" = $3, "updated_at" = $4 WHERE "users"."id" = $5
[["locked_at", nil], ["failed_attempts", 0], ["unlock_token", nil],
["updated_at", "2017-12-04 20:28:08.783744"], ["id", 1]]
(3.4ms) COMMIT
Redirected to http://localhost:3000/api/auth/sign_in
Completed 302 Found in 17ms (ActiveRecord: 5.0ms)
Started GET "/api/auth/sign_in" for 127.0.0.1 at 2017-12-04 15:28:08
-0500
Processing by DeviseTokenAuth::SessionsController#new as JSON
[active_model_serializers] Rendered ActiveModel::Serializer::Null with
Hash (0.14ms)
Completed 405 Method Not Allowed in 2ms (Views: 0.9ms | ActiveRecord:
0.0ms)
Started GET "/api/auth/sign_in" for 127.0.0.1 at 2017-12-04 15:31:26
-0500
Processing by DeviseTokenAuth::SessionsController#new as JSON
[active_model_serializers] Rendered ActiveModel::Serializer::Null with
Hash (0.11ms)
Completed 405 Method Not Allowed in 1ms (Views: 0.7ms | ActiveRecord:
0.0ms)
To do any customization with Devise, one must override the default controllers by creating a new controller and inheriting from it in your case that would be Devise::UnlocksController
For example:
CustomUnlocksController < Devise::UnlocksController
https://github.com/plataformatec/devise/blob/master/app/controllers/devise/unlocks_controller.rb
Override after_unlock_path_for to the path which you are going to redirect after.
Hi everyone I had a website working on localhost:3000 and after deploying it to heroku it wont log in either through email, facebook or google.
It says...
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
This is the log, as far as I am aware.
2016-07-27T14:19:43.719220+00:00 app[web.1]: Started GET "/auth/facebook" for 178.167.254.130 at 2016-07-27 14:19:43 +0000
2016-07-27T14:19:44.385948+00:00 app[web.1]: User Load (2.0ms) SELECT "users".* FROM "users" WHERE "users"."email" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["email", "barryjamesreeves#gmail.com"]]
2016-07-27T14:19:44.376866+00:00 app[web.1]: Parameters: {"code"=>"AQAimEd3zlA9aomiPb115KoKJ9ntclITq7BNYfEz8VezLOAIBry-mSaGF2zbFL0hkz2g7l_YS7fdK89AuFQ7CeQoF7O42hEk8jEcvAfeJl9UeeQu-QiAF5RO8y1YcMhfj4HEOrXjVXuXT_vY0GSQQ15ZUAVaByR6H8aPwtRcDZnyS2orAi36gew0gP1aG3qGsxGlIIDt6o_LShm--zog3twAbFe4vHLXSJtdWxdG_G4pMCBv5oqzq84mS7avF0qDlXOGS5HfGcyODFlbh8t1rqjMXJNCUVBm-7J0WLMvncTQTawuhRQAvJAWJRr7WDCEYXu4SUsvOAxvzQ5KrfECE4Ji", "state"=>"84f33935f2d2f759cbf1b9bb5025bfdbfba95bb82f9972a1"}
2016-07-27T14:19:44.483905+00:00 app[web.1]: User Exists (1.8ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'barryjamesreeves#gmail.com' LIMIT 1
2016-07-27T14:19:44.390107+00:00 app[web.1]: User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."provider" = $1 AND "users"."uid" = $2 ORDER BY "users"."id" ASC LIMIT 1 [["provider", "facebook"], ["uid", "638781552953110"]]
2016-07-27T14:19:44.376844+00:00 app[web.1]: Processing by OmniauthCallbacksController#facebook as HTML
2016-07-27T14:19:44.250584+00:00 app[web.1]: Started GET "/auth/facebook/callback?code=AQAimEd3zlA9aomiPb115KoKJ9ntclITq7BNYfEz8VezLOAIBry-mSaGF2zbFL0hkz2g7l_YS7fdK89AuFQ7CeQoF7O42hEk8jEcvAfeJl9UeeQu-QiAF5RO8y1YcMhfj4HEOrXjVXuXT_vY0GSQQ15ZUAVaByR6H8aPwtRcDZnyS2orAi36gew0gP1aG3qGsxGlIIDt6o_LShm--zog3twAbFe4vHLXSJtdWxdG_G4pMCBv5oqzq84mS7avF0qDlXOGS5HfGcyODFlbh8t1rqjMXJNCUVBm-7J0WLMvncTQTawuhRQAvJAWJRr7WDCEYXu4SUsvOAxvzQ5KrfECE4Ji&state=84f33935f2d2f759cbf1b9bb5025bfdbfba95bb82f9972a1" for 178.167.254.130 at 2016-07-27 14:19:44 +0000
2016-07-27T14:19:44.480409+00:00 app[web.1]: (1.6ms) BEGIN
2016-07-27T14:19:44.252793+00:00 app[web.1]: I, [2016-07-27T14:19:44.252730 #3] INFO -- omniauth: (facebook) Callback phase initiated.
2016-07-27T14:19:44.688539+00:00 app[web.1]: User Load (1.7ms) SELECT "users".* FROM "users" WHERE "users"."provider" = $1 AND "users"."uid" = $2 AND "users"."confirmation_token" = $3 ORDER BY "users"."id" ASC LIMIT 1 [["provider", "facebook"], ["uid", "638781552953110"], ["confirmation_token", "7e801f409f1a87a3e65cb42cc124e971ec3e7f7caf4f441795985c6d9110969a"]]
2016-07-27T14:19:44.693755+00:00 app[web.1]: SQL (1.7ms) INSERT INTO "users" ("provider", "uid", "fullname", "email", "image", "encrypted_password", "created_at", "updated_at", "confirmation_token", "confirmation_sent_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" [["provider", "facebook"], ["uid", "638781552953110"], ["fullname", "Barry Reeves"], ["email", "barryjamesreeves#gmail.com"], ["image", "http://graph.facebook.com/638781552953110/picture"], ["encrypted_password", "$2a$10$LnDgeb0oc.2oczdFwYeizeX2tuQDoC8aF.jJ02ddBSM8wxlhxzaZy"], ["created_at", "2016-07-27 14:19:44.484330"], ["updated_at", "2016-07-27 14:19:44.484330"], ["confirmation_token", "SzgGE4Z67As_h-fdmXgR"], ["confirmation_sent_at", "2016-07-27 14:19:44.688985"]]
2016-07-27T14:19:44.734814+00:00 app[web.1]: Rendered devise/mailer/confirmation_instructions.html.erb (1.9ms)
2016-07-27T14:19:44.734891+00:00 app[web.1]:
2016-07-27T14:19:44.734893+00:00 app[web.1]: Devise::Mailer#confirmation_instructions: processed outbound mail in 38.3ms
2016-07-27T14:19:44.736688+00:00 app[web.1]: (1.6ms) ROLLBACK
2016-07-27T14:19:44.738075+00:00 app[web.1]: Completed 500 Internal Server Error in 361ms (ActiveRecord: 13.8ms)
2016-07-27T14:19:44.740664+00:00 app[web.1]:
2016-07-27T14:19:44.740666+00:00 app[web.1]: ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):
2016-07-27T14:19:44.740667+00:00 app[web.1]: 2:
2016-07-27T14:19:44.740667+00:00 app[web.1]: 3: You can confirm your account email through the link below:
2016-07-27T14:19:44.740668+00:00 app[web.1]: 4:
2016-07-27T14:19:44.740669+00:00 app[web.1]: 5: <%= link_to 'Confirm my account', confirmation_url(#resource, confirmation_token: #token) %>
2016-07-27T14:19:44.740670+00:00 app[web.1]: app/views/devise/mailer/confirmation_instructions.html.erb:5:in _app_views_devise_mailer_confirmation_instructions_html_erb__4041444012376916285_69837330575780'
2016-07-27T14:19:44.740671+00:00 app[web.1]: app/models/user.rb:20:infrom_omniauth'
2016-07-27T14:19:44.740671+00:00 app[web.1]: app/controllers/omniauth_callbacks_controller.rb:4:in `facebook'
2016-07-27T14:19:44.740672+00:00 app[web.1]:
2016-07-27T14:19:44.740673+00:00 app[web.1]:
2016-07-27T14:19:37.167494+00:00 heroku[router]: at=info method=GET path="/" host=gentle-escarpment-62627.herokuapp.com request_id=02fbf786-95af-4421-ae32-ae221c0ea302 fwd="178.167.254.130" dyno=web.1 connect=0ms service=88ms status=200 bytes=5829
Any help appreciated
thanks
I've been racking my brain for ~ 8 hours now. I'm setting up a devise client to work with a custom provider built on doorkeeper.
Everything is working fine except the authorization of the devise client. For some reason anytime I click the user_omniauth_authorize_path(:doorkeeper) the omniauth Request phase initiated is triggered twice. I can't work out what could be causing this.
Here is a log of the sequence of events from both the client and provider.
CLIENT LOGS
jonathan#Jonathan doorkeeper-client (master) $ rails s -p 3001
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://localhost:3001
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-10-24 23:37:27] INFO WEBrick 1.3.1
[2015-10-24 23:37:27] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin15]
[2015-10-24 23:37:27] INFO WEBrick::HTTPServer#start: pid=59452 port=3001
Started GET "/" for ::1 at 2015-10-24 23:37:33 -0500
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by ApplicationController#index as HTML
Rendered application/index.html.erb within layouts/application (1.9ms)
Completed 200 OK in 157ms (Views: 143.7ms | ActiveRecord: 0.0ms)
Started GET "/users/auth/doorkeeper" for ::1 at 2015-10-24 23:37:40 -0500
I, [2015-10-24T23:37:40.521903 #59452] INFO -- omniauth: (doorkeeper) Request phase initiated.
Started GET "/users/auth/doorkeeper" for ::1 at 2015-10-24 23:37:40 -0500
I, [2015-10-24T23:37:40.615061 #59452] INFO -- omniauth: (doorkeeper) Request phase initiated.
Started GET "/users/auth/doorkeeper/callback?code=e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee&state=d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9" for ::1 at 2015-10-24 23:38:37 -0500
I, [2015-10-24T23:38:37.618820 #59452] INFO -- omniauth: (doorkeeper) Callback phase initiated.
E, [2015-10-24T23:38:37.640490 #59452] ERROR -- omniauth: (doorkeeper) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
{"error":"invalid_grant","error_description":"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."}
Processing by Users::OmniauthCallbacksController#failure as HTML
Parameters: {"code"=>"e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee", "state"=>"d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9"}
Redirected to http://localhost:3001/
Completed 302 Found in 332ms (ActiveRecord: 0.0ms)
Started GET "/" for ::1 at 2015-10-24 23:38:37 -0500
Processing by ApplicationController#index as HTML
Rendered application/index.html.erb within layouts/application (0.3ms)
Completed 200 OK in 21ms (Views: 20.3ms | ActiveRecord: 0.0ms)
PROVIDER LOGS
jonathan#Jonathan doorkeeper-provider (master) $ rails s
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-10-24 23:37:24] INFO WEBrick 1.3.1
[2015-10-24 23:37:24] INFO ruby 2.2.3 (2015-08-18) [x86_64-darwin15]
[2015-10-24 23:37:24] INFO WEBrick::HTTPServer#start: pid=59448 port=3000
Started GET "/oauth/authorize?client_id=867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Fusers%2Fauth%2Fdoorkeeper%2Fcallback&response_type=code&scope=user&state=61dbe5751135b43d5465f979e4dd1bcbbe9dc6935c65e595" for ::1 at 2015-10-24 23:37:40 -0500
ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Doorkeeper::AuthorizationsController#new as HTML
Parameters: {"client_id"=>"867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed", "redirect_uri"=>"http://localhost:3001/users/auth/doorkeeper/callback", "response_type"=>"code", "scope"=>"user", "state"=>"61dbe5751135b43d5465f979e4dd1bcbbe9dc6935c65e595"}
Redirected to http://localhost:3000/users/sign_in
Filter chain halted as :authenticate_resource_owner! rendered or redirected
Completed 302 Found in 11ms (ActiveRecord: 0.0ms)
Started GET "/oauth/authorize?client_id=867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Fusers%2Fauth%2Fdoorkeeper%2Fcallback&response_type=code&scope=user&state=d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9" for ::1 at 2015-10-24 23:37:40 -0500
Processing by Doorkeeper::AuthorizationsController#new as HTML
Parameters: {"client_id"=>"867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed", "redirect_uri"=>"http://localhost:3001/users/auth/doorkeeper/callback", "response_type"=>"code", "scope"=>"user", "state"=>"d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9"}
User Load (0.9ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Doorkeeper::Application Load (0.9ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT 1 [["uid", "867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed"]]
Doorkeeper::AccessToken Load (0.7ms) SELECT "oauth_access_tokens".* FROM "oauth_access_tokens" WHERE "oauth_access_tokens"."application_id" = $1 AND "oauth_access_tokens"."resource_owner_id" = $2 AND "oauth_access_tokens"."revoked_at" IS NULL ORDER BY created_at desc LIMIT 1 [["application_id", 1], ["resource_owner_id", 1]]
Rendered /Users/jonathan/.rvm/gems/ruby-2.2.3/gems/doorkeeper-3.0.1/app/views/doorkeeper/authorizations/new.html.erb within layouts/doorkeeper/application (10.2ms)
Completed 200 OK in 168ms (Views: 129.9ms | ActiveRecord: 10.5ms)
Started POST "/oauth/authorize" for ::1 at 2015-10-24 23:38:37 -0500
Processing by Doorkeeper::AuthorizationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "client_id"=>"867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed", "redirect_uri"=>"http://localhost:3001/users/auth/doorkeeper/callback", "state"=>"d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9", "response_type"=>"code", "scope"=>"user", "commit"=>"Authorize"}
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]]
Doorkeeper::Application Load (0.3ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 LIMIT 1 [["uid", "867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed"]]
(0.2ms) BEGIN
Doorkeeper::AccessGrant Exists (0.7ms) SELECT 1 AS one FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = 'e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee' LIMIT 1
SQL (0.5ms) INSERT INTO "oauth_access_grants" ("application_id", "resource_owner_id", "expires_in", "redirect_uri", "scopes", "token", "created_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["application_id", 1], ["resource_owner_id", 1], ["expires_in", 1200], ["redirect_uri", "http://localhost:3001/users/auth/doorkeeper/callback"], ["scopes", "user"], ["token", "e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee"], ["created_at", "2015-10-25 04:38:37.602105"]]
(0.4ms) COMMIT
Redirected to http://localhost:3001/users/auth/doorkeeper/callback?code=e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee&state=d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9
Completed 302 Found in 24ms (ActiveRecord: 4.2ms)
Started POST "/oauth/token" for ::1 at 2015-10-24 23:38:37 -0500
Processing by Doorkeeper::TokensController#create as */*
Parameters: {"client_id"=>"867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed", "client_secret"=>"[FILTERED]", "code"=>"[FILTERED]", "grant_type"=>"authorization_code", "redirect_uri"=>"http://localhost:3001/users/auth/doorkeeper/callback?code=e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee&state=d5166e94b40231ac06d65ae52f5a9b97a6aee828505f02b9"}
Doorkeeper::AccessGrant Load (0.4ms) SELECT "oauth_access_grants".* FROM "oauth_access_grants" WHERE "oauth_access_grants"."token" = $1 LIMIT 1 [["token", "e1aa1b123ecadb91088527dfa3529181a99fa1f607a88738badd51b24aa2e8ee"]]
Doorkeeper::Application Load (0.3ms) SELECT "oauth_applications".* FROM "oauth_applications" WHERE "oauth_applications"."uid" = $1 AND "oauth_applications"."secret" = $2 LIMIT 1 [["uid", "867e46cc052aafc5c580d328daa475d7024328df71eedfe3d640e197f651f0ed"], ["secret", "857c7e1f887d52064703ef19852032729e321643ab4638d302ab33eb0afe1a57"]]
Completed 401 Unauthorized in 4ms
So the duplicate request issue ended up just being javascript, likely turbolinks for some reason firing the request twice.
Thanks max
I have a nice little rails angular app that is working great locally, but now that I am trying to deploy to heroku, I'm having some problems. Namely, when I try making a POST request (through ajax), I get back and internal server error as a response({"status":"500","error":"Internal Server Error"}). It's really driving me crazy, it seems that it's preventing the info I want to get into my database from getting there, I've tried doing the suggestions on some of the other SO threads and nothing seems to work. Doubly confusing because it works perfectly on the local host. The heroku logs for the event are here:
2014-09-23T04:30:37.497826+00:00 app[web.1]: => Booting WEBrick
2014-09-23T04:30:37.497831+00:00 app[web.1]: => Rails 4.1.4 application starting in production on http://0.0.0.0:9878
2014-09-23T04:30:37.497833+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-09-23T04:30:37.497835+00:00 app[web.1]: => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
2014-09-23T04:30:37.497836+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-09-23T04:30:37.497838+00:00 app[web.1]: I, [2014-09-23T04:27:51.885672 #2] INFO -- : Started GET "/" for 184.73.44.87 at 2014-09-23 04:27:51 +0000
2014-09-23T04:30:37.497840+00:00 app[web.1]: I, [2014-09-23T04:27:51.988811 #2] INFO -- : Processing by PagesController#index as */*
2014-09-23T04:30:37.497841+00:00 app[web.1]: I, [2014-09-23T04:27:52.039041 #2] INFO -- : Redirected to http://hidden-lowlands-5596.herokuapp.com/users/sign_in
2014-09-23T04:30:37.497843+00:00 app[web.1]: I, [2014-09-23T04:27:52.039888 #2] INFO -- : Completed 302 Found in 51ms (ActiveRecord: 0.0ms)
2014-09-23T04:30:37.497845+00:00 app[web.1]: I, [2014-09-23T04:27:52.072805 #2] INFO -- : Started GET "/users/sign_in" for 184.73.44.87 at 2014-09-23 04:27:52 +0000
2014-09-23T04:30:37.497846+00:00 app[web.1]: I, [2014-09-23T04:27:52.077594 #2] INFO -- : Processing by Devise::SessionsController#new as */*
2014-09-23T04:30:37.497848+00:00 app[web.1]: I, [2014-09-23T04:27:52.128662 #2] INFO -- : Rendered devise/sessions/new.html.erb within layouts/application (14.9ms)
2014-09-23T04:30:37.497849+00:00 app[web.1]: I, [2014-09-23T04:27:52.180470 #2] INFO -- : Completed 200 OK in 103ms (Views: 70.2ms | ActiveRecord: 13.0ms)
2014-09-23T04:30:37.497851+00:00 app[web.1]: I, [2014-09-23T04:29:23.691686 #2] INFO -- : Started GET "/" for 24.6.253.209 at 2014-09-23 04:29:23 +0000
2014-09-23T04:30:37.497852+00:00 app[web.1]: I, [2014-09-23T04:29:23.695622 #2] INFO -- : Processing by PagesController#index as HTML
2014-09-23T04:30:37.497854+00:00 app[web.1]: D, [2014-09-23T04:29:23.701573 #2] DEBUG -- : User Load (2.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:37.497855+00:00 app[web.1]: I, [2014-09-23T04:29:23.706305 #2] INFO -- : Rendered pages/index.html within layouts/application (1.3ms)
2014-09-23T04:30:37.497857+00:00 app[web.1]: I, [2014-09-23T04:29:23.707351 #2] INFO -- : Completed 200 OK in 12ms (Views: 5.0ms | ActiveRecord: 2.4ms)
2014-09-23T04:30:37.497858+00:00 app[web.1]: I, [2014-09-23T04:29:25.125810 #2] INFO -- : Started GET "/articles" for 24.6.253.209 at 2014-09-23 04:29:25 +0000
2014-09-23T04:30:37.497860+00:00 app[web.1]: I, [2014-09-23T04:29:25.130961 #2] INFO -- : Processing by ArticlesController#index as JSON
2014-09-23T04:30:37.497863+00:00 app[web.1]: D, [2014-09-23T04:29:25.133835 #2] DEBUG -- : User Load (1.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:37.497864+00:00 app[web.1]: D, [2014-09-23T04:29:25.159063 #2] DEBUG -- : Feed Load (1.8ms) SELECT "feeds".* FROM "feeds" INNER JOIN "subscriptions" ON "feeds"."id" = "subscriptions"."feed_id" WHERE "subscriptions"."user_id" = $1 [["user_id", 1]]
2014-09-23T04:30:37.523076+00:00 heroku[router]: at=info method=GET path="/feeds" host=hidden-lowlands-5596.herokuapp.com request_id=f4e81159-eb5a-4115-9f35-3f666527d781 fwd="24.6.253.209" dyno=web.1 connect=1ms service=35ms status=304 bytes=1028
2014-09-23T04:30:37.497865+00:00 app[web.1]: D, [2014-09-23T04:29:25.179293 #2] DEBUG -- : Article Load (1.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 10]]
2014-09-23T04:30:37.497867+00:00 app[web.1]: D, [2014-09-23T04:29:25.184538 #2] DEBUG -- : Article Load (4.7ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 11]]
2014-09-23T04:30:37.497869+00:00 app[web.1]: D, [2014-09-23T04:29:25.186052 #2] DEBUG -- : Article Load (1.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 12]]
2014-09-23T04:30:37.497878+00:00 app[web.1]: D, [2014-09-23T04:29:25.187533 #2] DEBUG -- : Article Load (1.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 13]]
2014-09-23T04:30:37.497879+00:00 app[web.1]: D, [2014-09-23T04:29:25.188925 #2] DEBUG -- : Article Load (1.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 14]]
2014-09-23T04:30:37.497881+00:00 app[web.1]: D, [2014-09-23T04:29:25.190294 #2] DEBUG -- : Article Load (1.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 15]]
2014-09-23T04:30:37.497882+00:00 app[web.1]: D, [2014-09-23T04:29:25.192010 #2] DEBUG -- : Article Load (1.3ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 16]]
2014-09-23T04:30:37.497884+00:00 app[web.1]: D, [2014-09-23T04:29:25.193307 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 17]]
2014-09-23T04:30:37.497885+00:00 app[web.1]: D, [2014-09-23T04:29:25.194673 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 18]]
2014-09-23T04:30:37.497891+00:00 app[web.1]: D, [2014-09-23T04:29:25.196031 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 19]]
2014-09-23T04:30:37.497892+00:00 app[web.1]: D, [2014-09-23T04:29:25.199035 #2] DEBUG -- : Article Load (2.5ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 20]]
2014-09-23T04:30:37.497894+00:00 app[web.1]: I, [2014-09-23T04:29:25.199882 #2] INFO -- : Completed 200 OK in 69ms (Views: 0.3ms | ActiveRecord: 28.5ms)
2014-09-23T04:30:37.497895+00:00 app[web.1]: I, [2014-09-23T04:30:09.983278 #2] INFO -- : Started GET "/" for 24.6.253.209 at 2014-09-23 04:30:09 +0000
2014-09-23T04:30:37.497897+00:00 app[web.1]: I, [2014-09-23T04:30:09.987649 #2] INFO -- : Processing by PagesController#index as HTML
2014-09-23T04:30:37.497898+00:00 app[web.1]: D, [2014-09-23T04:30:09.990690 #2] DEBUG -- : User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:37.497900+00:00 app[web.1]: I, [2014-09-23T04:30:09.993971 #2] INFO -- : Rendered pages/index.html within layouts/application (0.5ms)
2014-09-23T04:30:37.497901+00:00 app[web.1]: I, [2014-09-23T04:30:09.994855 #2] INFO -- : Completed 200 OK in 7ms (Views: 3.5ms | ActiveRecord: 1.3ms)
2014-09-23T04:30:37.497902+00:00 app[web.1]: I, [2014-09-23T04:30:10.918573 #2] INFO -- : Started GET "/articles" for 24.6.253.209 at 2014-09-23 04:30:10 +0000
2014-09-23T04:30:37.497904+00:00 app[web.1]: I, [2014-09-23T04:30:10.922422 #2] INFO -- : Processing by ArticlesController#index as JSON
2014-09-23T04:30:37.497905+00:00 app[web.1]: D, [2014-09-23T04:30:10.925552 #2] DEBUG -- : User Load (1.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:37.497907+00:00 app[web.1]: D, [2014-09-23T04:30:10.929624 #2] DEBUG -- : Feed Load (1.5ms) SELECT "feeds".* FROM "feeds" INNER JOIN "subscriptions" ON "feeds"."id" = "subscriptions"."feed_id" WHERE "subscriptions"."user_id" = $1 [["user_id", 1]]
2014-09-23T04:30:37.497909+00:00 app[web.1]: D, [2014-09-23T04:30:10.936177 #2] DEBUG -- : Article Load (1.0ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 10]]
2014-09-23T04:30:37.497910+00:00 app[web.1]: D, [2014-09-23T04:30:10.937606 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 11]]
2014-09-23T04:30:37.497912+00:00 app[web.1]: D, [2014-09-23T04:30:10.939658 #2] DEBUG -- : Article Load (1.5ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 12]]
2014-09-23T04:30:37.497913+00:00 app[web.1]: D, [2014-09-23T04:30:10.941542 #2] DEBUG -- : Article Load (1.5ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 13]]
2014-09-23T04:30:37.497932+00:00 app[web.1]: D, [2014-09-23T04:30:10.943625 #2] DEBUG -- : Article Load (1.6ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 14]]
2014-09-23T04:30:37.497933+00:00 app[web.1]: D, [2014-09-23T04:30:10.944958 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 15]]
2014-09-23T04:30:37.497935+00:00 app[web.1]: D, [2014-09-23T04:30:10.946202 #2] DEBUG -- : Article Load (0.8ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 16]]
2014-09-23T04:30:37.497936+00:00 app[web.1]: D, [2014-09-23T04:30:10.947584 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 17]]
2014-09-23T04:30:37.497938+00:00 app[web.1]: D, [2014-09-23T04:30:10.949194 #2] DEBUG -- : Article Load (1.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 18]]
2014-09-23T04:30:37.497940+00:00 app[web.1]: D, [2014-09-23T04:30:10.950493 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 19]]
2014-09-23T04:30:37.497941+00:00 app[web.1]: D, [2014-09-23T04:30:10.951773 #2] DEBUG -- : Article Load (0.9ms) SELECT "articles".* FROM "articles" WHERE "articles"."feed_id" = $1 [["feed_id", 20]]
2014-09-23T04:30:37.497943+00:00 app[web.1]: I, [2014-09-23T04:30:10.952334 #2] INFO -- : Completed 200 OK in 30ms (Views: 0.2ms | ActiveRecord: 15.1ms)
2014-09-23T04:30:37.497944+00:00 app[web.1]: I, [2014-09-23T04:30:31.985603 #2] INFO -- : Started POST "/feeds/search" for 24.6.253.209 at 2014-09-23 04:30:31 +0000
2014-09-23T04:30:37.497946+00:00 app[web.1]: I, [2014-09-23T04:30:31.993881 #2] INFO -- : Processing by FeedsController#search as JSON
2014-09-23T04:30:37.497947+00:00 app[web.1]: I, [2014-09-23T04:30:31.993977 #2] INFO -- : Parameters: {"url"=>"q", "feed"=>{"url"=>"q"}}
2014-09-23T04:30:37.497952+00:00 app[web.1]: I, [2014-09-23T04:30:32.186407 #2] INFO -- : Completed 200 OK in 192ms (Views: 0.5ms | ActiveRecord: 0.0ms)
2014-09-23T04:30:37.497954+00:00 app[web.1]: I, [2014-09-23T04:30:37.487812 #2] INFO -- : Started GET "/feeds" for 24.6.253.209 at 2014-09-23 04:30:37 +0000
2014-09-23T04:30:37.497955+00:00 app[web.1]: I, [2014-09-23T04:30:37.497710 #2] INFO -- : Processing by FeedsController#index as JSON
2014-09-23T04:30:38.601702+00:00 app[web.1]: D, [2014-09-23T04:30:37.508654 #2] DEBUG -- : User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:38.601707+00:00 app[web.1]: D, [2014-09-23T04:30:37.512314 #2] DEBUG -- : Feed Load (1.5ms) SELECT "feeds".* FROM "feeds" INNER JOIN "subscriptions" ON "feeds"."id" = "subscriptions"."feed_id" WHERE "subscriptions"."user_id" = $1 [["user_id", 1]]
2014-09-23T04:30:38.601709+00:00 app[web.1]: I, [2014-09-23T04:30:37.517631 #2] INFO -- : Completed 200 OK in 20ms (Views: 6.1ms | ActiveRecord: 2.9ms)
2014-09-23T04:30:38.601711+00:00 app[web.1]: I, [2014-09-23T04:30:37.779048 #2] INFO -- : Started POST "/feeds/create" for 24.6.253.209 at 2014-09-23 04:30:37 +0000
2014-09-23T04:30:38.601713+00:00 app[web.1]: I, [2014-09-23T04:30:37.802768 #2] INFO -- : Processing by FeedsController#create as JSON
2014-09-23T04:30:38.601715+00:00 app[web.1]: I, [2014-09-23T04:30:37.802879 #2] INFO -- : Parameters: {"url"=>"feed/http://www.questionablecontent.net/QCRSS.xml", "feed"=>{"url"=>"feed/http://www.questionablecontent.net/QCRSS.xml"}}
2014-09-23T04:30:38.601717+00:00 app[web.1]: D, [2014-09-23T04:30:37.977191 #2] DEBUG -- : Feed Load (8.1ms) SELECT "feeds".* FROM "feeds" WHERE "feeds"."feedly_feed_id" IS NULL LIMIT 1
2014-09-23T04:30:38.601719+00:00 app[web.1]: D, [2014-09-23T04:30:37.981727 #2] DEBUG -- : (2.8ms) BEGIN
2014-09-23T04:30:38.601721+00:00 app[web.1]: D, [2014-09-23T04:30:37.994355 #2] DEBUG -- : Feed Exists (9.1ms) SELECT 1 AS one FROM "feeds" WHERE "feeds"."feedly_feed_id" = 'feed/http://www.questionablecontent.net/QCRSS.xml' LIMIT 1
2014-09-23T04:30:38.601723+00:00 app[web.1]: D, [2014-09-23T04:30:38.006709 #2] DEBUG -- : SQL (1.7ms) INSERT INTO "feeds" ("created_at", "description", "feedly_feed_id", "name", "num_subscribers", "topics", "updated_at", "url") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["created_at", "2014-09-23 04:30:37.994655"], ["description", "Deathmøle Jacques' head takes up the bottom half of the panel, with his words taking up the top half. He is not concerned about the life of his friend."], ["feedly_feed_id", "feed/http://www.questionablecontent.net/QCRSS.xml"], ["name", "QC RSS"], ["num_subscribers", 50874], ["topics", "comics,webcomics,web comics,fun,humor"], ["updated_at", "2014-09-23 04:30:37.994655"], ["url", "http://www.questionablecontent.net"]]
2014-09-23T04:30:38.601741+00:00 app[web.1]: D, [2014-09-23T04:30:38.011917 #2] DEBUG -- : (4.7ms) COMMIT
2014-09-23T04:30:38.601743+00:00 app[web.1]: D, [2014-09-23T04:30:38.016273 #2] DEBUG -- : User Load (3.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2014-09-23T04:30:38.601744+00:00 app[web.1]: D, [2014-09-23T04:30:38.019696 #2] DEBUG -- : (1.9ms) BEGIN
2014-09-23T04:30:38.601746+00:00 app[web.1]: D, [2014-09-23T04:30:38.083515 #2] DEBUG -- : SQL (2.8ms) INSERT INTO "subscriptions" ("created_at", "feed_id", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["created_at", "2014-09-23 04:30:38.049168"], ["feed_id", 21], ["updated_at", "2014-09-23 04:30:38.049168"], ["user_id", 1]]
2014-09-23T04:30:38.601747+00:00 app[web.1]: D, [2014-09-23T04:30:38.093502 #2] DEBUG -- : (7.6ms) COMMIT
2014-09-23T04:30:38.601749+00:00 app[web.1]: D, [2014-09-23T04:30:38.396551 #2] DEBUG -- : Feed Load (9.5ms) SELECT "feeds".* FROM "feeds" WHERE "feeds"."feedly_feed_id" = 'feed/http://www.questionablecontent.net/QCRSS.xml' LIMIT 1
2014-09-23T04:30:38.601751+00:00 app[web.1]: #<Article id: nil, feed_id: nil, canonical_url: nil, site_url: nil, visual_url: nil, visual_height: nil, visual_width: nil, author: nil, title: nil, keywords: nil, summary: nil, feedly_id: nil, published: nil, fb_share_count: nil, fb_like_count: nil, fb_comment_count: nil, twitter_count: nil, reddit_score: nil, reddit_comment_count: nil, created_at: nil, updated_at: nil, calculated_rank: nil>
2014-09-23T04:30:38.773050+00:00 heroku[router]: at=info method=POST path="/feeds/create" host=hidden-lowlands-5596.herokuapp.com request_id=9c3683ee-dabc-4e34-bfb0-c309dc547596 fwd="24.6.253.209" dyno=web.1 connect=289ms service=1018ms status=500 bytes=330
I'm really stumped on this one, any help would be greatly appreciated. Thanks :)