Project

General

Profile

Upgrading redmine server fails

Added by Peter Kövesdi 6 months ago

I have a working redmine instance on Debian 12:

root@redmine redmine# RAILS_ENV=production bin/about 

sh: 1: svn: not found
sh: 1: hg: not found
sh: 1: cvs: not found
sh: 1: bzr: not found
Environment:
  Redmine version                5.0.4.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux-gnu]
  Rails version                  6.1.7.3
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                sendmail
Redmine settings:
  Redmine theme                  Purplemine2-master (includes JavaScript)
SCM:
  Git                            2.39.2
  Filesystem                     
  Xitolite                       2.39.2
Redmine plugins:
  additional_tags                3.1.0-main
  additionals                    3.1.0-main
  custom_field_sql               2.6
  easy_gantt                     2.0
  redmine_custom_workflows       2.0.9
  redmine_git_hosting            6.0.1
  redmine_issue_dynamic_edit     0.9.1
  redmine_issues_tree            0.0.15
  redmine_latex_mathjax          0.3.0
  redmine_more_previews          5.0.8
  redmine_paste_as_wiki_tables   0.1.1
  redmine_wiki_lists             0.0.11
  view_customize                 3.4.1

Now apt shows me some pending upgrades:

root@redmine redmine# apt list --upgradable
Auflistung… Fertig
libpq5/stable-security 15.6-0+deb12u1 amd64 [aktualisierbar von: 15.5-0+deb12u1]
libruby3.1/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]
postgresql-15/stable-security 15.6-0+deb12u1 amd64 [aktualisierbar von: 15.5-0+deb12u1]
postgresql-client-15/stable-security 15.6-0+deb12u1 amd64 [aktualisierbar von: 15.5-0+deb12u1]
ruby-sanitize/stable-security 6.0.0-1.1+deb12u1 all [aktualisierbar von: 6.0.0-1.1]
ruby3.1-dev/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]
ruby3.1-doc/stable-security 3.1.2-7+deb12u1 all [aktualisierbar von: 3.1.2-7]
ruby3.1/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]

But when ever I try to upgrade one of these, I get a message from bundlerthat I shouldn't run it as root and I end up with a not working redmine: "We're sorry, but something went wrong.". But I can't run apt upgrade without root.
How can I track this error down or how can I update my system without destroying redmine?


Replies (11)

RE: Upgrading redmine server fails - Added by Peter Kövesdi 6 months ago

Ok, I got one step further by going into the redmine folder and running `bundle update`, which failed until I ran `sudo apt-get install libpq-dev`. After that, my redmine still works and the list of pending upgrades looks like this:

root@redmine ~# apt list --upgradable
Auflistung… Fertig
libruby3.1/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]
ruby-sanitize/stable-security 6.0.0-1.1+deb12u1 all [aktualisierbar von: 6.0.0-1.1]
ruby3.1-dev/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]
ruby3.1-doc/stable-security 3.1.2-7+deb12u1 all [aktualisierbar von: 3.1.2-7]
ruby3.1/stable-security 3.1.2-7+deb12u1 amd64 [aktualisierbar von: 3.1.2-7]

RE: Upgrading redmine server fails - Added by David from RedminePRO.com 6 months ago

Hello Peter, apt is the Ubuntu package manager and you need to use root privileges to run any apt commands.

For bundler , this is application-related and you need to switch to the local user to update the redmine application related packages, it is not recommended to use root for user for hosting any application.

David - https://redminepro.com/

RE: Upgrading redmine server fails - Added by Peter Kövesdi 6 months ago

Hey, thanks for Your help!

Yes, I know, that's why I wrote "But I can't run apt upgrade without root.". And I don't run bundler myself directly, apt runs it. So, how can I solve it? As said, I cannot run apt wihtout root, and apt runs bundler, seemingly as root.

RE: Upgrading redmine server fails - Added by Luis pc 5 months ago

Hello everyone, I have the same problem to keep the system up to date ,
is there any way to run apt-get distupgrade without broken the redmine installation?
( I tried to mark hold the packages redmine without lucky...)
Thanks and best regards

RE: Upgrading redmine server fails - Added by Peter Kövesdi 5 months ago

I have no solution, but the problem got worse: Now redmine already stops working after `bundle update`.

RE: Upgrading redmine server fails - Added by Holger Just 5 months ago

You may want to show your full error messages. With vague statements such as a "command failed", "the installation broke" or "Redmine stops", we can't help you. Please be very specific. What exactly do you see? Show verbatim error messages. What exactly does not work as you would expect (describe what you would expect to happen, show evidence of what happened instead).

Please also describe how you installed Redmine (from a Download, from the Debian packages, something else). When using the Debian packages, you might get better help when opening a Debian ticket for the package instead. In any case, please show exactly what you see.

