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 #354

Open
charlesmulder opened this issue Dec 18, 2024 · 7 comments
Open

Comments

@charlesmulder
Copy link

Hi

I'm getting the following mysql2 gem related error when running Redmine via docker compose.

I've searched the issues, but couldn't find anything. I must be missing something obvious. Any advice is much appreciated.

Thank you.

Unknown database adapter `"mysql2"` found in config/database.yml, use Gemfile.local to load your own database gems
redmine-1  | rake aborted!
redmine-1  | 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)

Here is my docker-compose.yaml file.

services:                                                                                                                                                  
                                                                                                                                                           
  redmine:                                                                                                                                                 
    image: redmine:6                                                                                                                                       
    ports:                                                                                                                                                 
      - 8080:3000                                                                                                                                          
    environment:                                                                                                                                           
      REDMINE_DB_MYSQL: db                                                                                                                                 
      REDMINE_DB_USERNAME: redmine                                                                                                                         
      REDMINE_DB_PASSWORD: secret                                                                                                                          
      REDMINE_SECRET_KEY_BASE: supersecret                                                                                                                 
                                                                                                                                                           
  db:                                                                                                                                                      
    image: mysql:8.0                                                                                                                                       
    environment:                                                                                                                                           
      MYSQL_DATABASE: redmine                                                                                                                              
      MYSQL_USER: redmine                                                                                                                                  
      MYSQL_PASSWORD: secret                                                                                                                               
      MYSQL_ALLOW_EMPTY_PASSWORD: true
@hempalex
Copy link

Same error after pulling redmine:6.0.2

My docker-compose.yml

  redmine:
    image: redmine:6
    depends_on:
      - redmine-db
    ports:
     3000:3000
    environment:
      REDMINE_DB_MYSQL: redmine-db
      REDMINE_DB_USERNAME: ${MYSQL_USER}
      REDMINE_DB_PASSWORD: ${MYSQL_PASSWORD}
      REDMINE_DB_DATABASE: ${MYSQL_DATABASE}
      REDMINE_PLUGINS_MIGRATE: true

  redmine-db:
    image: mariadb:10.11
    environment:
      MYSQL_ROOT_USER: ${MYSQL_ROOT_USER}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}

@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

@eingemaischt
Copy link

Does anyone has a workaround or the last tag that worked for me? I was using :5 as tag, too. Unfortunately dockerhub does not provide a history for tags and their images...

@hempalex
Copy link

Does anyone has a workaround or the last tag that worked for me? I was using :5 as tag, too. Unfortunately dockerhub does not provide a history for tags and their images...

redmine:6.0.1 works

@eingemaischt
Copy link

I did not migrate to 6 yet.

Nevertheless, I catched a database.yml from the container, added it on the host, edited "mysql2" to mysql2 and then mounted it as volume.

After that redmine started again. Thank you! ;-)

@hempalex
Copy link

I would rather use redmine:5.1.4 tag and wait for the fix

@LeeThompson
Copy link

LeeThompson commented Dec 18, 2024

This broke me as well. This type of issue should not happen in any production release.

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