benwbrum / fromthepage

FromThePage is a wiki-like application for crowdsourcing transcription of handwritten documents.
http://fromthepage.com
GNU Affero General Public License v3.0
170 stars 51 forks source link

500 error from a single browser. #3293

Closed saracarl closed 2 years ago

saracarl commented 2 years ago

User Scribe of Poland is getting a 500 error from a single device whenever she goes to fromthepage.com.

Aug 31 she experienced this at 10:47 PM Eastern and at 5:45 PM.

We should look in the logs.

saracarl commented 2 years ago

Logs show:

At her earliest timestamp:

I, [2022-08-31T21:47:06.335535 #13265]  INFO -- : Started GET "/adah/governor-a-b-moore-administrative-files-and-correspondence-1857-18
59/rsg00248-f02-q0000133230-q0000133233/display/32237362" for 5.133.192.200 at 2022-08-31 21:47:06 +0000
I, [2022-08-31T21:47:06.337942 #13265]  INFO -- : Processing by DisplayController#display_page as HTML
I, [2022-08-31T21:47:06.338298 #13265]  INFO -- :   Parameters: {"user_slug"=>"adah", "collection_id"=>"governor-a-b-moore-administrati
ve-files-and-correspondence-1857-1859", "work_id"=>"rsg00248-f02-q0000133230-q0000133233", "page_id"=>"32237362"}
I, [2022-08-31T21:47:06.370260 #13265]  INFO -- :   Rendering inline template
I, [2022-08-31T21:47:06.371495 #13265]  INFO -- :   Rendered inline template (Duration: 0.6ms | Allocations: 89)
I, [2022-08-31T21:47:06.373571 #13265]  INFO -- : Completed 500  in 35ms (ActiveRecord: 5.9ms | Allocations: 11587)
F, [2022-08-31T21:47:06.382748 #13265] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:52:in `include?'
app/controllers/application_controller.rb:52:in `block in switch_locale'
app/controllers/application_controller.rb:51:in `select'
app/controllers/application_controller.rb:51:in `switch_locale'
saracarl commented 2 years ago

later timestamp:

closest to her 2nd timestamp:
I, [2022-09-01T00:02:49.277907 #4795]  INFO -- :   Rendered shared/_page_tabs.html.slim (Duration: 65.2ms | Allocations: 67911)
I, [2022-09-01T00:02:49.279030 #4795]  INFO -- :   Rendered shared/_transcription_help.html.slim (Duration: 0.2ms | Allocations: 58)
I, [2022-09-01T00:02:49.279618 #4795]  INFO -- :   Rendered transcribe/help.html.slim within layouts/application (Duration: 67.4ms | Al
locations: 68846)
I, [2022-09-01T00:02:49.281138 #4795]  INFO -- :   Rendered layouts/_mixpanel.erb (Duration: 0.2ms | Allocations: 51)
I, [2022-09-01T00:02:49.281997 #4795]  INFO -- :   Rendered layouts/_fb_pixel.erb (Duration: 0.1ms | Allocations: 50)
I, [2022-09-01T00:02:49.286649 #4795]  INFO -- :   Rendered shared/_breadcrumbs.html.slim (Duration: 0.6ms | Allocations: 196)
I, [2022-09-01T00:02:49.289082 #4795]  INFO -- :   Rendered layouts/_ga.erb (Duration: 0.2ms | Allocations: 50)
I, [2022-09-01T00:02:49.289837 #4795]  INFO -- : [ahoy] Event excluded
I, [2022-09-01T00:02:49.290925 #4795]  INFO -- : Completed 200 OK in 98ms (Views: 71.1ms | ActiveRecord: 10.8ms | Allocations: 81734)
I, [2022-09-01T00:02:49.291419 #4795]  INFO -- : Oink Action: transcribe#help
I, [2022-09-01T00:02:49.291752 #4795]  INFO -- : Memory usage: 1016720 | PID: 4795
I, [2022-09-01T00:02:49.292077 #4795]  INFO -- : Instantiation Breakdown: Total: 10 | Page: 4 | Collection: 3 | Work: 2 | User: 1
I, [2022-09-01T00:02:49.292300 #4795]  INFO -- : Oink Log Entry Complete
I, [2022-09-01T00:02:49.321589 #4795]  INFO -- : Started GET "/adah/governor-a-b-moore-pardons-and-paroles-1857-1859/rsg00249-f01-q0000
132995-q0000132997/contents" for 5.133.192.200 at 2022-09-01 00:02:49 +0000
I, [2022-09-01T00:02:49.324225 #4795]  INFO -- : Processing by DisplayController#list_pages as HTML
I, [2022-09-01T00:02:49.324680 #4795]  INFO -- :   Parameters: {"param"=>:work_id, "user_slug"=>"adah", "collection_id"=>"governor-a-b-
moore-pardons-and-paroles-1857-1859", "work_id"=>"rsg00249-f01-q0000132995-q0000132997"}
I, [2022-09-01T00:02:49.355399 #4795]  INFO -- : Completed 500  in 30ms (ActiveRecord: 5.7ms | Allocations: 8887)
F, [2022-09-01T00:02:49.364043 #4795] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:52:in `include?'
app/controllers/application_controller.rb:52:in `block in switch_locale'
app/controllers/application_controller.rb:51:in `select'
app/controllers/application_controller.rb:51:in `switch_locale'
I, [2022-09-01T00:02:49.510806 #4795]  INFO -- : Started GET "/katia-oler/520/32001274/still_editing/32040110" for 162.197.5.12 at 2022-09-01 00:02:49 +0000
I, [2022-09-01T00:02:49.513404 #4795]  INFO -- : Processing by TranscribeController#still_editing as */*
I, [2022-09-01T00:02:49.513738 #4795]  INFO -- :   Parameters: {"user_slug"=>"katia-oler", "collection_id"=>"520", "work_id"=>"32001274", "page_id"=>"32040110"}
benwbrum commented 2 years ago

It looks like this is from https://fromthepage.com/adah/governor-a-b-moore-administrative-files-and-correspondence-1857-1859/rsg00248-f02-q0000133230-q0000133233/display/32237362

benwbrum commented 2 years ago

The code throwing this appears to peek at the browser's language settings: https://github.com/benwbrum/fromthepage/blob/development/app/controllers/application_controller.rb#L51-L54

saracarl commented 2 years ago

last deployment was 20220901215615

saracarl commented 2 years ago

I tried this and checked my locales; these loaded fine:

[1] pry(#<StaticController>)> http_accept_language.user_preferred_languages 
=> [
    [0] "en-US",
    [1] "en"

Then I added another language and made it the first one in the list:

[1] pry(#<StaticController>)> http_accept_language.user_preferred_languages
=> [
    [0] "pl",
    [1] "en-US",
    [2] "en"

This also loaded fine.

saracarl commented 2 years ago

Browser info for her timestamp:

www.fromthepage.com:443 5.133.192.200 - - [01/Sep/2022:00:02:49 +0000] "GET /adah/governor-a-b-moore-pardons-and-paroles-1857-1859/rsg00249-f01-q0000132995-q0000132997/contents HTTP/1.1" 500 6856 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"

"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"

"is user agent string belongs to Chrome browser running on Windows 10. The browser is developed by Google Inc and renders web pages using the Blink engine."

Which means we can ask her to give us the results of this: chrome://settings/languages

benwbrum commented 2 years ago

We are continuing to encounter this. The last few errors after the deployment of the debugging code are

I, [2022-09-08T06:35:09.928012 #15322]  INFO -- : http_accept_language.user_preferred_languages = ["zh-CN", "zh-TW"]
I, [2022-09-08T06:35:09.929679 #15322]  INFO -- : Completed 500  in 11ms (ActiveRecord: 1.3ms | Allocations: 3397)
F, [2022-09-08T06:35:09.936296 #15322] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'
app/controllers/application_controller.rb:53:in `block in switch_locale'

I, [2022-09-08T06:50:51.330704 #17882]  INFO -- : http_accept_language.user_preferred_languages = ["ja"]
I, [2022-09-08T06:50:51.331972 #17882]  INFO -- : Completed 500  in 39ms (ActiveRecord: 4.4ms | Allocations: 20696)
F, [2022-09-08T06:50:51.338131 #17882] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T06:55:28.851807 #17882]  INFO -- : http_accept_language.user_preferred_languages = ["zh-CN", "zh-TW"]
I, [2022-09-08T06:55:28.853209 #17882]  INFO -- : Completed 500  in 8ms (ActiveRecord: 0.8ms | Allocations: 3365)
F, [2022-09-08T06:55:28.858498 #17882] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T06:57:27.967859 #17882]  INFO -- : http_accept_language.user_preferred_languages = ["sv-SE", "sv"]
I, [2022-09-08T06:57:27.969509 #17882]  INFO -- : Completed 500  in 25ms (ActiveRecord: 4.3ms | Allocations: 10082)
F, [2022-09-08T06:57:27.977206 #17882] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'
app/controllers/application_controller.rb:53:in `block in switch_locale'

I, [2022-09-08T07:19:23.132861 #20274]  INFO -- : Started GET "/user/choose_locale/pt" for 45.140.207.102 at 2022-09-08 07:
19:23 +0000
I, [2022-09-08T07:19:23.135507 #20274]  INFO -- : Processing by UserController#choose_locale as HTML
I, [2022-09-08T07:19:23.135789 #20274]  INFO -- :   Parameters: {"chosen_locale"=>"pt"}
I, [2022-09-08T07:19:23.150387 #20274]  INFO -- : http_accept_language.user_preferred_languages = ["en-US"]
I, [2022-09-08T07:19:23.151840 #20274]  INFO -- : Completed 500  in 16ms (ActiveRecord: 3.5ms | Allocations: 4449)
F, [2022-09-08T07:19:23.157725 #20274] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T07:19:31.059550 #20336]  INFO -- : Started GET "/software" for 193.56.20.24 at 2022-09-08 07:19:31 +0000
I, [2022-09-08T07:19:31.063378 #20336]  INFO -- : Processing by StaticController#software as HTML
I, [2022-09-08T07:19:31.079607 #20336]  INFO -- : http_accept_language.user_preferred_languages = ["en-US"]
I, [2022-09-08T07:19:31.081214 #20336]  INFO -- : Completed 500  in 17ms (ActiveRecord: 3.4ms | Allocations: 5051)
F, [2022-09-08T07:19:31.087686 #20336] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T07:20:19.989075 #21396]  INFO -- : Started GET "/user/choose_locale/en" for 194.110.150.197 at 2022-09-08 07
:20:19 +0000
I, [2022-09-08T07:20:19.991319 #21396]  INFO -- : Processing by UserController#choose_locale as HTML
I, [2022-09-08T07:20:19.991559 #21396]  INFO -- :   Parameters: {"chosen_locale"=>"en"}
I, [2022-09-08T07:20:20.056445 #21396]  INFO -- : http_accept_language.user_preferred_languages = ["en-US"]
I, [2022-09-08T07:20:20.057829 #21396]  INFO -- : Completed 500  in 66ms (ActiveRecord: 8.4ms | Allocations: 34188)
F, [2022-09-08T07:20:20.063501 #21396] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'
app/controllers/application_controller.rb:53:in `block in switch_locale'
app/controllers/application_controller.rb:52:in `select'
app/controllers/application_controller.rb:52:in `switch_locale'

I, [2022-09-08T07:20:35.798640 #21416]  INFO -- : Started GET "/digitalindy/ipr?search%5Bs0%5D%5B%5D=Unidentified+park+pool
+cleanup+effort&search%5Bs0%5D%5B%5D=Unidentified+park+water+pump&search%5Bs0%5D%5B%5D=Unidentified+park+program&search%5Bs
1%5D%5B%5D=1960s+%281960-1969%29&search%5Bs2%5D%5B%5D=Concert%3B+Senior+citizens%3B&search%5Bs2%5D%5B%5D=Folk+Dance&search%
5Bwork-collection_id%5D=25000140" for 66.249.66.13 at 2022-09-08 07:20:35 +0000
I, [2022-09-08T07:20:35.801189 #21416]  INFO -- : Processing by CollectionController#show as HTML
I, [2022-09-08T07:20:35.801573 #21416]  INFO -- :   Parameters: {"search"=>{"s0"=>["Unidentified park pool cleanup effort",
 "Unidentified park water pump", "Unidentified park program"], "s1"=>["1960s (1960-1969)"], "s2"=>["Concert; Senior citizen
s;", "Folk Dance"], "work-collection_id"=>"25000140"}, "user_slug"=>"digitalindy", "id"=>"ipr"}
I, [2022-09-08T07:20:35.803071 #21416]  INFO -- : [ahoy] Visit excluded
F, [2022-09-08T07:20:35.803864 #21396] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T07:20:36.927872 #21396]  INFO -- : Started GET "/user/choose_locale/en" for 213.232.120.216 at 2022-09-08 07
:20:36 +0000
I, [2022-09-08T07:20:36.930031 #21396]  INFO -- : Processing by UserController#choose_locale as HTML
I, [2022-09-08T07:20:36.930267 #21396]  INFO -- :   Parameters: {"chosen_locale"=>"en"}
I, [2022-09-08T07:20:36.941619 #21396]  INFO -- : http_accept_language.user_preferred_languages = ["en-US"]
I, [2022-09-08T07:20:36.942953 #21396]  INFO -- : Completed 500  in 12ms (ActiveRecord: 2.6ms | Allocations: 4433)
F, [2022-09-08T07:20:36.948226 #21396] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'

I, [2022-09-08T07:20:39.804868 #21437]  INFO -- : Started GET "/digitalindy/ipr?search%5Bs0%5D%5B%5D=Unidentified+park+wate
rscapes&search%5Bs0%5D%5B%5D=Unidentified+park+basketball+court&search%5Bs0%5D%5B%5D=Unidentified+fleet+of+trucks&search%5B
work-collection_id%5D=25000140" for 66.249.66.13 at 2022-09-08 07:20:39 +0000
I, [2022-09-08T07:20:39.807493 #21437]  INFO -- : Processing by CollectionController#show as HTML
I, [2022-09-08T07:20:39.807802 #21437]  INFO -- :   Parameters: {"search"=>{"s0"=>["Unidentified park waterscapes", "Uniden
tified park basketball court", "Unidentified fleet of trucks"], "work-collection_id"=>"25000140"}, "user_slug"=>"digitalind
y", "id"=>"ipr"}
I, [2022-09-08T07:20:39.809275 #21437]  INFO -- : [ahoy] Visit excluded
I, [2022-09-08T07:20:39.812791 #21437]  INFO -- :   Rendering inline template
I, [2022-09-08T07:20:39.813786 #21437]  INFO -- :   Rendered inline template (Duration: 0.5ms | Allocations: 95)
I, [2022-09-08T07:20:39.814634 #21437]  INFO -- : http_accept_language.user_preferred_languages = []
I, [2022-09-08T07:20:39.839989 #21416]  INFO -- :   Rendering inline template
I, [2022-09-08T07:20:39.840925 #21416]  INFO -- :   Rendered inline template (Duration: 0.4ms | Allocations: 95)
I, [2022-09-08T07:20:39.841713 #21416]  INFO -- : http_accept_language.user_preferred_languages = ["en-US"]
I, [2022-09-08T07:20:39.843155 #21416]  INFO -- : Completed 500  in 69ms (ActiveRecord: 4.8ms | Allocations: 34859)
F, [2022-09-08T07:20:39.849739 #21416] FATAL -- :   
TypeError (no implicit conversion of Symbol into String):

app/controllers/application_controller.rb:53:in `include?'
app/controllers/application_controller.rb:53:in `block in switch_locale'
benwbrum commented 2 years ago

We finally fixed it:

CONGRATS! It was a success and I was able to get into the program using Safari at about 10:31 PM EST.
Appreciate all your hard work.
Thanks, Melissa.