2

I have the following setup:

  • Ubuntu 16.04 lxc/lxd host machine running several lxc containers
  • One container runs Redmine 3.2.1-2 on Ubuntu 16.04 guest OS, with Rails 5.0.1 and Bundler 1.13.6
  • The Redmine database in on an other lxc database container
  • The Redmine guest is configured to perform security upgrades automatically.

This setup worked pretty fine without problems. But for some reason something broke in the setup and each time I perform sudo apt update; sudo apt upgrade the upgrade stops with an error and redmine stops working:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
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) ...
Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
actionpack-action_caching was resolved to 1.2.0, which depends on
  actionpack (< 6, >= 4.0.0)

actionpack-xml_parser was resolved to 2.0.0, which depends on
  actionpack (~> 5.x)

rails (~> 4.2.5) was resolved to 4.2.9, which depends on
  actionpack (= 4.2.9)

rails (~> 4.2.5) was resolved to 4.2.9, which depends on
  actionpack (= 4.2.9)

rails (~> 4.2.5) was resolved to 4.2.9, which depends on
  actionpack (= 4.2.9)
Bundler could not find compatible versions for gem "rspec-core":
  In Gemfile:
rspec (~> 2.0) was resolved to 2.99.0, which depends on
  rspec-core (~> 2.99.0)

rspec-rails was resolved to 3.6.0, which depends on
  rspec-core (~> 3.6.0)
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 6
Errors were encountered while processing:
 redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)`

But, if I run bundle install in \usr\share\redmine I get the following output (No errors!!) and redmine works again:

/usr/share/redmine/ bundle install
Your Gemfile lists the gem poltergeist (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.0.0
Using i18n 0.8.6
Using minitest 5.10.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.2.0
Using rack 1.6.8
Using mime-types-data 3.2016.0521
Using arel 6.0.4
Using public_suffix 2.0.5
Using bundler 1.13.6
Using coderay 1.1.1
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using concurrent-ruby 1.0.5
Using ffi 1.9.18
Using temple 0.8.0
Using tilt 2.0.8
Using htmlentities 4.3.4
Using thor 0.20.0
Using mysql2 0.4.9
Using net-ldap 0.16.0
Using ruby-openid 2.7.0
Using rb-fsevent 0.10.2
Using rbpdf-font 1.19.1
Using redcarpet 3.4.0
Using request_store 1.3.2
Using rmagick 2.16.0
Using tzinfo 1.2.3
Using nokogiri 1.8.0
Using rack-test 0.6.3
Using mime-types 3.1
Using addressable 2.5.1
Using coffee-script 2.4.1
Using sprockets 3.7.1
Using rb-inotify 0.9.10
Using haml 5.0.2
Using rack-openid 1.4.2
Using rbpdf 1.19.2
Using activesupport 4.2.9
Using loofah 2.0.3
Using mail 2.6.6
Using css_parser 1.5.0
Using sass-listen 4.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.4.0
Using activemodel 4.2.9
Using rails-html-sanitizer 1.0.3
Using roadie 3.2.2
Using sass 3.5.1
Using rails-dom-testing 1.0.8
Using activejob 4.2.9
Using activerecord 4.2.9
Using protected_attributes 1.1.4
Using actionview 4.2.9
Using actionpack 4.2.9
Using actionmailer 4.2.9
Using actionpack-action_caching 1.2.0
Using actionpack-xml_parser 1.0.2
Using railties 4.2.9
Using sprockets-rails 3.2.0
Using jquery-rails 4.3.1
Using roadie-rails 1.2.1
Using rails 4.2.9
Bundle complete! 42 Gemfile dependencies, 65 gems now installed.
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

After hours of research and trial and error I finally have no more ideas what's wrong and how to fix this.

Al

alfred
  • 91
  • 6
  • I would recommend installing Redmine under user account via RVM, that way you won't be affected by system's ruby and some 3rd party libraries updates... – Aleksandar Pavić Aug 19 '17 at 06:57
  • That's my last and least favorite option since it's a production server which runs smoothly besides the described behaviour. – alfred Aug 21 '17 at 14:30

1 Answers1

3

The problem is located in the redmine.postinst script located in /var/lib/dpkg/info.

To make it pass through, simply comment out this line (#12) :

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

This happens to those who installed Redmine as root I guess (so did I).

MensSana
  • 521
  • 1
  • 5
  • 16