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

Unknown database adapter "mysql2" found in config/database.yml, use Gemfile.local to load your own database gems #353

Open
thejulian opened this issue Dec 18, 2024 · 6 comments

Comments

@thejulian
Copy link

Since 5.1.5 the container won't start. I guess the reason are the changes in the Gemfile:58 for the adapters.
5.1.4 works just fine with the same docker run command.

docker run command

docker run --name redmine -e REDMINE_DB_MYSQL=redminedb -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=password -e REDMINE_DB_DATABASE=redmine --link redminedb redmine:5.1.5

Error log

Unknown database adapter `"mysql2"` found in config/database.yml, use Gemfile.local to load your own database gems
Your Gemfile lists the gem puma (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
The Gemfile's dependencies are satisfied
Unknown database adapter `"mysql2"` found in config/database.yml, use Gemfile.local to load your own database gems
Unknown database adapter `"mysql2"` found in config/database.yml, use Gemfile.local to load your own database gems
rake aborted!
LoadError: Error loading the 'mysql2' Active Record adapter. Missing a gem it depends on? mysql2 is not part of the bundle. Add it to your Gemfile. (LoadError)
/usr/local/bundle/gems/activerecord-6.1.7.10/lib/active_record/connection_adapters/mysql2_adapter.rb:6:in `<top (required)>'
@hectorm
Copy link

hectorm commented Dec 18, 2024

This is due to a recent upstream change regarding the parsing of the database.yml file: https://www.redmine.org/issues/41749#note-14

@drexlma
Copy link

drexlma commented Dec 18, 2024

Workaround, remove " in config/database.yml:

Change

 production:
  adapter: "mysql2"

to

production:
  adapter: mysql2

@LeeThompson
Copy link

LeeThompson commented Dec 18, 2024

I've tried mounting my own external config/database.yml but it's not reading it.

To fix this properly the entrypoint.sh script needs to not quote the adapter variable as it writes the database.yml file.

@MadTiago
Copy link

Having the same issue when trying to update to v6.

@LeeThompson
Copy link

I spent some time trying to get a corrected yml mounted for the container and never got it to read it. This is major fumble for Redmine. I know it's due to a "up the chain" issue but it's like it wasn't even tested.

I'm not sure what database changes there have been made so I'm not in a rush to downgrade but currently it can't run so I guess nothing vs something?

Really disappointed in Redmine for letting this hit us.

@thejulian
Copy link
Author

thejulian commented Dec 19, 2024

@LeeThompson
The breaking changes happened with the modifications in Redmine 5.1.5 and 6.0.2.
Redmine 5.1.4 and 6.0.1 are working.

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

No branches or pull requests

5 participants