Project

General

Profile

Actions

Bug #4838

closed

Foreman is not accessible when browser locale is set to Czech

Added by Lukas Zapletal about 10 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Internationalization
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:

1) Setup your first preferred language to unsupported one (e.g. not English or German, but Czech)
2) Access freshly installed foreman instance for the first time
3) Error in the log:

ArgumentError (cannot parse Cookie header: invalid %-encoding (%7B%22authorized%22%3Afalse%2C%22internal%22%3Afalse%
2C%22lang%22%3A%22cs%22%2C%22lang_err_msg%22%3A%22The%20page%20you%20have%20selected%20is%20not%20yet%20available%20
in%20%u010De%u0161tina.%20We%20are%20working%20to%20make%20sure%20all%20content%20is%20available%20in%20%u010De%u016
1tina%2C%20but%20in%20order%20to%20display%20the%20page%20we%20have%20switched%20your%20language%20to%20English.%22%
2C%22hello%22%3A%22Hello%2C%22%2C%22description_placeholder%22%3A%22Enter%20a%20description%22%7D))

Yes, this is a cookie error, but from the text I see (briefly decoded in vim):

ArgumentError (cannot parse Cookie header: invalid %-encoding (%7B%22authorized%22%3Afalse%2C%22internal%22%3Afalse%
2C%22lang%22%3A%22cs%22%2C%22lang_err_msg%22%3A%22The page you have selected is not yet available 
in %u010De%u0161tina. We are working to make sure all content is available in %u010De%u016
1tina%2C but in order to display the page we have switched your language to English.%22%
2C%22hello%22%3A%22Hello%2C%22%2C%22description_placeholder%22%3A%22Enter a description%22%7D))

I get this every time and it started last week (with nightlies). We had to change something in our i18n code, something is apparently messing up my cookies and since I get random hostnames in beaker, it does this every request. Quick googling shows this might be something in jQuery, but I am not sure.

Actions #1

Updated by Dominic Cleal about 10 years ago

  • Category set to Internationalization
Actions #2

Updated by Lukas Zapletal about 10 years ago

After some investigation, it looks like something stored incorrect data into Chrome remembered password:

rh_omni_tc=70160000000H4AoAAK; s_dmdbase=rsp%3Dnomatch; s_nr=1395742051663; s_ria=flash%2012%7Csilverlight%20not%20detected; rh_elqCustomerGUID=eb7d9da7-94f9-4742-8f5c-043a7e47c894; chrome_user_remember=%7B%22remembered%22%3Atrue%7D; chrome_user_info=%7B%22authorized%22%3Afalse%2C%22internal%22%3Afalse%2C%22lang%22%3A%22cs%22%2C%22lang_err_msg%22%3A%22The%20page%20you%20have%20selected%20is%20not%20yet%20available%20in%20%u010De%u0161tina.%20We%20are%20working%20to%20make%20sure%20all%20content%20is%20available%20in%20%u010De%u0161tina%2C%20but%20in%20order%20to%20display%20the%20page%20we%20have%20switched%20your%20language%20to%20English.%22%2C%22hello%22%3A%22Hello%2C%22%2C%22description_placeholder%22%3A%22Enter%20a%20description%22%7D; s_vnum=1398333861537%26vn%3D11; s_fid=41196760D5C26DC1-2DC7452184CAF32C; s_cc=true; s_sq=%5B%5BB%5D%5D; s_vi=[CS]v1|2998AA53051D3270-400001332002CC25[CE]
Actions #3

Updated by Lukas Zapletal about 10 years ago

  • Status changed from New to Rejected

Wow, it turns out it is a bug in access.redhat.com portal which I reported:

https://bugzilla.redhat.com/show_bug.cgi?id=1085711

It broke my Foreman instances in Beaker :-)

Actions #4

Updated by Lukas Zapletal about 10 years ago

It looks like we will not have prompt response from the portal team, I did additional research and it looks like the parsing exception is thrown in Passenger/Rack:

ArgumentError (cannot parse Cookie header: invalid %-encoding (%7B%22authorized%22%3Afalse%2C%22internal%22%3Afalse%2C%22lang%22%3A%22cs%22%2C%22lang_err_msg%22%3A%22The%20page%20you%20have%20selected%20is%20not%20yet%20available%20in%20%u010De%u0161tina.%20We%20are%20working%20to%20make%20sure%20all%20content%20is%20available%20in%20%u010De%u0161tina%2C%20but%20in%20order%20to%20display%20the%20page%20we%20have%20switched%20your%20language%20to%20English.%22%2C%22hello%22%3A%22Hello%2C%22%2C%22description_placeholder%22%3A%22Enter%20a%20description%22%7D)):
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  /usr/lib/ruby/gems/1.8/gems/passenger-4.0.5/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

It's not a bug in upstream, but rather using incorrect (JavaScript in this case) encoder: https://github.com/rack/rack/pull/360

>> require "uri" 
=> true
>> URI.decode '(%7B%22authorized%22%3Afalse%2C%22internal%22%3Afalse%2C%22lang%22%3A%22cs%22%2C%22lang_err_msg%22%3A%22The%20page%20you%20have%20selected%20is%20not%20yet%20available%20in%20%u010De%u0161tina.%20We%20are%20working%20to%20make%20sure%20all%20content%20is%20available%20in%20%u010De%u0161tina%2C%20but%20in%20order%20to%20display%20the%20page%20we%20have%20switched%20your%20language%20to%20English.%22%2C%22hello%22%3A%22Hello%2C%22%2C%22description_placeholder%22%3A%22Enter%20a%20description%22%7D'
=> "({\"authorized\":false,\"internal\":false,\"lang\":\"cs\",\"lang_err_msg\":\"The page you have selected is not yet available in %u010De%u0161tina. We are working to make sure all content is available in %u010De%u0161tina, but in order to display the page we have switched your language to English.\",\"hello\":\"Hello,\",\"description_placeholder\":\"Enter a description\"}" 

This bug appears only if you visit the portal with unsupported language set in your browser that has diacritics in the language name. Unlucky Čeština :-)

I am pushing on the portal devs to fix this.

Actions

Also available in: Atom PDF