RE: Upgrading redmine server fails - Added by Peter Kövesdi 5 months ago

For the first, I set some packages, suspicious of breaking redmine, on hold:

apt-mark hold libruby3.1 redmine redmine-pgsql ruby-actioncable ruby-actionmailbox ruby-actionmailer ruby-actionpack ruby-actiontext ruby-actionview ruby-activejob ruby-activemodel ruby-activerecord ruby-activestorage ruby-activesupport ruby-rack ruby-rails ruby-railties ruby-sanitize ruby3.1 ruby3.1-dev ruby3.1-doc 

RE: Upgrading redmine server fails - Added by Peter Kövesdi 5 months ago

Holger Just wrote in RE: Upgrading redmine server fails:

You may want to show your full error messages. With vague statements such as a "command failed", "the installation broke" or "Redmine stops", we can't help you.

I already posted the full error message: "We're sorry, but something went wrong.". Seems, redmine is the one that should be more specific.
In the `apt upgrade` proccess it's saying "Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine." Is this telling You something more than my original posting?

Please also describe how you installed Redmine (from a Download, from the Debian packages, something else).

Installed it mainly after this https://wiki.debian.org/Redmine

RE: Upgrading redmine server fails - Added by Holger Just 5 months ago

Peter Kövesdi wrote in RE: Upgrading redmine server fails:

I already posted the full error message: "We're sorry, but something went wrong.". Seems, redmine is the one that should be more specific.

That is the user-visible error in your browser. Of course, this will not include verbose details. As a server admin, you need to check the server logs, most importantly the redmine log file likely in /var/log/redmine/default/production.log and the error logs of your webserver, likely in /var/log/apache/error.log. Check there for errors and show the full log output.

In the `apt upgrade` proccess it's saying "Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine." Is this telling You something more than my original posting?

Please show the command you are running and its entire output.

In any case, you may be affected by #40802 which manifests when you update the builder gem on non-current Redmine version. The dependency was fixed in Redmine 5.1.3 and 5.0.9. See Redmine 5.1.3 and 5.0.9 released. It appears that Debian has not yet merged or backported the required fixes into their packages though. If that is the case, you may be able to apply the workaround described in #40921#note-1.

RE: Upgrading redmine server fails - Added by Peter Kövesdi 5 months ago

Holger Just wrote in RE: Upgrading redmine server fails:

Peter Kövesdi wrote in RE: Upgrading redmine server fails:
As a server admin, you need to check the server logs, most importantly the redmine log file likely in /var/log/redmine/default/production.log and the error logs of your webserver, likely in /var/log/apache/error.log.

Ok, thanks for being more specific where to look at. That's what I was asking for with "How can I track this error down". Next time, I come back to this problem, I'll do that.

In the `apt upgrade` proccess it's saying "Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine." Is this telling You something more than my original posting?

Please show the command you are running and its entire output.

For instance I ran `apt upgrade ruby-sanitize` and got the mentioned message from bundler. After restarting apache, I got the mentioned message in the browser.

In any case, you may be affected by #40802 which manifests when you update the builder gem on non-current Redmine version. The dependency was fixed in Redmine 5.1.3 and 5.0.9. See Redmine 5.1.3 and 5.0.9 released. It appears that Debian has not yet merged or backported the required fixes into their packages though. If that is the case, you may be able to apply the workaround described in #40921#note-1.

Ok, thanks for the links. I'll check them out, but must find the time to go into that again.

RE: Upgrading redmine server fails - Added by Luis pc 4 months ago

The workaround not works for me, in order to keep the system the up to date as much as possible , I have marked this packets as hold:

sudo apt-mark hold redmine redmine-sqlite redmine-mysql redmine-pgsql ruby ruby-actionpack-action-caching ruby-actionpack-xml-parser ruby-addressable ruby-bundler ruby-coderay ruby-commonmarker ruby-csv libruby3.1 ruby-task-list ruby-html-pipeline ruby-i18n ruby-jquery-rails ruby-mail ruby-marcel ruby-mini-magick ruby-mini-mime ruby-mocha ruby-net-ldap ruby-nokogiri ruby-rack ruby-rack-test ruby-rails ruby-rails-dom-testing ruby-rails-observers ruby-rbpdf ruby-redcarpet ruby-request-store ruby-rmagick ruby-roadie ruby-roadie-rails ruby-rotp ruby-rouge ruby-rqrcode ruby-sanitize ruby-zip

I don't like this solution but it's the only way that I've found it to running the apt upgrades running
til find a good solution (I have a auto-upgrade policies with unattende-upgrade daemon that I must to keep).

Thanks and best regards

    (1-11/11)