gpt4 book ai didi

ruby-on-rails - SystemStackError : stack level too deep - sql. 事件记录?

转载 作者:数据小太阳 更新时间:2023-10-29 08:12:13 24 4
gpt4 key购买 nike

我遇到了一个真正的大问题。我的应用程序正在执行几千个 SQL 查询,然后突然出现此错误。如果我通过 rake 任务或直接通过 Rails 控制台执行我的代码,这没有什么不同。

谁知道这是什么意思?从未见过与 Rails 记录器相关的此错误。

环境:
ruby-2.1.2
Postgres 9.3
rails 4.1.5

Could not log "sql.active_record" event. SystemStackError: stack level too deep ["/Users  /ghostrifle/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.5/lib/active_support/tagged_logging.rb:46"]
SystemStackError: stack level too deep
from /Users/ghostrifle/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/irb/workspace.rb:86
Maybe IRB bug!

异常在 23 个调用者之后引发。

这是对 SystemStackError 异常的检查

[
"/Users/ghostrifle/Entwicklung/xxx_main/lib/tasks/tree_spot.rake:42:in `block (2 levels) in <top (required)>'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'",
"/Users/ghostrifle/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/bin/rake:23:in `load'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/bin/rake:23:in `<main>'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'",
"/Users/ghostrifle/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'"
]

最佳答案

能否请您显示导致此问题的代码。根据我的理解,您正在保留一个堆栈,您正在向其中添加从数据库中获取的数据,但也许您没有将其初始化为 []。因此,每次运行代码时,数据都会堆积起来,最终会导致此问题。

关于ruby-on-rails - SystemStackError : stack level too deep - sql. 事件记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25596713/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com