Compiler error when trying to install redmine_knowledgebase plugin

Keywords: Redmine - Linux - Technical issue - Other
Description:
Downloaded and installed last Linux bitnami installer (4.2) on Ubuntu server 20.04.
No issue with installation, redmine is up and running correctly:

Environment:
  Redmine version                4.2.0.stable
  Ruby version                   2.5.8-p224 (2020-03-31) [x86_64-linux]
  Rails version                  5.2.5
  Environment                    production
  Database adapter               Mysql2 

However when trying to install plugin i get compiler error with nio4r gem …

bruno@Vostro:~/redmine-4.1.1-8/apps/redmine/htdocs/plugins$ git clone git://github.com/alexbevi/redmine_knowledgebase.git

bundle install --no-deployment

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
The dependency ffi (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Fetching rake 13.0.3
Installing rake 13.0.3
Fetching concurrent-ruby 1.1.8
Installing concurrent-ruby 1.1.8
Fetching i18n 1.8.9
Installing i18n 1.8.9
Fetching minitest 5.14.4
Installing minitest 5.14.4
Using thread_safe 0.3.6
Fetching tzinfo 1.2.9
Installing tzinfo 1.2.9
Fetching activesupport 5.2.5
Installing activesupport 5.2.5
Using builder 3.2.4
Fetching erubi 1.10.0
Installing erubi 1.10.0
Fetching mini_portile2 2.5.0
Installing mini_portile2 2.5.0
Fetching racc 1.5.2
Installing racc 1.5.2 with native extensions
Fetching nokogiri 1.11.2 (x86_64-linux)
Installing nokogiri 1.11.2 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Fetching loofah 2.9.0
Installing loofah 2.9.0
Using rails-html-sanitizer 1.3.0
Fetching actionview 5.2.5
Installing actionview 5.2.5
Using rack 2.2.3
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 5.2.5
Installing actionpack 5.2.5
Fetching nio4r 2.5.7
Installing nio4r 2.5.7 with native extensions
*Gem::Ext::BuildError: ERROR: Failed to build gem native extension.*

    current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
/home/bruno/redmine-4.2.0-0/ruby/bin/ruby -r ./siteconf20210329-18642-1yfhj63.rb extconf.rb
checking for unistd.h... yes
checking for linux/aio_abi.h... yes
checking for linux/io_uring.h... yes
checking for sys/select.h... yes
checking for port_event_t in poll.h... no
checking for sys/epoll.h... yes
checking for sys/event.h... no
checking for port_event_t in port.h... no
checking for sys/resource.h... yes
creating Makefile

current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
make "DESTDIR=" clean

current directory: /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
make "DESTDIR=" 
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:6:
../libev/ev.c:2136:31: warning: ‘ev_default_loop_ptr’ initialized and declared ‘extern’
2136 |   EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition
despite extern */
      |                               ^~~~~~~~~~~~~~~~~~~
../libev/ev.c: In function ‘ev_time’:
../libev/ev.c:2172:7: internal compiler error: Illegal instruction
 2172 |       return EV_TS_GET (ts);
      |       ^~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
make: *** [Makefile:243: nio4r_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7 for
inspection.
Results logged to
/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/nio4r-2.5.7/gem_make.out

An error occurred while installing nio4r (2.5.7), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.5.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  redmine_crm was resolved to 0.0.54, which depends on
    rails was resolved to 5.2.5, which depends on
      actioncable was resolved to 5.2.5, which depends on
        nio4r

Any insights ?
Same errors when trying to gem install nio4r directly …
Thanks

Sorry but i don’t know how to edit my previous message ?
Edit function is not available … (i would like to improve readability of my message)

Hello @herold75,

It seems redmine_knowledgebase only supports up to Redmine 4.1.x and you are using version 4.2.0. I suggest you to download a previous version of the installer and check whether the issue is related to it.

You can download version 4.1.2 from: https://downloads.bitnami.com/files/stacks/redmine/4.1.2-0/bitnami-redmine-4.1.2-0-linux-x64-installer.run

Regards,
Francisco de Paz

Thank’s Francisco.
I’ve previously used 4.1.1.8 installer but unfortunately nio4r build error was the same.
Seems some headers are missing (see mkmf.log extract):

bruno@Vostro:~/redmine-4.1.1-8/ruby/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0-static/nio4r-2.5.2$ more mkmf.log

...
conftest.c:6:9: error: unknown type name ‘port_event_t’
...
conftest.c:3:10: fatal error: sys/event.h: No such file or directory
...
conftest.c:3:10: fatal error: port.h: No such file or directory
...

Regards
Bruno

Hello @herold75,

These errors may be coming from some missing system packages. Please try running:

sudo apt-get install build-essential patch

Regards,
Francisco de Paz

Hello Francisco,
Agreed; seems some missing dev headers, but i’ve installed build-essential and also libevent-dev and still same errors.

Hi @herold75,

Can you load the Bitnami console before trying to install any plugin?

https://docs.bitnami.com/installer/how-to/understand-bnconsole/

Once you have loaded the console, please also run the next command to load other environment variables that may be of help in the process. Replace INSTALLDIR with your installation directory

. INSTALLDIR/scripts/setenv.sh

Thank’s @gongomgra,
Unfortunately same build errors.

bruno@Vostro:~$ cd redmine-4.2.0-0/
bruno@Vostro:~/redmine-4.2.0-0$ ./use_redmine 
bruno@Vostro:~$ . /home/bruno/redmine-4.2.0-0/scripts/setenv.sh  

env command output (extract)

bruno@Vostro:~/redmine-4.2.0-0$ env

...
BITNAMI_ROOT=/home/bruno/redmine-4.2.0-0
SHLVL=3
XDG_SESSION_ID=1
GS_LIB=/home/bruno/redmine-4.2.0-0/common/share/ghostscript/fonts
LD_LIBRARY_PATH=/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/passenger-6.0.5/lib:/home/bruno/redmine-4.2.0-0/perl/lib:/home/bruno/redmine-4.2.0-0/perl/lib/5.32.1/x86_64-linux-thread-multi/CORE:/home/bruno/redmine-4.2.0-0/git/lib:/home/bruno/redmine-4.2.0-0/sqlite/lib:/home/bruno/redmine-4.2.0-0/ruby/lib:/home/bruno/redmine-4.2.0-0/postgresql/lib:/home/bruno/redmine-4.2.0-0/mysql/lib:/home/bruno/redmine-4.2.0-0/apache2/lib:/home/bruno/redmine-4.2.0-0/common/lib:/home/bruno/redmine-4.2.0-0/common/lib64
XDG_RUNTIME_DIR=/run/user/1000
SSL_CERT_FILE=/home/bruno/redmine-4.2.0-0/common/openssl/certs/curl-ca-bundle.crt
SSH_CLIENT=192.168.0.200 64729 22
XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
RUBY_HOME=/home/bruno/redmine-4.2.0-0/ruby
BUNDLE_CONFIG=/home/bruno/redmine-4.2.0-0/ruby/.bundler/config
PATH=/home/bruno/redmine-4.2.0-0/perl/bin:/home/bruno/redmine-4.2.0-0/git/bin:/home/bruno/redmine-4.2.0-0/sqlite/bin:/home/bruno/redmine-4.2.0-0/ruby/bin:/home/bruno/redmine-4.2.0-0/postgresql/bin:/home/bruno/redmine-4.2.0-0/php/bin:/home/bruno/redmine-4.2.0-0/mysql/bin:/home/bruno/redmine-4.2.0-0/letsencrypt/:/home/bruno/redmine-4.2.0-0/apache2/bin:/home/bruno/redmine-4.2.0-0/common/bin:/home/bruno/redmine-4.2.0-0/perl/bin:/home/bruno/redmine-4.2.0-0/git/bin:/home/bruno/redmine-4.2.0-0/sqlite/bin:/home/bruno/redmine-4.2.0-0/ruby/bin:/home/bruno/redmine-4.2.0-0/postgresql/bin:/home/bruno/redmine-4.2.0-0/php/bin:/home/bruno/redmine-4.2.0-0/mysql/bin:/home/bruno/redmine-4.2.0-0/letsencrypt/:/home/bruno/redmine-4.2.0-0/apache2/bin:/home/bruno/redmine-4.2.0-0/common/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
CFLAGS=-I/home/bruno/redmine-4.2.0-0/common/include/ImageMagick -I/home/bruno/redmine-4.2.0-0/common/include 
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_TTY=/dev/pts/0
RUBYLIB=/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/gems/2.5.0/gems/bundler-2.1.2/lib:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/site_ruby/2.5.0:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/site_ruby/2.5.0/x86_64-linux:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/site_ruby/:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/vendor_ruby/2.5.0:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/vendor_ruby/2.5.0/x86_64-linux:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/vendor_ruby/:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/2.5.0:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/2.5.0/x86_64-linux:/home/bruno/redmine-4.2.0-0/ruby/lib/ruby/:/home/bruno/redmine-4.2.0-0/ruby/lib
MAGICK_CONFIGURE_PATH=/home/bruno/redmine-4.2.0-0/common/lib/ImageMagick-6.9.8/config-Q16:/home/bruno/redmine-4.2.0-0/common/
COMPOSER_HOME=/home/bruno/redmine-4.2.0-0/php/composer
OLDPWD=/home/bruno
SASL_PATH=/home/bruno/redmine-4.2.0-0/common/lib/sasl2
_=/usr/bin/env

Hi @herold75,

Thanks for the info. It seems to me you properly loaded the environment. However, I’ve checked the plugin website on Redmine directory, and it looks like it doesn’t support Redmine 4.2.x. Can you check it with the plugin developers?

https://www.redmine.org/plugins/redmine_knowledgebase

Hi @herold75,

I have been able to install the plugin in a fresh instance of Ubuntu 20 with the plugin installation’s commands after loading the Bitnami console as mi colleague suggested. Could you please try the installation following these commands:

cd INSTALLDIR
./use_redmine
. ./scripts/setenv.sh
cd apps/redmine/htdocs/
bundle install
bundle exec ./bin/rake redmine:plugins:migrate NAME=redmine_knowledgebase RAILS_ENV=production
INSTALLDIR/ctlscript.sh restart

Regards,
Francisco de Paz

1 Like

Thanks @gongomgra and @fdepaz, so i try again (fresh install bitnami redmine 4.2 on Ubuntu 20.04):

bruno@Vostro:~/ressources$ ./bitnami-redmine-4.2.0-0-linux-x64-installer.run

Redmine OK up and running:

Environment:
Redmine version 4.2.0.stable
Ruby version 2.5.8-p224 (2020-03-31) [x86_64-linux]
Rails version 5.2.5
Environment production
Database adapter Mysql2
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Git 2.31.0
Filesystem
Redmine plugins:
no plugin installed

No issue witth bundle install and nio4r without knowledge_base plugin

bruno@Vostro:~/redmine-4.2$ ./use_redmine
bruno@Vostro:~/redmine-4.2$ . ./scripts/setenv.sh
bruno@Vostro:~/redmine-4.2$ cd apps/redmine/htdocs/
bruno@Vostro:~/redmine-4.2/apps/redmine/htdocs$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
The dependency ffi (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using i18n 1.8.9
Using minitest 5.14.4
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using activesupport 5.2.5
Using builder 3.2.4
Using erubi 1.10.0
Using mini_portile2 2.5.0
Using racc 1.5.2
Using nokogiri 1.11.2 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.9.0
Using rails-html-sanitizer 1.3.0
Using actionview 5.2.5
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 5.2.5
Using nio4r 2.5.7
.....
.....
Using rubyzip 2.3.0
Bundle complete! 36 Gemfile dependencies, 64 gems now installed.
Gems in the groups development, test and sqlite were not installed.
Bundled gems are installed into `./vendor/bundle

I then tried to install knowledge base plugin:

bruno@Vostro:~/redmine-4.2/apps/redmine/htdocs/plugins$ git clone git://github.com/alexbevi/redmine_knowledgebase.git
Cloning into 'redmine_knowledgebase'...

Plugin cloning OK but now some error / warning with bundle install:

bruno@Vostro:~/redmine-4.2/apps/redmine/htdocs$ bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the /home/bruno/redmine-4.2/apps/redmine/htdocs/Gemfile freeze 
by running `bundle install --no-deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* redmine_crm
* ya2yaml
* awesome_nested_set

Using --no-deployment command option i’ve got same compiler build error with nio4r:

bruno@Vostro:~/redmine-4.2/apps/redmine/htdocs$ bundle install --no-deployment

Fetching nio4r 2.5.7
Installing nio4r 2.5.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/bruno/redmine-4.2/ruby/lib/ruby/gems/2.5.0/gems/nio4r-2.5.7/ext/nio4r
/home/bruno/redmine-4.2/ruby/bin/ruby -r ./siteconf20210408-11792-3sfxot.rb extconf.rb
...

@fdepaz any idea what i’m doing wrong because you seem to succeed with same environment ?

Hello @herold75,

You seem to have modified the Gemfile, you can try reverting it to its original state and continue with the installation steps I posted above.

Nevertheless, as my colleague said, the plugin you are try to install doesn’t offer support for redmine 4.2. Please get in touch with the developers and check whether the plugin supports this version. It is normal that errors pop up in an unsupported version.

Regards,
Francisco de Paz

Thank you Francisco,
It is possible that knowledgebase plugin is not yet compatible with Redmine 4.2.X. I’ll check it out.
I just wanted to make sure that the nio4r build errors did not come from some issue with the bitnami environment.
I had understood that you managed to install this plugin in the same environment (bitnami ubuntu 20.04) without errors and I don’t see why I can’t do it ?

Hello @herold75,

I performed the installation in a new instance of Ubuntu 20 without any other changes so it is possible that had affected the end result. Loading the environment with setenv.sh should solve those problems but it can affect nonetheless.

Regards,
Francisco de Paz

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.