[DRE-maint] Bug#1120894: redmine: dpkg-reconfigure/upgrade redmine recreates /usr/share/redmine/plugins
Alban Browaeys
prahal at yahoo.com
Tue Nov 18 02:49:52 GMT 2025
Le lundi 17 novembre 2025 à 19:27 -0700, Soren Stoutner a écrit :
> On Monday, November 17, 2025 4:59:09 PM Mountain Standard Time Alban
> Browaeys
> wrote:
> > Package: redmine
> > Version: 6.0.5+ds-1
> > Severity: normal
> >
> > Dear Maintainer,
> > I have an issue wtaht if I symlink /usr/share/redmine/plugins/<x>
> > to
> > REDMINE_INSTANCE/plugins my redmine app cannot start because it
> > loads each
> > plugins file twice and rails Concern abort if loaded more than once
> > (and I
> > have a rails concerned derivative in the redmine_gitolite_plugin I
> > use.
> >
> > So I wanted to use the recommended by redmine Debian README way to
> > use
> > /usr/share/redmine/plugins directly. THat is delete
> > REDMIEN/INSTANCE/plugins
> > folder. It works. My plugins loads fine. But each time I do `dpkg-
> reconfigure
> > redmine` or I believe if redmine upgrades the
> > REDMINE_INSTANCE/plugins
> > directory is recreated.
> > The directory REDMINE_INSTANCE/plugins is recreated by
> > `/usr/share/redmine/bin/redmine-instances create default` called by
> > redmine.postinst.
> > Maybe it shouldn't if the a marker that tells the REDMINE_INSTANCE
> > folder
> tree
> > has already been created is set?
>
> Thank you for your bug report. I am not seeing this behavior in my
> personal
> redmine instance. Perhaps you can give me a little more information
> to help
> me replicate the problem.
>
> First, are you running one instance or more than one instance?
>
>
>
> In my case, I am running one instance (named default):
>
> root at mail:/usr/share/redmine# ls -la
> total 76
> drwxr-xr-x 12 root root 4096 Sep 6 11:07 .
> drwxr-xr-x 568 root root 20480 Sep 6 11:09 ..
> drwxr-xr-x 9 root root 4096 Apr 29 2025 app
> drwxr-xr-x 2 root root 4096 Sep 6 11:07 bin
> drwxrwxr-x 2 root root 4096 Apr 29 2025 .bundle
> drwxr-xr-x 5 root root 4096 Sep 6 11:07 config
> -rw-r--r-- 1 root root 129 Jul 7 14:03 config.ru
> drwxr-xr-x 3 root root 4096 Apr 29 2025 db
> drwxr-xr-x 5 root root 4096 Apr 29 2025 extra
> -rw-r--r-- 1 root root 3776 Aug 25 16:15 Gemfile
> lrwxrwxrwx 1 root root 29 Aug 25 16:15 Gemfile.lock ->
> /var/lib/redmine/
> Gemfile.lock
> lrwxrwxrwx 1 root root 16 Apr 18 2025 instances ->
> /var/lib/redmine
> drwxr-xr-x 6 root root 4096 Sep 6 11:07 lib
> drwxrwxr-x 3 root root 4096 Jun 23 16:37 plugins
> drwxr-xr-x 4 root root 4096 Sep 6 11:07 public
> -rw-r--r-- 1 root root 255 Aug 25 16:15 Rakefile
> drwxr-xr-x 2 root root 4096 Sep 6 11:07 templates
>
>
>
> I have one plugin installed:
>
> root at mail:/usr/share/redmine/plugins# ls -la
> total 12
> drwxrwxr-x 3 root root 4096 Jun 23 16:37 .
> drwxr-xr-x 12 root root 4096 Sep 6 11:07 ..
> drwxr-xr-x 5 root root 4096 Sep 6 11:09 redmine_simple_captcha\
>
>
>
> The plugin folder inside of the instance links to the plugin:
>
> root at mail:/usr/share/redmine/instances/default/plugins# ls -la
> total 8
> drwxr-xr-x 2 www-data www-data 4096 May 12 2025 .
> drwxr-xr-x 5 root root 4096 Oct 6 15:33 ..
> lrwxrwxrwx 1 www-data www-data 50 May 12 2025
> redmine_simple_captcha -> /
> usr/share/redmine/plugins/redmine_simple_captcha/
>
>
> This works for me and survives upgrades.
I meant:
rmdir /var/lib/redmine/default/plugin
is the way advertised by the Debian README to have
/usr/share/redmine/plugins activated when one do not want to use
symlinks from /usr/share/redmine/plugins/ to
/var/lib/redmine/default/plugins.
Fact is I cannot use symlinks from /usr/share/redmine/plugins/<x> to
/var/lib/redmine/default/plugins because it crashes rails loading. THis
is another bug.
In the meantime I can workaround this issue by switching removing the
/var/lib/redmine/default/plugins directory as advertised by the Debian
README to have /usr/share/plugins fallback to work.
But /usr/share/redmine/bin/redmine-instances called on each
upgrades/dpkg-reconfigure of redmine by redmine.postinst recreate teh
deleted /var/lib/redmine/default/plugins directory (with an empty
folder) thus the fallback to /usr/share/redmine/plugins is disabled and
I have no plugins anymore.
I plan to bug report the symlinks to /var/lib/redmine/default/plugins
from /usr/share/redmine/plugins/<x> breaks in a later bug report once I
have redmine at least back on track with the fallback to
/usr/share/redmine/plugins (this is my local prod redmine instance).
Fact is currently I get redmine to work but it will breaks on each
redmine upgrades.
ie unircorn errors out this way when I use symlinks (same for `sudo -u
www-data REDMINE_INSTANCE=default rackup -E production`)
phn at uruk:/usr/share/redmine$ sudo systemctl restart unicorn-redmine-default.service
phn at uruk:/usr/share/redmine$ tail -f /var/log/redmine/default/unicorn.stderr.log
I, [2025-11-17T00:24:08.230586 #29114] INFO -- : master complete
I, [2025-11-17T00:24:09.391248 #31326] INFO -- : Refreshing Gem list
I, [2025-11-17T00:24:40.154348 #31326] INFO -- : unlinking existing socket=/var/cache/redmine/default/sockets/redmine.socket
I, [2025-11-17T00:24:40.155992 #31326] INFO -- : listening on addr=/var/cache/redmine/default/sockets/redmine.socket fd=8
I, [2025-11-17T00:24:40.157350 #31326] INFO -- : listening on addr=127.0.0.1:18083 fd=9
I, [2025-11-17T00:24:40.188347 #31326] INFO -- : master process ready
I, [2025-11-17T00:24:40.249088 #31337] INFO -- : worker=0 ready
I, [2025-11-17T00:55:44.525446 #31326] INFO -- : reaped #<Process::Status: pid 31337 exit 0> worker=0
I, [2025-11-17T00:55:44.525820 #31326] INFO -- : master complete
I, [2025-11-17T00:55:45.840614 #1321] INFO -- : Refreshing Gem list
/usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/file_logger.rb:7: warning: already initialized constant RedmineGitHosting::FileLogger::LOG_LEVELS
/usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/file_logger.rb:7: warning: previous definition of LOG_LEVELS was here
/usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/git_access.rb:5: warning: already initialized constant RedmineGitHosting::GitAccess::DOWNLOAD_COMMANDS
/usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/git_access.rb:5: warning: previous definition of DOWNLOAD_COMMANDS was here
/usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/git_access.rb:6: warning: already initialized constant RedmineGitHosting::GitAccess::PUSH_COMMANDS
/usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/git_access.rb:6: warning: previous definition of PUSH_COMMANDS was here
/usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/mirror_keys_installer.rb:7: warning: already initialized constant RedmineGitHosting::MirrorKeysInstaller::GITOLITE_MIRRORING_KEYS_NAME
/usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/mirror_keys_installer.rb:7: warning: previous definition of GITOLITE_MIRRORING_KEYS_NAME was here
/usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/concern.rb:162:in `included': Cannot define multiple 'included' blocks for a Concern (ActiveSupport::Concern::MultipleIncludedBlocks)
from /usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/dashboard_content_project_patch.rb:8:in `<module:DashboardContentProjectPatch>'
from /usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/dashboard_content_project_patch.rb:5:in `<module:Patches>'
from /usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/dashboard_content_project_patch.rb:4:in `<module:RedmineGitHosting>'
from /usr/share/redmine/plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/dashboard_content_project_patch.rb:3:in `<top (required)>'
from /usr/lib/ruby/3.3.0/bundled_gems.rb:69:in `require'
from /usr/lib/ruby/3.3.0/bundled_gems.rb:69:in `block (2 levels) in replace_require'
from /usr/share/rubygems-integration/all/gems/zeitwerk-2.6.8/lib/zeitwerk/kernel.rb:38:in `require'
from /usr/lib/ruby/vendor_ruby/polyglot.rb:65:in `require'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/dependencies/require_dependency.rb:21:in `require_dependency'
from /usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/redmine_plugin_loader.rb:127:in `block in autoload_libs!'
from /usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/redmine_plugin_loader.rb:126:in `each'
from /usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/redmine_plugin_loader.rb:126:in `autoload_libs!'
from /usr/share/redmine/instances/default/plugins/redmine_git_hosting/lib/redmine_git_hosting/redmine_plugin_loader.rb:96:in `load_plugin!'
from /usr/share/redmine/instances/default/plugins/redmine_git_hosting/init.rb:72:in `<top (required)>'
from /usr/share/redmine/lib/redmine/plugin_loader.rb:31:in `load'
from /usr/share/redmine/lib/redmine/plugin_loader.rb:31:in `run_initializer'
from /usr/share/redmine/lib/redmine/plugin_loader.rb:67:in `each'
from /usr/share/redmine/lib/redmine/plugin_loader.rb:67:in `block in load'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `instance_exec'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:407:in `block in make_lambda'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:179:in `block in call'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:668:in `block (2 levels) in default_terminator'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `catch'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:667:in `block in default_terminator'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:180:in `call'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `block in invoke_before'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `each'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:559:in `invoke_before'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:109:in `run_callbacks'
from /usr/share/rubygems-integration/all/gems/activesupport-7.2.2.1/lib/active_support/reloader.rb:96:in `prepare!'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `instance_exec'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/initializable.rb:32:in `run'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/initializable.rb:61:in `block in run_initializers'
from /usr/lib/ruby/3.3.0/tsort.rb:231:in `block in tsort_each'
from /usr/lib/ruby/3.3.0/tsort.rb:353:in `block (2 levels) in each_strongly_connected_component'
from /usr/lib/ruby/3.3.0/tsort.rb:434:in `each_strongly_connected_component_from'
from /usr/lib/ruby/3.3.0/tsort.rb:352:in `block in each_strongly_connected_component'
from /usr/lib/ruby/3.3.0/tsort.rb:350:in `each'
from /usr/lib/ruby/3.3.0/tsort.rb:350:in `call'
from /usr/lib/ruby/3.3.0/tsort.rb:350:in `each_strongly_connected_component'
from /usr/lib/ruby/3.3.0/tsort.rb:229:in `tsort_each'
from /usr/lib/ruby/3.3.0/tsort.rb:208:in `tsort_each'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/initializable.rb:60:in `run_initializers'
from /usr/share/rubygems-integration/all/gems/railties-7.2.2.1/lib/rails/application.rb:435:in `initialize!'
from /usr/share/redmine/config/environment.rb:16:in `<top (required)>'
from config.ru:4:in `require_relative'
from config.ru:4:in `block in <main>'
from /usr/share/rubygems-integration/all/gems/rack-3.1.18/lib/rack/builder.rb:124:in `instance_eval'
from /usr/share/rubygems-integration/all/gems/rack-3.1.18/lib/rack/builder.rb:124:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /usr/lib/ruby/vendor_ruby/unicorn.rb:54:in `eval'
from /usr/lib/ruby/vendor_ruby/unicorn.rb:54:in `block in builder'
from /usr/lib/ruby/vendor_ruby/unicorn/http_server.rb:790:in `build_app!'
from /usr/lib/ruby/vendor_ruby/unicorn/http_server.rb:140:in `start'
from /usr/bin/unicorn:129:in `<main>'
Note that I have /usr/share/redmine/instances/default a symlink to
/var/lib/redmine/default. I don't know if it is vanilla. If I remove
this symlink and dpkg-reconfigure or reinstall redmine a broken nearly
empty (out of a log file) /usr/share/redmine/instances/default
directory is created and redmine bundler errors out (because
/usr/share/redmine/Gemfile
`Dir['/usr/share/redmine/{config,instances/*/config}/database.yml'].sel
ect do |f| `
and there is not
/usr/share/redmine/instances/default/config/database.yml because
/usr/share/redmine/instances/default is nearly empty).
It seems /usr/share/redmine/instances/default empty folder is created
by redmine.postinst rake db:migrate.
Ie I was unable to find what code is responsible to create the symlink
/usr/share/redmine/instances/default to /var/lib/redmine/default so
maybe this is non standard and a leftover from a local twseak I did to
get redmine gitolite plugin working.
Either way even if I can get the symlinks to the
/var/lib/redmine/default/plugins working, if removing this directory to
fallback to /usr/share/redmine/plugins is not supported, the README
shoould be fixed to remove this option.
Cheers,
Alban
More information about the Pkg-ruby-extras-maintainers
mailing list