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

Running bin/setup leads to errors on Ruby 3.3.0 #43

Closed
5minpause opened this issue Jan 31, 2024 · 5 comments · Fixed by #67
Closed

Running bin/setup leads to errors on Ruby 3.3.0 #43

5minpause opened this issue Jan 31, 2024 · 5 comments · Fixed by #67
Assignees

Comments

@5minpause
Copy link

Hi.
I just wanted to start the development locally on my machine.
Running bin/setup leads to a

NoMethodError: undefined method `[]' for nil

Here's the complete trace:

Creating databases...
Dropped database 'db/development.sqlite3'
Database 'db/test.sqlite3' does not exist
Created database 'db/development.sqlite3'
Created database 'db/test.sqlite3'
Deleting existing jobs...
Generating 70 finished jobs for BC4 - resque_ashburn...
bin/rails aborted!
NoMethodError: undefined method `[]' for nil
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:41:in `dispatch_jobs'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:56:in `load_finished_jobs'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:24:in `block in load'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/resque/thread_safe_redis.rb:28:in `enable_with'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/resque/thread_safe_redis.rb:15:in `with_per_thread_redis_override'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/active_job/queue_adapters/resque_ext.rb:10:in `activating'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/mission_control/jobs/server.rb:18:in `activating'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:23:in `load'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:94:in `block (2 levels) in <top (required)>'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/mission_control/jobs/identified_elements.rb:7:in `each'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/mission_control/jobs/identified_elements.rb:7:in `each'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:93:in `block in <top (required)>'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/mission_control/jobs/identified_elements.rb:7:in `each'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/lib/mission_control/jobs/identified_elements.rb:7:in `each'
/Users/holgerfrohloff/projects/OSS/mission_control-jobs/test/dummy/db/seeds.rb:92:in `<top (required)>'

I used Ruby 3.3.0.
It worked (almost flawlessly) on Ruby 3.2.2.

@pmareke
Copy link
Contributor

pmareke commented Jan 31, 2024

Same here with the version 3.0.4 provided in the .ruby_version file.

PD: I also had to export the Redis port in the docker-compose.yml file in order to be able to run this command.

@pmareke
Copy link
Contributor

pmareke commented Jan 31, 2024

Apparently the error disappears commenting this line worker.work(0.0), both in the seeds.rb and application_system_test_case.rb files.

@lexcao
Copy link
Contributor

lexcao commented Jan 31, 2024

Hi @pmareke
Same for me with Ruby version 3.0.4.
And it works for me using Ruby version 3.2.2, you can have a try.

The actual error is as below when I use bin/rails db:reset --trace with trace logs

Caused by:
NoMethodError: undefined method `[]' for nil
/Users/clixin/.rubies/ruby-3.3.0/lib/ruby/3.3.0/logger.rb:384:in `level'
/Users/clixin/.rubies/ruby-3.3.0/lib/ruby/3.3.0/logger.rb:653:in `add'
/Users/clixin/.rubies/ruby-3.3.0/lib/ruby/3.3.0/logger.rb:691:in `debug'
/Users/clixin/.gem/ruby/3.3.0/gems/resque-2.6.0/lib/resque/logging.rb:8:in `log'
/Users/clixin/.gem/ruby/3.3.0/gems/resque-2.6.0/lib/resque/worker.rb:945:in `log_with_severity'
/Users/clixin/.gem/ruby/3.3.0/gems/resque-2.6.0/lib/resque/worker.rb:417:in `register_signal_handlers'
/Users/clixin/.gem/ruby/3.3.0/gems/resque-2.6.0/lib/resque/worker.rb:373:in `startup'
/Users/clixin/.gem/ruby/3.3.0/gems/resque-2.6.0/lib/resque/worker.rb:244:in `work'
/Users/clixin/apps/source/mission_control-jobs/test/dummy/db/seeds.rb:41:in `dispatch_jobs'

The nil code is

 @level_override[Fiber.current] || @level

There is the same error someone meets.
https://talk.jekyllrb.com/t/error-when-executing-bundle-install/8822

@pmareke
Copy link
Contributor

pmareke commented Jan 31, 2024

Thanks @lexcao, working with the 3.2.2 version!

@rosa rosa self-assigned this Feb 14, 2024
@rosa
Copy link
Member

rosa commented Feb 14, 2024

Hey @lexcao, thanks for the report! Looks like this might be due to resque/resque#1856, and in turn, fixed by steveklabnik/mono_logger#12. Going to bump Resque to get the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants