Project

General

Profile

internal server error after moving the docker container to another server

Added by L L over 1 year ago

hi,

I wanted to move a redmine docker-compose installation to another server.
The source server is running redmine 5.0.5 with postgresql, so I created a docker-compose file on the new server:

version: '3'

services:
  redmine:
    image: redmine:5
    container_name: redmine
    restart: always
    environment:
      - REDMINE_DB_POSTGRES=postgres
      - REDMINE_DB_DATABASE=redmine
      - REDMINE_DB_USERNAME=redmine
      - REDMINE_DB_PASSWORD=topsecret
      - REDMINE_DB_ENCODING=utf8
    depends_on:
      - 'postgres'
    volumes:
      - ./redmine:/usr/src/redmine/files
      - ./redmine-config:/usr/src/redmine/config
      - ./redmine-plugins:/usr/src/redmine/plugins
    ports:
      - '3000:3000'

  postgres:
    image: postgres:14
    container_name: postgres
    restart: always
    volumes:
      - ./postgres:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=redmine
      - POSTGRES_USER=redmine
      - POSTGRES_PASSWORD=topsecret

First I started up only the database and imported the dump form the old db.
Then I rsyncd the three directories:
rsync -avz redmine root@newserver:/docker/redmine
rsync -avz redmine-config root@newserver:/docker/redmine
rsync -avz redmine-plugins root@newserver:/docker/redmine

after that I adjusted the database.yml

I can start redmine just fine, but most sites print "internal server error", for example the register page. I get this errors, but they're not really helpful for me :)

redmine | I, [2023-06-26T11:52:36.510584 #1] INFO -- : Started GET "/account/register" for 192.168.1.1 at 2023-06-26 11:52:36 +0000
redmine | I, [2023-06-26T11:52:36.512287 #1] INFO -- : Processing by AccountController#register as HTML
redmine | I, [2023-06-26T11:52:36.517499 #1] INFO -- : Current user: anonymous
redmine | I, [2023-06-26T11:52:36.527451 #1] INFO -- : Rendered account/register.html.erb within layouts/base (Duration: 7.4ms | Allocations: 4309)
redmine | I, [2023-06-26T11:52:36.527517 #1] INFO -- : Rendered layout layouts/base.html.erb (Duration: 7.5ms | Allocations: 4337)
redmine | I, [2023-06-26T11:52:36.527736 #1] INFO -- : Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.7ms | Allocations: 5673)
redmine | F, [2023-06-26T11:52:36.528619 #1] FATAL -- :
redmine | ActionView::Template::Error (undefined method `map' for nil:NilClass
redmine |
redmine | class_loader = ClassLoader::Restricted.new(permitted_classes.map(&:to_s),
redmine | ^^^^):
redmine | 9:
redmine | 10: <p><%= f.password_field :password, :size => 25, :required => true %>
redmine | 11: <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em>
redmine | 12: <% if Setting.password_required_char_classes.any? %>
redmine | 13: <em class="info"><%= l(:text_characters_must_contain, :character_classes => Setting.password_required_char_classes.collect{|c| l("label_password_char_class_#{c}")}.join(", ")) %></em>
redmine | 14: <% end %>
redmine | 15: </p>
redmine |
redmine | app/models/setting.rb:111:in `value'
redmine | app/models/setting.rb:125:in `[]'
redmine | app/models/setting.rb:320:in `password_required_char_classes'
redmine | app/views/account/register.html.erb:12
redmine | app/helpers/application_helper.rb:1483:in `labelled_form_for'
redmine | app/views/account/register.html.erb:3
redmine | lib/redmine/sudo_mode.rb:61:in `sudo_mode'