How to run raisl commands in docker

  • Used Zammad version: 6.3.0
  • Used Zammad installation type: docker-compose
  • Operating system: Windows

Expected behavior:

I expect to go into the zammad-railsserver-1 container.
Then run rails c (zammad rails c doesnt work)
and then i could run something like Ticket::State.all.pluck(:name)

Actual behavior:

in the railscontainer running rails c and getting error:

zammad@280a551a6fc1:~$ rails c
/usr/local/bundle/gems/railties-7.0.8.1/lib/rails/application/configuration.rb:352:in database_configuration': Cannot load database configuration: (RuntimeError) Could not load database configuration. No such file - ["config/database.yml"] from /usr/local/bundle/gems/activerecord-7.0.8.1/lib/active_record/railtie.rb:266:in block (2 levels) in class:Railtie
from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:95:in class_eval' from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:95:in block in execute_hook’
from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:85:in with_execution_control' from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:90:in execute_hook’
from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:60:in block in on_load' from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:59:in each’
from /usr/local/bundle/gems/activesupport-7.0.8.1/lib/active_support/lazy_load_hooks.rb:59:in on_load' from /usr/local/bundle/gems/activerecord-7.0.8.1/lib/active_record/railtie.rb:262:in block in class:Railtie
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/initializable.rb:32:in instance_exec' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/initializable.rb:32:in run’
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/initializable.rb:61:in block in run_initializers' from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in block in tsort_each’
from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in block (2 levels) in each_strongly_connected_component' from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in each_strongly_connected_component_from’
from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in block in each_strongly_connected_component' from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in each’
from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in call' from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in each_strongly_connected_component’
from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in tsort_each' from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in tsort_each’
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/initializable.rb:60:in run_initializers' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/application.rb:372:in initialize!’
from /opt/zammad/config/environment.rb:7:in <main>' from /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require’
from /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /usr/local/bundle/gems/zeitwerk-2.6.13/lib/zeitwerk/kernel.rb:34:in require’
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/application.rb:348:in require_environment!' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/command/actions.rb:28:in require_environment!’
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/command/actions.rb:15:in require_application_and_environment!' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/commands/console/console_command.rb:105:in perform’
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in run' from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in invoke_command’
from /usr/local/bundle/gems/thor-1.3.1/lib/thor.rb:527:in dispatch' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/command/base.rb:87:in perform’
from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/command.rb:48:in invoke' from /usr/local/bundle/gems/railties-7.0.8.1/lib/rails/commands.rb:18:in
from /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' from /usr/local/bundle/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require’
from bin/rails:5:in `’

I´m not sure if that is the way to go. I hope anyone could show me some assistance.
With the 6.2x version i could access rails c without error

Please check out: Install with Docker Compose — Zammad System Documentation documentation

thank you. I think the docu was updatd shortly. It works as the docu states. Anyway is this error than not relevant ?

The error is not relevant.

Before Zammad 6.2, you were able to get into the container with other methods as well, but then environment variables were missing as well. Zammad 6.2 would not throw an error then, but it also did not have a database present due to the missing ENV variables (nulldb was used instead). So it also did not work, but it was less obvious.

Ok thank you very mutch. This could be closed now.
All of my statements are working now