jRuby error - can't modify frozen array - ruby-on-rails

I keep getting this error in my App, no matter what I try to fix.
"can't modify frozen array"
Any idea what could be possibly wrong here? I am running a jRuby (1.6.2) app on Torquebox (1.0.1) on my local Ubuntu (10.04) machine. Here is a complete stack trace
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org.jruby.exceptions.RaiseException: (TypeError) can't modify frozen array
org.torquebox.rack.core.servlet.RackFilter.doRack(RackFilter.java:118)
org.torquebox.rack.core.servlet.RackFilter.doFilter(RackFilter.java:103)
org.torquebox.rack.core.servlet.RackFilter.doFilter(RackFilter.java:75)
root cause
org.jruby.exceptions.RaiseException: (TypeError) can't modify frozen array
org.jruby.RubyArray.concat(org/jruby/RubyArray.java:1450)
#<Class:0x1009c9a44>.Plugin(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/plugin.rb:71)
org.jruby.RubyKernel.instance_exec(org/jruby/RubyKernel.java:2045)
rubyjit.run_7761DFB9328DE427D0E75A527B886E70C475D69F.run(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25)
#<Class:0x1000dfe45>.run_initializers(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50)
org.jruby.RubyArray.each(org/jruby/RubyArray.java:1602)
Rails::Initializable.run_initializers(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49)
Rails::Application.initialize!(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:134)
rubyjit.method_added_79E9152BC344C327B5B6A61AD8A4DB7112D305D2.method_added(classpath:/org/torquebox/rails/core/boot.rb:78)
org.jruby.RubyKernel.send(org/jruby/RubyKernel.java:2059)
#<Class:0x101305815>.method_missing(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77)
#<Class:0x1002cf032>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config/environment.rb:5)
org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1038)
rubyjit.require_48BC09453A4C02A82A5E47520814DA9EA3718525.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64)
rubyjit.require_3E6CA858403268171F46C45451765CD50640768C.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239)
rubyjit.load_dependency_04443C3CFAC2D53B173F0FF308908A72BD893CCC.load_dependency(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:227)
rubyjit.require_3E6CA858403268171F46C45451765CD50640768C.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239)
#<Class:0x101f38e01>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config/environment.rb:6)
org.jruby.RubyKernel.instance_eval(org/jruby/RubyKernel.java:2028)
Rack::Builder.initialize(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46)
#<Class:0x1002cf032>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config.ru:3)
note The full stack trace of the root cause is available in the JBoss Web/3.0.0-CR1 logs.
JBoss Web/3.0.0-CR1

If you get the error during startup, chances are big you're actually trying to redefine a frozen array in an initializer (could be as simple as redifining ABBR_DAYNAMES). If the application can run under MRI you could try that, since it gives you verbose warnings about this.
If there's nothing in your initializer, then it might be a gem that you included in your application. Try taking out gems one by one and see what the result is.

Related

PostgreSQL SSL Error

