package redmine 3.2.1-2 fails to upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1621845 reported by Arne Ruhe
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
redmine (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

SYMPTOM:
dpkg-configure fails when updating redmine to version 3.2.1-2 (Ubuntu 16.04) due to a missing Gemfile.lock in /var/lib/redmine/
Gemfile.lock does exist, but is locates at /usr/share/redmine/

ERROR (same error as when using apt update):
$ sudo dpkg --configure redmine
Setting up redmine (3.2.1-2) ...
chown: cannot access '/var/lib/redmine/Gemfile.lock': No such file or directory
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine

Revision history for this message
Kenric Lam (kenric-lam) wrote :

I have the same problem.

$sudo dpkg --configure redmine
Setting up redmine (3.2.1-2) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
chown: cannot access '/var/lib/redmine/Gemfile.lock': No such file or directory
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

Even though I copy Gemfile.lock from /usr/share/redmine/ to /var/lib/redmine/, it doesn't help.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in redmine (Ubuntu):
status: New → Confirmed
Revision history for this message
Arnaud TIERANT (atierant) wrote :

Same output when dpkg --configure redmine for me.

me@xxx:~$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial

Revision history for this message
Arnaud TIERANT (atierant) wrote :
Revision history for this message
Dorice Nyamy (dnyamy) wrote :

I also have the same problem.
In the absence of resolution. Would someone please give a workaround for amateurs ?

$sudo dpkg --configure redmine
Setting up redmine (3.2.1-2) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
chown: cannot access '/var/lib/redmine/Gemfile.lock': No such file or directory
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

Revision history for this message
TJ-G75VW (tomasz-janicki-tj) wrote :

Hello, I followed:

http://www.redmine.org/boards/2/topics/40180

Pasting the message here:
------------------------------------
Here is how I fixed the problem. I'm on Ubuntu 12.04 LTS server:

To fix the first problem:
sudo gem install bundler
To fix the second problem:

    sudo touch /usr/share/redmine/Gemfile.lock
    sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

I hope this helps. Ideally the best thing is to move the Gemfile.lock somewhere else in the configuration but this solution is minimally invasive on the ubuntu package.
------------------------------------

then I run apt-get upgrade the Gemfile.lock, while continously watching over the Gemfile.lock. And it turns out Gemfile.lock disappears during the upgrade - *before* the apt get finishes with and error exit status

# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libdrm2
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up redmine (3.2.1-2) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
chown: cannot access '/var/lib/redmine/Gemfile.lock': No such file or directory
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)

# lsb_release -a; uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
Linux redmine 4.4.0-91-generic #114-Ubuntu SMP Tue Aug 8 11:56:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Piotr Błądek (bladekp) wrote :

Same on my side:

# sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 340 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up redmine (3.2.1-2) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
chown: cannot access '/var/lib/redmine/Gemfile.lock': No such file or directory
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine
Sub-process /usr/bin/dpkg returned an error code (1)

# lsb_release -a; uname -a;
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Linux redmine 4.15.0-1036-gcp #38-Ubuntu SMP Mon Jun 24 13:49:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Solution found here (https://stackoverflow.com/questions/45757459/redmine-3-2-1-2-ob-ubuntu-16-04-breaks-on-apt-upgrade), was to comment out line 12 of script /var/lib/dpkg/info/redmine.postinst:

#chown www-data:www-data /var/lib/redmine/Gemfile.lock

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.