containers icon indicating copy to clipboard operation
containers copied to clipboard

[bitnami/redmine] Plugins management issue

Open tameroski opened this issue 1 year ago • 0 comments

Name and Version

bitnami/redmine:5

What architecture are you using?

amd64

What steps will reproduce the bug?

I'm using the docker-compose.yml file provided in the repository.

If I put plugins in the redmine_data/plugins folder, I get an error on docker compose up :

mariadb_redmine  | 2024-02-21 14:38:15 0 [Note] mysqld: Event Scheduler: Loaded 0 events
mariadb_redmine  | 2024-02-21 14:38:15 0 [Note] /opt/bitnami/mariadb/sbin/mysqld: ready for connections.
mariadb_redmine  | Version: '11.2.3-MariaDB'  socket: '/opt/bitnami/mariadb/tmp/mysql.sock'  port: 3306  Source distribution
mariadb_redmine  | 2024-02-21 14:38:15 0 [Note] InnoDB: Buffer pool(s) load completed at 240221 14:38:15
redmine          | redmine 14:38:17.46 INFO  ==> Executing database migrations
redmine exited with code 1

It's working just fine without the plugins.

It looks like the database has to be updated for the plugin installation to work :

bundle exec rake redmine:plugins:migrate RAILS_ENV=production

So if I start the Redmine container, copy the plugins files afterward, and run this command into the Redmine container, it works fine and I can use the plugins in my Redmine instance. The problem is I'll have to do that again each time I rebuild the container, let's say after an image update for exemple.

I'm not very familiar with docker yet, but a solution would be to automate that with a Dockerfile, i guess :

FROM docker.io/bitnami/redmine:5

ENV REDMINE_WORK_PATH=/opt/bitnami/redmine
ENV REDMINE_SHARED_PATH=/bitnami/redmine

# Copy plugins we want to use to shared dir
WORKDIR ${REDMINE_SHARED_PATH}
ADD assets/plugins ./plugins/

WORKDIR ${REDMINE_WORK_PATH}

# Install plugins an restart
RUN bundle config set frozen false && bundle install
RUN bundle exec rake redmine:plugins:migrate RAILS_ENV=production
RUN bundle exec rake restart

But then I get the error below on the redmine:plugins:migrate command

So I might be missing something or there's a bug somewhere. How am I supposed to manage plugin installation and persistence?

What do you see instead?

=> [redmine 2/7] WORKDIR /bitnami/redmine                                                                                                                                                                                                                                   2.5s
 => [redmine 3/7] ADD assets/plugins ./plugins/                                                                                                                                                                                                                              2.9s
 => [redmine 4/7] WORKDIR /opt/bitnami/redmine                                                                                                                                                                                                                               1.4s
 => [redmine 5/7] RUN bundle config set frozen false && bundle install                                                                                                                                                                                                       6.3s
 => ERROR [redmine 6/7] RUN bundle exec rake redmine:plugins:migrate RAILS_ENV=production                                                                                                                                                                                    6.1s
------
 > [redmine 6/7] RUN bundle exec rake redmine:plugins:migrate RAILS_ENV=production:
#0 4.902 rake aborted!
#0 4.902 ActiveRecord::ConnectionNotEstablished: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:45:in `rescue in new_client'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:39:in `new_client'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
#0 4.902 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
...
#0 4.902 Caused by:
#0 4.902 Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
#0 4.903 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `connect'
#0 4.903 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:97:in `initialize'
#0 4.903 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new'
#0 4.903 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in `new_client'
#0 4.903 /opt/bitnami/redmine/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in `mysql2_connection'

tameroski avatar Feb 21 '24 15:02 tameroski