Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError in RequestGameController#play #3556

Closed
lizconlan opened this issue Oct 20, 2016 · 2 comments
Closed

ArgumentError in RequestGameController#play #3556

lizconlan opened this issue Oct 20, 2016 · 2 comments
Labels
bug Breaks expected functionality x:belgium x:eu

Comments

@lizconlan
Copy link

This feels like a duplicate but I can't find an earlier ticket.

Seems to affect the fr and fr_BE locales, latest error was on Transparencia

An ArgumentError occurred in request_game#play:

  comparison of String with 1 failed
  vendor/bundle/ruby/1.9.1/gems/fast_gettext-1.0.0/lib/fast_gettext/mo_file.rb:32:in `eval'


-------------------------------
Request:
-------------------------------

  * URL        : https://transparencia.be/categorise/play
  * HTTP Method: GET
  * IP address : 66.249.76.119
  * Parameters : {"controller"=>"request_game", "action"=>"play"}
  * Timestamp  : 2016-10-19 23:18:22 +0200
  * Server : mastodon
  * Rails root : /data/vhost/belgium.alaveteli.org/alaveteli-2016-10-19T14-59-09
  * Process: 1803

-------------------------------
Session:
-------------------------------

  * session id: [FILTERED]
  * data: {"session_id"=>"c297752dffa29a926f45a15253ee1124",
   "locale"=>"fr_BE",
   "request_game"=>2016-10-19 22:18:22 +0100}

-------------------------------
Environment:
-------------------------------

  * HTTP_ACCEPT                                    : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  * HTTP_ACCEPT_ENCODING                           : gzip
  * HTTP_FROM                                      : googlebot(at)googlebot.com
  * HTTP_HOST                                      : transparencia.be
  * HTTP_USER_AGENT                                : Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
  * HTTP_VERSION                                   : HTTP/1.1
  * HTTP_X_FORWARDED_FOR                           : 66.249.76.119
  * HTTP_X_FORWARDED_PROTO                         : https
  * HTTP_X_REAL_IP                                 : 66.249.76.119
  * HTTP_X_VARNISH                                 : 2344078052
  * ORIGINAL_FULLPATH                              : /categorise/play
  * PASSENGER_CONNECT_PASSWORD                     : [FILTERED]
  * PATH_INFO                                      : /categorise/play
  * QUERY_STRING                                   :
  * REMOTE_ADDR                                    : 66.249.76.119
  * REMOTE_PORT                                    : 56273
  * REQUEST_METHOD                                 : GET
  * REQUEST_URI                                    : /categorise/play
  * SCRIPT_NAME                                    :
  * SCRIPT_URI                                     : http://transparencia.be/categorise/play
  * SCRIPT_URL                                     : /categorise/play
  * SERVER_NAME                                    : transparencia.be
  * SERVER_PORT                                    : 80
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : Apache/2.2.22 (Debian) mod_fastcgi/mod_fastcgi-SNAP-0910052141 Phusion_Passenger/5.0.30
  * action_controller.instance                     : #<RequestGameController:0x00000006d71c10>
  * action_dispatch.backtrace_cleaner              : #<Rails::BacktraceCleaner:0x00000001b0a738>
  * action_dispatch.cookies                        : #<ActionDispatch::Cookies::CookieJar:0x00000006c712c0>
  * action_dispatch.logger                         : #<ActiveSupport::TaggedLogging:0x000000014c89d8>
  * action_dispatch.parameter_filter               : [:password, /RAW_POST_DATA/]
  * action_dispatch.remote_ip                      : 66.249.76.119
  * action_dispatch.request.content_type           :
  * action_dispatch.request.flash_hash             : #<ActionDispatch::Flash::FlashHash:0x000000065422d8>
  * action_dispatch.request.formats                : [text/html]
  * action_dispatch.request.parameters             : {"controller"=>"request_game", "action"=>"play"}
  * action_dispatch.request.path_parameters        : {:controller=>"request_game", :action=>"play"}
  * action_dispatch.request.query_parameters       : {}
  * action_dispatch.request.request_parameters     : {}
  * action_dispatch.request.unsigned_session_cookie: {"session_id"=>"c297752dffa29a926f45a15253ee1124"}
  * action_dispatch.request_id                     : f4988af36ecc43a5a964a24cc2153bd4
  * action_dispatch.routes                         : #<ActionDispatch::Routing::RouteSet:0x0000000503b768>
  * action_dispatch.secret_token                   : 3d0e2163538627c53807750b075049ed5d73c80cbf69964e486f5483b310a822e04535fba4b1f7f95feaa6058c544485b0adf4c46513bd1d52f0b74af7a3968f6
  * action_dispatch.show_detailed_exceptions       : false
  * action_dispatch.show_exceptions                : true
  * newrelic.transaction_started                   : true
  * rack.errors                                    : #<IO:0x0000000133d230>
  * rack.hijack                                    : #<Proc:0x0000000703e240@/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:84 (lambda)>
  * rack.hijack?                                   : true
  * rack.input                                     : #<PhusionPassenger::Utils::TeeInput:0x00000007045158>
  * rack.multiprocess                              : true
  * rack.multithread                               : false
  * rack.request.cookie_hash                       : {}
  * rack.request.query_hash                        : {}
  * rack.request.query_string                      :
  * rack.run_once                                  : false
  * rack.session                                   : {"session_id"=>"c297752dffa29a926f45a15253ee1124", "locale"=>"fr_BE", "request_game"=>2016-10-19 22:18:22 +0100}
  * rack.session.options                           : {:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :secret=>"59159da5bf3da351d6c39317e0121ffc4c95dbe7b1b12a0634ed440e05ed", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x00000005a9e660>, :id=>"c297752dffa29a926f45a15253ee1124"}
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 2]

I've reproduced it locally - it's the league table code:

<%= n_("{{number_of_requests}} request",
       "{{number_of_requests}} requests",
       classifications.cnt,
       :number_of_requests => classifications.cnt) %>

It seems to occur once you've helpfully classified something so really off-putting.

@lizconlan lizconlan added 1 - new bug Breaks expected functionality x:eu x:belgium labels Oct 20, 2016
@lizconlan
Copy link
Author

dev mode trace fragment:

Started GET "/fr_BE/categorise/play" for 10.10.10.1 at 2016-10-20 09:37:52 +0000
Processing by RequestGameController#play as HTML
  Parameters: {"locale"=>"fr_BE"}
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 7]]
   (0.4ms)  SELECT COUNT(*) FROM "info_requests" WHERE "info_requests"."prominence" = 'normal' AND (awaiting_description = 't'
 AND last_public_response_at < '2016-09-29 09:37:53.339710'
 AND url_title != 'holding_pen'
 AND user_id IS NOT NULL)
   (0.2ms)  SELECT COUNT(*) FROM "info_requests"
  RequestClassification Load (0.5ms)  SELECT user_id, count(*) as cnt FROM "request_classifications" WHERE (created_at >= '2016-09-22 09:37:53.345717') GROUP BY user_id ORDER BY cnt desc LIMIT 10
  User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."id" IN (7)
  Rendered request_game/play.html.erb within layouts/default (196.1ms)
Completed 500 Internal Server Error in 451.9ms

ArgumentError (comparison of String with 1 failed):
  lib/i18n_fixes.rb:21:in `n_'
  app/views/request_game/play.html.erb:24:in `block in _app_views_request_game_play_html_erb___3019675502433427196_83823840'
  app/views/request_game/play.html.erb:18:in `_app_views_request_game_play_html_erb___3019675502433427196_83823840'
  app/controllers/application_controller.rb:107:in `record_memory'
  lib/strip_empty_sessions.rb:13:in `call'

@garethrees
Copy link
Member

Dup of mysociety/belgium-theme#23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks expected functionality x:belgium x:eu
Projects
None yet
Development

No branches or pull requests

2 participants