Open bronson opened 8 years ago
I'm seeing this occasionally too. Looks like #518 could fix it :)
I too have just received this in the same way as @Karthik-Y
I have the same issue locally (dev) and in production, the problem is mainly a concurrency problem (i think) because I saw that only when a particular action is hitted a lot.
Issue: ActionView::Template::Error: can't add a new key into hash during iteration
Line: <%= stylesheet_link_tag 'application', media: 'all' %>
Ruby: ruby 2.4.1p111
Rails: 5.1.6
sprockets: 3.7.2
sprockets-rails: 3.2.1
Fixed with the Patch SprocketCache
I can test and notice the difference with
$ ab -n 100 -c 10 URL
Cheers
I ran into this just now. I have not changed the assets. Rails 5.2.2, Ruby 2.5.3. I was just editing a text box with CKEditor gem and had uploaded an image file and when I saved, I got this error. I see git sees new files under public/ckeditor_assets/
. I reloaded the page and it went away.
public/ckeditor_assets/pictures/1/content_137506881909824295852507266618340761448.jpg
public/ckeditor_assets/pictures/1/original_137506881909824295852507266618340761448.jpg
public/ckeditor_assets/pictures/1/thumb_137506881909824295852507266618340761448.jpg
Completed 500 Internal Server Error in 5824ms (ActiveRecord: 291.6ms)
ActionView::Template::Error (can't add a new key into hash during iteration):
6: <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" cros
sorigin="anonymous">
7: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
8: <%= stylesheet_link_tag 'https://fonts.googleapis.com/css?family=Cabin:600|Open+Sans' %>
9: <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
10: <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonym
ous"></script>
11: <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous
"></script>
12: <script src="https://js.stripe.com/v3/"></script>
app/views/layouts/application.html.erb:9:in `_app_views_layouts_application_html_erb__135861518_81740640'
Here is a solution: http://stackoverflow.com/questions/25198085/ddg#27643890
Still seeing this at random on Rails 5.2.1, Ruby 2.5.3; refreshing the page works.
+1 ActionView::Template::Error: can't add a new key into hash during iteration https://app.honeybadger.io/fault/57486/c6617f5edcae8560e3c2e8ccebaf5c5a
I'm experiencing the same issue in ActionMailer when the view is rendered.
I am experiencing same issue. Ruby 2.7.1 and rails-6. Occurs when traffic increases. Reproduced it using load-testing (i.e made bundle of 5 api calls) and ran it with 50 users on app hosted on EC-2 instance.
Same issue with rails 6.1.rc1 & Ruby 2.5.8
Also got similar problem from ActiveRecord, https://github.com/rails/rails/issues/40608
I experienced the same error while running my rails application in development mode on docker. In my case, increasing the memory under Docker preferences solved it for me (I was running a bunch of containers, and obviously 2GB was not sufficient. I increased it to 6GB).
I'm having this occur while load-testing a new server while we move from Ubuntu & NGINX on AWS to RedHat & Apache on VMware(?) VMs on internally hosted hardware.
We never had this happen on the old servers. (It's a brand-new error in Rollbar.) But now it happens less than 1% of the time (0.36% in my latest sample) during load testing. I have no idea which of the new variables to be suspicious of:
Ubuntu → RedHat NGINX → Apache AWS EC2 → VMware
But if anyone notices a pattern in your own experiences, please pipe up.
We are experiencing the same thing in dev:
rails -> rails-7.0.4.2 sprockets -> sprockets-3.7.2 ruby -> ruby-2.7.8
What we did was run rails with puma with with 1 thread for now
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 1 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { 1 }
threads min_threads_count, max_threads_count
Got this backtrace in development mode while using my app... The page crashed instead of rendering. Haven't managed to reproduce it though. Tried a few times, both with and without clearing the cache first.