Has 500 Internal Server Error when upgrade 4.1.1 to 4.2.7, please help.

Added by Terence Lien 2 months ago

I try to upgrade OS and Redmine from 4.1.1 to 4.2.7
I had make sure that pure 4.2.7 could run normally on new env.,
after migrate DB from 4.1.1 to 4.2.7, shows 500 Internal Server Error when I click issues or admin/Settings,
I found the Error message from log file as below:

I, [2022-07-28T05:22:11.006290 #7295]  INFO -- : Completed 500 Internal Server Error in 299ms (ActiveRecord: 27.8ms)
F, [2022-07-28T05:22:11.008956 #7295] FATAL -- :   
F, [2022-07-28T05:22:11.009091 #7295] FATAL -- : Psych::DisallowedClass (Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess):
F, [2022-07-28T05:22:11.009149 #7295] FATAL -- :   
F, [2022-07-28T05:22:11.009277 #7295] FATAL -- : app/models/custom_field.rb:221:in `full_width_layout?'
app/models/query.rb:134:in `initialize'
app/models/issue_query.rb:256:in `new'
app/models/issue_query.rb:256:in `block in available_columns'
app/models/issue_query.rb:256:in `collect'
app/models/issue_query.rb:256:in `available_columns'
app/models/query.rb:766:in `groupable_columns'
app/models/query.rb:914:in `group_by_column'
app/models/query.rb:1003:in `statement'
app/models/issue_query.rb:324:in `base_scope'
app/models/issue_query.rb:329:in `issue_count'
app/controllers/issues_controller.rb:51:in `block (2 levels) in index'
app/controllers/issues_controller.rb:49:in `index'
lib/redmine/sudo_mode.rb:61:in `sudo_mode'
  • My migration steps:
    1. dump DB from 4.1.1 Server,
       sudo mysqldump -u root redmine | gzip > DBbackup.gz 
    2. restore DB to 4.2.7 Server,
       sudo gunzip -c DBbackup.gz | mysql -u root redmine 
    3. excute command
      sudo bundle exec rake generate_secret_token
      sudo bundle exec rake db:migrate RAILS_ENV=production
      sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production
      sudo service apache2 restart
      
  • Orign Env.Ubuntu 18.04.6 LTS
    Environment: 
      Redmine version                4.1.1.stable
      Ruby version                   2.5.1-p57 (2018-03-29) [x86_64-linux-gnu]
      Rails version                  5.2.4.2
      Environment                    production
      Database adapter               Mysql2
      Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
      Mailer delivery                smtp
    SCM:
      Subversion                     1.9.7
      Mercurial                      4.5.3
      Cvs                            1.12.13
      Bazaar                         2.8.0
      Git                            2.17.1
      Filesystem                     
    Redmine plugins:
      external_links_in_new_window   0.9
      redmine_closed_date            0.1.1
      redmine_custom_workflows       1.0.4
      redmine_dmsf                   2.4.5
      redmine_hearts                 2.0.1
      redmine_issue_templates        1.1.0
      redmine_issues_panel           0.0.4
      redmine_logs                   0.2.0
      redmine_mermaid_macro          1.0.0
      redmine_message_customize      0.1.0
      redmine_status_report          1.0.0
      redmine_theme_changer          0.4.0
      redmine_wysiwyg_editor         0.18.0
      redmine_xlsx_format_issue_exporter 0.1.6
    
  • New Env. Ubuntu 20.04.4
    Environment: 
      Redmine version                4.2.7.stable
      Ruby version                   2.7.0-p0 (2019-12-25) [x86_64-linux-gnu]
      Rails version                  5.2.8
      Environment                    production
      Database adapter               Mysql2
      Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
      Mailer delivery                smtp
    SCM:
      Subversion                     1.13.0
      Mercurial                      5.3.1
      Cvs                            1.12.13
      Bazaar                         3.0.2
      Git                            2.25.1
      Filesystem                     
    Redmine plugins:
      external_links_in_new_window   0.9
      redmine_closed_date            0.1.1
      redmine_custom_workflows       2.0.4
      redmine_dmsf                   3.0.3
      redmine_hearts                 2.1.1
      redmine_issue_templates        1.1.0
      redmine_issues_panel           0.0.5
      redmine_logs                   0.3.0
      redmine_mermaid_macro          1.0.1
      redmine_message_customize      0.1.5
      redmine_status_report          1.0.0
      redmine_theme_changer          0.6.0
      redmine_wysiwyg_editor         0.27.0
      redmine_xlsx_format_issue_exporter 0.1.7
    

Replies (3)

RE: Has 500 Internal Server Error when upgrade 4.1.1 to 4.2.7, please help. - Added by Terence Lien 2 months ago

Go MAEDA wrote:

Could you try replacing the file config/application.rb with the one downloadable from the following page?

https://www.redmine.org/projects/redmine/repository/revisions/21721/diff/branches/4.2-stable/config/application.rb

Thanks Go MAEDA. :)
I had try it but still not work, then...

I have no idea why, I reinstall OS, Ubuntu 20.04.4
and follow the steps, it's work.. wish can help others who have the same issue. :)

  1. Install apt packages
    sudo apt -y update
    sudo apt -y upgrade
    sudo apt -y autoremove
    sudo apt install -y checkinstall gem libreoffice apache2 libapache2-mod-passenger ruby ruby-dev rails libmysqlclient-dev libmagickwand-dev libapr1-dev libxslt1-dev libxml2-dev mysql-server imagemagick git subversion darcs mercurial cvs bzr 
    sudo apt install -y gcc build-essential zlib1g zlib1g-dev zlibc ruby-zip libssl-dev libyaml-dev libcurl4-openssl-dev apache2-dev libsqlite3-dev phpmyadmin
    sudo apt install -y xapian-omega ruby-xapian libxapian-dev poppler-utils antiword  unzip catdoc libwpd-tools libwps-tools gzip unrtf catdvi djview djview3 uuid uuid-dev xz-utils libemail-outlook-message-perl
    sudo gem update --system 3.1.3
    sudo gem install bundler
    sudo gem install arel thread_safe mail  rails-dom-testing
    
  2. Import Old DB
  3. Config database.yml
  4. Install Redmine 4.2.7
    sudo bundle install --without development test
    sudo bundle update
    
  5. Download Plugins
  6. Install Plugins
    sudo chown -R www-data:www-data /opt/redmine
    cd /opt/redmine/
    sudo bundle install
    sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production
    
  7. Config Apache2 config
  8. Restart Apache
    sudo service apache2 restart
    
  9. Working good...

RE: Has 500 Internal Server Error when upgrade 4.1.1 to 4.2.7, please help. - Added by Terence Lien 2 months ago

BTW,
I found 1 issue will cause Internal Erro 500, if execute

 sudo gem update
after
 sudo gem update --system 3.1.3 

I had reproduce this issue serval times.

Just noted.

(1-3/3)