Project

General

Profile

Docker redmine instance intermittently returns error 500

Added by Max Jenkins 9 months ago

Hello.

I am hosting a docker container of a Redmine instance and MySQL database, deployed from a docker compose. Here’s my docker-compose.yml:

version: '3.1'

services:
redmine:
image: redmine:5.0.5
restart: always # ports: # - 8080:3000 #if you want to test without the proxy
depends_on:
- proxy
- db
environment:
VIRTUAL_HOST: **.**.***
REDMINE_DB_MYSQL: db
REDMINE_DB_PASSWORD: **
REDMINE_SECRET_KEY_BASE:
*
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: **
MYSQL_DATABASE: redmine
restart: unless-stopped
networks:
default:
name: nginx_network
This manages to start up, but after a while if I try to load the website I will get a 500 internal service error like so:

#on redmine container log
F, [2023-08-07T20:59:46.870179 #1] FATAL -- :

ActiveRecord::ConnectionNotEstablished (Access denied for user 'root'@'**.**.**.**' (using password: YES)):

app/models/setting.rb:280:in `check_cache'

app/controllers/application_controller.rb:102:in `user_setup'

#on website
Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Back
Here's my information tab on the website:
Environment:
Redmine version 5.0.5.stable
Ruby version 3.1.4-p223 (2023-03-30) [x86_64-linux]
Rails version 6.1.7.2
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
Redmine settings:
Redmine theme Default
SCM:
Subversion 1.14.2
Mercurial 6.3.2
Bazaar 3.3.2
Git 2.39.2
Filesystem
Redmine plugins:
no plugin installed

Generally if I refresh the page a couple of times it starts working again. Sometimes the issue doesn’t come up.
There’s nothing configured other than the docker compose, the container is connected to a network using Nginx proxy manager which manages the website hosting.

Is there a change I could make in the docker compose which would stop this from happening? It seems like the host just needs to wait a short time or something, since refreshing the page usually fixes the problem.
Apologies for any obvious mistakes, i’m new to redmine.