We've got a WebApp mixing Ember.js, Rails, unicorn and PostgreSQL, all of them on Heroku.
All is working well, except we sometimes get a PGError
PG::ConnectionBad: PQconsumeInput() SSL error: BN lib
Most of the time, we can continue to use the app without any problems, but sometimes this error brokes the JS and we have to reload the page to be able to use the WebApp.
We believe it could be somethings like Unicorn lost the PG connection, but there is nearly nothing on the web related to this error message.
Any idea would be appreciated.
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:779
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:779
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:139
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:137
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:885
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:24
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:61
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:76
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:61
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/querying.rb:36
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/relation.rb:585
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/relation.rb:471
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/relation.rb:220
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/associations/collection_association.rb:415
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/associations/collection_association.rb:358
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/associations/collection_proxy.rb:45
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/associations/collection_proxy.rb:920
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:12
[GEM_ROOT]/gems/active_model_serializers-0.8.1/lib/active_model/array_serializer.rb:79
[GEM_ROOT]/gems/active_model_serializers-0.8.1/lib/active_model/array_serializer.rb:73
[GEM_ROOT]/gems/active_model_serializers-0.8.1/lib/active_model/array_serializer.rb:49
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/json/encoding.rb:50
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/json/encoding.rb:81
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/json/encoding.rb:49
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/json/encoding.rb:34
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/core_ext/object/to_json.rb:16
[GEM_ROOT]/gems/active_model_serializers-0.8.1/lib/active_model/array_serializer.rb:63
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/renderers.rb:90
[GEM_ROOT]/gems/active_model_serializers-0.8.1/lib/action_controller/serialization.rb:46
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/renderers.rb:33
[PROJECT_ROOT]/vendor/ruby-2.0.0/lib/ruby/2.0.0/set.rb:232
[PROJECT_ROOT]/vendor/ruby-2.0.0/lib/ruby/2.0.0/set.rb:232
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/renderers.rb:30
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/renderers.rb:26
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/rendering.rb:97
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/rendering.rb:16
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:41
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/core_ext/benchmark.rb:12
[PROJECT_ROOT]/vendor/ruby-2.0.0/lib/ruby/2.0.0/benchmark.rb:296
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/core_ext/benchmark.rb:12
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:41
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:84
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/railties/controller_runtime.rb:25
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:40
[GEM_ROOT]/gems/wicked_pdf-0.9.6/lib/pdf_helper.rb:23
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:255
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:203
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:182
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:176
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:154
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/responder.rb:147
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/mime_responds.rb:330
app/controllers/api/v1/protocols_controller.rb:8
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/implicit_render.rb:4
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/base.rb:189
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/rendering.rb:10
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/callbacks.rb:18
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:413
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/callbacks.rb:17
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/rescue.rb:29
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:31
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/instrumentation.rb:30
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/params_wrapper.rb:245
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/railties/controller_runtime.rb:18
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/base.rb:136
[GEM_ROOT]/gems/actionpack-4.0.0/lib/abstract_controller/rendering.rb:44
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal.rb:195
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal/rack_delegation.rb:13
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_controller/metal.rb:231
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:80
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:80
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:48
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:44
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/journey/router.rb:71
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/journey/router.rb:59
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/journey/router.rb:59
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:655
[GEM_ROOT]/gems/newrelic_rpm-3.6.6.147/lib/new_relic/rack/error_collector.rb:43
[GEM_ROOT]/gems/newrelic_rpm-3.6.6.147/lib/new_relic/rack/agent_hooks.rb:22
[GEM_ROOT]/gems/newrelic_rpm-3.6.6.147/lib/new_relic/rack/browser_monitoring.rb:16
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:35
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34
[GEM_ROOT]/gems/warden-1.2.3/lib/warden/manager.rb:34
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/etag.rb:23
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/conditionalget.rb:25
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/head.rb:11
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/params_parser.rb:27
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/flash.rb:241
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/cookies.rb:486
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/query_cache.rb:36
[GEM_ROOT]/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:626
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:29
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:373
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:80
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/callbacks.rb:27
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/remote_ip.rb:76
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:17
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30
[GEM_ROOT]/gems/railties-4.0.0/lib/rails/rack/logger.rb:38
[GEM_ROOT]/gems/railties-4.0.0/lib/rails/rack/logger.rb:21
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:25
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/tagged_logging.rb:67
[GEM_ROOT]/gems/railties-4.0.0/lib/rails/rack/logger.rb:21
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/methodoverride.rb:21
[GEM_ROOT]/gems/rack-1.5.2/lib/rack/runtime.rb:17
[GEM_ROOT]/gems/activesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83
[GEM_ROOT]/gems/actionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64
[GEM_ROOT]/gems/railties-4.0.0/lib/rails/engine.rb:511
[GEM_ROOT]/gems/railties-4.0.0/lib/rails/application.rb:97
[GEM_ROOT]/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552
[GEM_ROOT]/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632
[GEM_ROOT]/gems/newrelic_rpm-3.6.6.147/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22
[GEM_ROOT]/gems/newrelic_rpm-3.6.6.147/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22
[GEM_ROOT]/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500
[GEM_ROOT]/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142
[GEM_ROOT]/gems/unicorn-4.6.3/bin/unicorn:126
[PROJECT_ROOT]/vendor/bundle/ruby/2.0.0/bin/unicorn:23
[PROJECT_ROOT]/vendor/bundle/ruby/2.0.0/bin/unicorn:23

