Zammad 6.3: can't access Rails console. ActiveRecord::AdapterNotSpecified

  • Used Zammad version: 6.3
  • Used Zammad installation type: docker-compose
  • Operating system: Ubuntu 22.04
  • Browser + version: Chrome latest

I could access the Rails console a couple days ago. I’m not sure what changed, but I started getting the following error today:

/usr/local/bundle/gems/railties-7.0.8.1/lib/rails/application/configuration.rb:352:in `database_configuration’: Could not load database configuration. No such file - [“config/database.yml”] (RuntimeError)

I ran some post installation script that I found in this post and now I’m getting the following error when trying to access the Rails console in the corresponding container:

/usr/local/bundle/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_handler.rb:261:in `resolve_pool_config’: database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)

Any help would be appreciated.

Hi,

from what I read in the error message, the file that defines the database connection, in the package installation located in /opt/zammad/config/ is missing.

Since you are using docker-compose, is it possible that you added a volume mount somewhere which is mouting over /opt/zammad and is not including the database.yml file needed?

Skip sorry but this is not a solution.

@1990eam the linked thread has rarely anything to do with your issues. It’s not even about a docker installation.

As per Command "rails c" failes with database error · Issue #412 · zammad/zammad-docker-compose · GitHub
please consult the documentation on how to actually execute rails commands in a docker environment correctly:
Install with Docker Compose — Zammad System Documentation documentation

No worries, I was not pointing out a solution :sweat_smile:

Since everything worked fine before I tried to find out if anything changed in his setup, since in the past I had similar issued of configuration files not being found within docker containers since a volume mount with an empty folder hid configurations files.

The problem in those scenarious is missing environments. We have a thread flying around here somewhere. The compose approach requires close monitoring and is not always a “just pull this thing”.

1 Like

Shouldn’t it be possible to set environmental variables in the compose itself?

I did not look into the docker setup since the company I work for does not use docker yet. But setting env with an .env file or within the compose file with

environment:
        - DEBUG=${DEBUG}

is standard behaviour in docker.

Anyway, I hope that @1990eam finds a solution in the docs you linked.

Of course, absolutely is!

1 Like

Did anything change tho with calling the console? Running and opening it works without issues but the console seems fairly different after updating and manipulating DB (which we only do this way as we are still setting up) does not work anymore. dbname.destroyAll or dbname.find etc seem to not work

We updated from 6.1 to 6.3

Please read the provided documentation further up in this thread and do not hijack them with different problems. No clue what you’re trying to achieve, but it seems very edge casy and may not be supported at all.