Error when testing Ares in Docker

After installing docker and setting up Ares, I get the following error when running /bin/startares:

2023-03-23 19:04:17 ERROR - Error in Updating game info with AresCentral.: client= error=undefined method `api_game_id’ for nil:NilClass

 !!Game.master.api_game_id
              backtrace=["/ares/aresmush/plugins/arescentral/public/arescentral_api.rb:33:in `is_registered?'", "/ares/aresmush/plugins/arescentral/events/game_started_event_handler.rb:7:in `block in on_event'", "/ares/aresmush/engine/aresmush/error_block.rb:6:in `with_error_handling'", "/ares/aresmush/plugins/arescentral/events/game_started_event_handler.rb:5:in `on_event'", "/ares/aresmush/engine/aresmush/commands/dispatcher.rb:127:in `block (2 levels) in on_event'", "/ares/aresmush/engine/aresmush/error_block.rb:6:in `with_error_handling'", "/ares/aresmush/engine/aresmush/commands/dispatcher.rb:119:in `block in on_event'", "/ares/aresmush/engine/aresmush/commands/dispatcher.rb:117:in `each'", "/ares/aresmush/engine/aresmush/commands/dispatcher.rb:117:in `on_event'", "/ares/aresmush/engine/aresmush/commands/dispatcher.rb:32:in `block (2 levels) in queue_event'"] 

As I’m just testing, I’d rather not have my game registered with AresCentral, and I have no idea what any of this means since I’m not that knowledgeable in Ruby.

All games are registered with AresC, even test games. They’re just not public until you make them so.

The problem isn’t related to AresC though - it sounds like maybe your Game instance wasn’t initialized. Did you run these two steps from the docker instructions? Were there any errors?

 bundle exec rake configure $*
      - Use 127.0.0.1 for the host
      - Use default ports (this setup will not work with different ports)
      - Ignore the warning about the web portal directory not being found - that's OK.
    bundle exec rake init

I did both the steps in the initial setup.

Maybe try running the bundle exec rake init again, because it looks like there may have been an error setting up the initial game instance. (and possibly other things).

Note: This will wipe out the other things in your database, but I’m guessing by the nature of the error you would not have been able to create anything.

Also, not related to the problem you’re having but still important: you don’t start the game with bin/startares in the docker, but per the docker instructions you should use :

 cd aresmush
    bundle install
    bundle exec rake startares[disableproxy]

I noticed the following when running the initial setup, and I’m also struggling with successful initiation following the docker instructions:

rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /ares/aresmush/game/config/database.yml

I manually created the config directory, and then re-ran bundle exec rake configure $*bundle, and I was able to generate the expected yml files.

However, I received the following on bundle exec rake init. I think I’m missing logger configuration that wasn’t generated.

ares@e789cde0443d:/ares/aresmush$ bundle exec rake init --trace
** Invoke init (first_time)
** Execute init
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass

      decode_pre_config( cfg['pre_config'])
                            ^^^^^^^^^^^^^^
/home/ares/.rvm/gems/ruby-3.1.2/gems/log4r-1.1.10/lib/log4r/yamlconfigurator.rb:67:in `decode_yaml'
/ares/aresmush/engine/aresmush/logger.rb:11:in `start'
/ares/aresmush/rakefile.rb:16:in `minimal_boot'
/ares/aresmush/rakefile.rb:72:in `block in <top (required)>'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'       
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:194:in `synchronize'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'  
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'    
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/home/ares/.rvm/gems/ruby-3.1.2/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/home/ares/.rvm/gems/ruby-3.1.2/bin/rake:25:in `load'
/home/ares/.rvm/gems/ruby-3.1.2/bin/rake:25:in `<main>'
/home/ares/.rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `eval'
/home/ares/.rvm/gems/ruby-3.1.2/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => init```

Trace points to:

9 config = Global.read_config(“logger”)
10 configurator = Log4r::YamlConfigurator
11 configurator.decode_yaml config

My hunch about the missing logger.yml file seems accurate, I’m having trouble locating a good example one.

And just realized, I opened this on a March forum from last year.