How to handle exception generated from Rack before reaching your rails app

I have a jruby rails application running under tomcat. Some malformed query string in url cause Rack to choke with the exception stack trace being shown in production mode. Is there a way to handle that gracefully. I don't think I can use config.exception_app as that will only handle exception generated from the rails app. In this case, the exception is generated before it get to the rails app. Here is the exception:
org.jruby.exceptions.RaiseException: (ArgumentError) invalid %-encoding (/"{}\%#$())
at Module.decode_www_form_component(jar:file:/usr/local/apache-
tomcat/webapps/ROOT/WEB-INF/lib/gems-gems-jruby-jars-1.7.3-lib-jruby-stdlib-
1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/uri/common.rb:898)
at Rack::Utils.unescape(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/utils.rb:41)
at Rack::Utils.parse_nested_query(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/utils.rb:94)
at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2361)
at Rack::Utils.parse_nested_query(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/utils.rb:94)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613)
at Rack::Utils.parse_nested_query(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/utils.rb:93)
at Rack::Request.parse_query(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/request.rb:332)
at Rack::Request.POST(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/request.rb:209)
at Rack::MethodOverride.method_override(/usr/local/apache-
tomcat/webapps/ROOT/WEB-INF/gems/gems/rack-1.4.5/lib/rack/methodoverride.rb:26)
at Rack::MethodOverride.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/methodoverride.rb:14)
at Rack::Runtime.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/runtime.rb:17)
at ActiveSupport::Cache::Strategy::LocalCache::Middleware.call(/usr/local/apache-
tomcat/webapps/ROOT/WEB-INF/gems/gems/activesupport-
3.2.13/lib/active_support/cache/strategy/local_cache.rb:72)
at Rack::Lock.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-1.4.5/lib/rack/lock.rb:15)
at Rack::Cache::Context.forward(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:136)
at Rack::Cache::Context.pass(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:143)
at Rack::Cache::Context.invalidate(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:155)
at Rack::Cache::Context.call!(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:71)
at Rack::Cache::Context.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/rack-cache-1.2/lib/rack/cache/context.rb:51)
at Rails::Engine.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/railties-3.2.13/lib/rails/engine.rb:479)
at Rails::Application.call(/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/gems/gems/railties-3.2.13/lib/rails/application.rb:223)
at Rack::Handler::Servlet.call(file:/usr/local/apache-tomcat/webapps/ROOT/WEB-
INF/lib/gems-gems-jruby-rack-1.1.13.1-lib-jruby-rack-
1.1.13.1.jar!/rack/handler/servlet.rb:22)
if the Ruby runtime is booted - which in this case seems it is ... you should be able to configure a (minimal) rack error application just set smt rack-y (require 'my_error_app'; run MyErrorApp) into the jruby.rack.error.app context parameter (e.g. in your web.xml with Warbler)
I ended up writing a rack middleware to handle the exception gracefully. I insert the middleware before MethodOverride middleware which is where it throws the exception.

Magento - Fatal error: Maximum function nesting level of '100' reached, aborting

