Cannot access rails console

Infos:

  • Used Zammad version: 4.0.x
  • Used Zammad installation type: (source, package, docker-compose, …) package
  • Operating system: Debian 10
  • Browser + version: n/a

Expected behavior:

  • When zammad run rails c is run on terminal, interactive console should be opened

Actual behavior:

  • The error below is shown and console doesn’t open:
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': libreadline.so.7: cannot open shared object file: No such file or directory - /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/x86_64-linux/readline.so (LoadError)

Steps to reproduce the behavior:

  • Entering zammad run rails c on terminal.

Greetings,
I suspect this is issue is not directly related to zammad installation but the system-wide packages rails may need, so I didn’t post on github issues. Here is the full output:

Traceback (most recent call last):
        42: from /opt/zammad/bin/rails:9:in `<main>'
        41: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `require'
        40: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:257:in `load_dependency'
        39: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `block in require'
        38: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        37: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        36: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        35: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        34: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        33: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/commands.rb:18:in `<main>'
        32: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command.rb:44:in `invoke'
        31: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command.rb:70:in `find_by_namespace'
        30: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command/behavior.rb:79:in `lookup'
        29: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command/behavior.rb:79:in `each'
        28: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command/behavior.rb:80:in `block in lookup'
        27: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command/behavior.rb:80:in `each'
        26: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/command/behavior.rb:84:in `block (2 levels) in lookup'
        25: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `require'
        24: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:257:in `load_dependency'
        23: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `block in require'
        22: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        21: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        20: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        19: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        18: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        17: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/railties-5.2.4.6/lib/rails/commands/console/console_command.rb:4:in `<main>'
        16: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `require'
        15: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:257:in `load_dependency'
        14: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `block in require'
        13: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        12: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        11: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        10: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
         9: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
         8: from /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/irb/completion.rb:10:in `<main>'
         7: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `require'
         6: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:257:in `load_dependency'
         5: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.6/lib/active_support/dependencies.rb:291:in `block in require'
         4: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
         3: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
         2: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
         1: from /opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/opt/zammad/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require': libreadline.so.7: cannot open shared object file: No such file or directory - /opt/zammad/vendor/ruby-2.6.6/lib/ruby/2.6.0/x86_64-linux/readline.so (LoadError)

I am trying to access the console in order to delete test organizations etc on production installation. I am using the instructions in the guide below:

https://docs.zammad.org/en/latest/admin/console.html#start-zammad-s-rails-console

Here is some of the most recent commands I used trying to fix the problem:

tail -f /var/log/zammad/production.log
zammad run rails c
zammad run rails c
rails c
rails
zammad run rails c
RAILS_ENV=production
zammad run rails c
RAILS_ENV=production rails c
zammad run rails r ‘Setting.get(‘system_bcc’}’
zammad run rails r 'Setting.get('system_bcc'}'
zammad run rails r "Setting.get('system_bcc'}"
zammad run rails r 'Setting.get("system_bcc"}'
zammad run rails r 'Setting.get("system_bcc")'
zammad run rails p r 'Setting.get("system_bcc")'
zammad run rails r 'p Setting.get("system_bcc")'
zammad run rails r 'p Delayed::Job.count'
zammad run rails c
zammad run rails r 'p Setting.get('fqdn)'
zammad run rails r 'p Setting.get("fqdn")'
rails
whereis rails
zammad run /opt/zammad/bin/rails c
/opt/zammad/bin/rails
gem env
ruby -v
gem install rails
ls
less /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/websocket-driver-0.7.5/gem_make.out
sudo find / -name rails*
find / -name rails*
/opt/zammad/bin/rails c
bundle update --bundler
gem install bundler:1.17.3
/opt/zammad/bin/rails c
zammad run rails c
bundle env
head -n1 $(which bundle)
rbenv rehash
where rbenv
sudo find / -name rbenv*
zammad run rails c
RAILS_ENV=production rails console
RAILS_ENV=production; rails console
zammad run rails r 'p Setting.get("fqdn")'
zammad run rails r 'p Ticket.destroy_all'

I do realize some of them are irrelevant, but I may have made it worse by installing irrelevant packages (such as conflicting version of rails etc.)

Non-interactive commands work just fine, I was able to delete all tickets for example. I can also use it with p and it shows the output of operations, however I’d like to have interactive console as well.

I also installed libreadline-dev. I may need some linking, but I am stuck. Any help is appreciated.

Thanks in advance and big kudos for the awesome software :slight_smile:

Oh wow that’s a lot of hot stuff there.
First of all: Package installations to ship their environment.

This means additional ruby or other dependency versions are not required at all and may even strike your way (possibly, shouldn’t but you never know).

The installed ruby versions do not fit too (if you really must install manually see: Software — Zammad documentation)

As packages provide their ruby versions, a normal update to the latest possible, stable Zammad version could possibly fix your issue already.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.