github-education-resources / classroom

GitHub Classroom automates repository creation and access control, making it easy for teachers to distribute starter code and collect assignments on GitHub.
https://classroom.github.com
1.34k stars 564 forks source link

[RAILS UPGRADE] RuntimeError #2262

Closed JessRudder closed 5 years ago

JessRudder commented 5 years ago

Note - This error seems to have occurred in two places when we deployed the Rails upgrade: short_url#assignment_invitation hooks#receive

Part of #2102

Needle: https://haystack.githubapp.com/classroom/needles/s6LSpjC-lWDXaKSpLKg8Wg Rollup: https://haystack.githubapp.com/classroom/rollups/34264a70dc6711e7079b7ad0087b1a26

RuntimeError
can't modify frozen String
attribute value
action assignment_invitation
class_name RuntimeError
controller short_url
current_scopes nil
impersonator nil
method GET
params {}
referrer nil
remote_ip 66.249.79.157
required_scopes nil
ruby ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
session {}
time 0.025350084
url https://classroom.github.com/a/HGpnUyUv
user nil
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)
zone 2019-08-16T20:49:06Z
Backtrace
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker/handler.rb:40:in `sub!'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker/handler.rb:40:in `inject'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:62:in `block in inject'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:95:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:95:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:61:in `inject'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:50:in `block in call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/response.rb:148:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/response.rb:148:in `each_chunk'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/response.rb:129:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/response.rb:76:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/response.rb:474:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/peek-performance_bar-1.2.0/lib/peek/views/performance_bar/process_utilization.rb:116:in `each'
/app/vendor/bundle/ruby/2.4.0/gems/rack-tracker-1.4.0/lib/rack/tracker.rb:50:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/pinglish-0.2.1/lib/pinglish.rb:42:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/tempfile_reaper.rb:15:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/etag.rb:25:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/conditional_get.rb:25:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:232:in `context'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:226:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/cookies.rb:670:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/callbacks.rb:98:in `run_callbacks'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/failbot-2.0.1/lib/failbot/middleware.rb:16:in `block in call'
/app/vendor/bundle/ruby/2.4.0/gems/failbot-2.0.1/lib/failbot.rb:113:in `push'
/app/vendor/bundle/ruby/2.4.0/gems/failbot-2.0.1/lib/failbot/middleware.rb:13:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/lograge-0.11.2/lib/lograge/rails_ext/rack/logger.rb:15:in `call_app'
/app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `block in call'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:28:in `tagged'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/tagged_logging.rb:71:in `tagged'
/app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/rack/logger.rb:26:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/method_override.rb:22:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/runtime.rb:22:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/executor.rb:14:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/static.rb:127:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-2.0.7/lib/rack/sendfile.rb:111:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/ssl.rb:74:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:524:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/rack-canonical-host-0.2.3/lib/rack/canonical_host.rb:19:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/newrelic_rpm-4.4.0.336/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/puma-4.0.1/lib/puma/configuration.rb:228:in `call'
/app/vendor/bundle/ruby/2.4.0/gems/puma-4.0.1/lib/puma/server.rb:657:in `handle_request'
/app/vendor/bundle/ruby/2.4.0/gems/puma-4.0.1/lib/puma/server.rb:467:in `process_client'
/app/vendor/bundle/ruby/2.4.0/gems/puma-4.0.1/lib/puma/server.rb:328:in `block in run'
/app/vendor/bundle/ruby/2.4.0/gems/puma-4.0.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'

Brought to you by Haystack's ! hotkey. Try it on a needle or rollup today!

JessRudder commented 5 years ago

This was fixed with #2102 - The issue was in the rack-tracker gem which is only run in production. Rails 5.2 switched to freezing string in all the places. This meant that on redirects rack-tracker had a frozen string that it expected to be able to mutate.

They had fixed this in a more recent version of rack-tracker. Upgrading the rack-tracker version fixed that problem like a charm.

For future upgrades, we may want to add a step to either run the app in production mode to verify there aren't unexpected issues or to check all production-only gems to see if any of them have updates that were specifically related to Rails upgrade issues.