I don't know what is causing this error. I was working on a custom module on my Magento store and didn't check the homepage of the store regularly. Out of the blue today I am getting this error on my homepage.
Fatal error: Maximum function nesting level of '100' reached, aborting! in C:\Program Files\EasyPHP-5.3.8.0\www\indieswebs\lib\Zend\Db\Adapter\Pdo\Mysql.php on line 1045
The funny thing is there is NO 1045 line number in this file! So I am guessing it's some sort of looping error. But I don't know what is causing it. Can anyone help me figure out what might be causing this particular error and how can I remove it?
Edit:I deleted the cache from the store and reloaded the homepage. The error has changed now. It says:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 261904 bytes) in C:\Program Files\EasyPHP-5.3.8.0\www\indieswebs\lib\Zend\Db\Select.php on line 281
Does anyone know how to resolve this?
The error only come when you installed xdebug.
Use following setting in php.ini
xdebug.max_nesting_level = 200
I was able to resolve a related issue (that causes the same error message) by checking the files in [webroot]/app/etc/
It was happening (on enterprise edition) because
config.xml
enterprise.xml
were missing from that directory. Once I put them back, that fixed this problem.
I also read elsewhere that a malformed local.xml might cause this issue.
On enterprise edition, use something like:
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[some_user]]></username>
<password><![CDATA[some_pass]]></password>
<dbname><![CDATA[database_name]]></dbname>
<active>1</active>
</connection>
</default_setup>
On CE, use something like:
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[your_user]]></username>
<password><![CDATA[your_pass]]></password>
<dbname><![CDATA[your_db]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
I got this in my Collection.php model, and the culprit turned out to be the call to parent::__construct(). Once I remmed it out the error went away. PS: Raising xdebug nesting level limit did not work.

Authlogic save causing 502 Bad Gateway error, Illegal Instruction in Rails console

I recently set up a new app server (Ruby 1.8.7 REE, Rails 2.3.8, Passenger 3.0.9, Nginx 1.0.6) behind a proxy and am encountering some strange behavior. When posting to /login on this app server alone, I get a 502 Bad Gateway error. This does not happen on the other app server, and both are set up identically. I've narrowed the problem down to a specific line of code - the saving of an Authlogic session. When I comment out these lines (specifically the save call):
#user_session = UserSession.new(params[:user_session])
if #user_session.save
...
the 502 error no longer occurs. Likewise, when I test these commands in the console, I get an Illegal Instruction response and the console crashes:
>> Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self)
>> #user_session = UserSession.new({"password"=>"password", "remember_me"=>"0", "login"=>"myuser"})
>> #user_session.save
Illegal instruction
Testing this on the other app server works just fine (console does not crash with Illegal Instruction result).
Any idea where to begin troubleshooting this? I see nothing of value in either the Rails logs or the Nginx logs.
Thanks.
Edit
The Illegal Instruction is occurring during a system call to digest.rb. The same thing happens whether I use the Ubuntu Ruby Enterprise Edition package or whether I compile it myself:
stat("/opt/ruby-enterprise-1.8.7-2011.12/lib/ruby/1.8/digest.rb", {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
open("/opt/ruby-enterprise-1.8.7-2011.12/lib/ruby/1.8/digest.rb", O_RDONLY) = 15
fstat(15, {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
close(15) = 0
--- SIGILL (Illegal instruction) # 0 (0) ---
This sounds like it's related to Ruby 1.9 Ramaze App Failing with “Illegal instruction”.
Jörg W Mittag said:
"Illegal instruction" is usually an error message from the CPU meaning some piece of binary code you tried to run contained an instruction that is not implemented on that particular CPU.
This can have multiple reasons:
The binary was compiled with optimization settings for the wrong CPU. The CPU vendors add new instructions all the time, if the compiler optimizes for a CPU that is newer than the one you have, it might have emitted an instruction that your CPU doesn't understand.
The compiler is broken.
The binary is corrupted.
The code you are compiling contains assembly code or intrinsics containing instructions that your CPU doesn't have.
The original question submitter Phil Kulak replied that he had found a stack overflow causing the error.

Weird rails error while loading the application

I am having this bizarre error and I don't know what to do.
This code runs fine on my development and staging machine but crashes on production.
All I have to do is load the page or call script/server to trigger the following error:
Error message:
interning empty string
Exception class:
ArgumentError
Full Stack trace: Code
Sorry for this short description, but this is all that i am able to show to you. =/
Thank you.
This could be because you have an invalid filename for a partial (a filename with two consecutive zeros).
For example
_partial..html.erb (invalid)
This blog post mentions this error:
http://anaphoral.blogspot.com/2009/04/rails-interning-empty-string.html

Resources