ONEHEM issue with gem to execute my hooks

Hi,

i’ve install the last version of the opennebula community (6.0.2).
I’ve an issue when i want to execute my hooks.

This the logs of the execution of my hook :
EXECUTION STDERR
/usr/lib/one/ruby/opennebula/xml_utils.rb:144:in <module:OpenNebula>': nokogiri gem not installed. (RuntimeError) from /usr/lib/one/ruby/opennebula/xml_utils.rb:19:in <top (required)>’
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’
from /usr/lib/one/ruby/opennebula.rb:27:in <top (required)>' from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’
from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' from /var/lib/one/remotes/hooks/getvmname.rb:18:in

This is my Gem List :

*** LOCAL GEMS ***

activesupport (4.2.11.3)
addressable (2.7.0)
android_key_attestation (0.3.0)
augeas (0.6.4)
awrence (1.2.1)
aws-eventstream (1.1.1)
aws-partitions (1.434.0)
aws-sdk-cloudwatch (1.50.0)
aws-sdk-core (3.113.0)
aws-sdk-ec2 (1.230.0)
aws-sdk-kms (1.43.0)
aws-sdk-s3 (1.93.0)
aws-sigv4 (1.2.3)
azure_mgmt_compute (0.22.0)
azure_mgmt_monitor (0.19.0)
azure_mgmt_network (0.26.1)
azure_mgmt_resources (0.18.2)
azure_mgmt_storage (0.23.0)
bigdecimal (default: 1.3.4)
bindata (2.4.8)
builder (3.2.4)
bundler (2.2.17)
cbor (0.5.9.6)
chunky_png (1.4.0)
cmath (default: 1.0.0)
concurrent-ruby (1.1.8)
configparser (0.1.7)
cose (1.2.0)
csv (default: 1.0.0)
curb (0.9.11)
daemons (1.3.1)
dalli (2.7.11)
date (default: 1.0.0)
dbm (default: 1.0.0)
did_you_mean (1.2.1)
domain_name (0.5.20190701)
etc (default: 1.0.0)
eventmachine (1.2.7)
faraday (0.17.4)
faraday-cookie_jar (0.0.7)
faraday_middleware (0.14.0)
fcntl (default: 1.0.0)
ffi (1.15.0)
ffi-rzmq (2.0.7)
ffi-rzmq-core (1.0.7)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
gdbm (default: 2.0.0)
git (1.8.1)
gnuplot (2.6.2)
hashie (4.1.0)
highline (1.7.10)
http-cookie (1.0.3)
i18n (0.9.5)
inflection (1.0.0)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
ipaddress (0.8.3)
jmespath (1.4.0)
json (2.5.1, default: 2.1.0)
jwt (2.2.2)
memcache-client (1.8.5)
mime-types (3.3.1)
mime-types-data (3.2021.0225)
mini_portile2 (2.5.0)
minitest (5.14.4, 5.11.3)
ms_rest (0.7.6)
ms_rest_azure (0.12.0)
multipart-post (2.1.1)
mustermann (1.1.1)
mysql2 (0.5.3)
net-ldap (0.17.0)
net-telnet (0.1.1)
nokogiri (1.11.7 x86_64-linux, 1.11.2 x86_64-linux)
openssl (2.2.0, default: 2.1.2)
openssl-signature_algorithm (1.1.1)
optimist (3.0.1)
ox (2.14.4)
parse-cron (0.1.4)
passenger (6.0.9)
pg (1.2.3)
polyglot (0.3.5)
power_assert (1.1.1)
psych (default: 3.0.2)
public_suffix (4.0.6)
racc (1.5.2)
rack (2.2.3)
rack-protection (2.1.0)
rake (12.3.1)
rbvmomi (3.0.0)
rchardet (1.8.0)
rdoc (default: 6.0.1)
rotp (6.2.0)
rqrcode (1.2.0)
rqrcode_core (0.2.0)
ruby2_keywords (0.0.4)
safety_net_attestation (0.4.0)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
securecompare (1.0.0)
sequel (5.42.0)
sinatra (2.1.0)
sqlite3 (1.4.2)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
test-unit (3.2.8)
thin (1.8.0)
thread_safe (0.3.6)
tilt (2.0.10)
timeliness (0.3.10)
tpm-key_attestation (0.10.0)
treetop (1.6.11)
tzinfo (1.2.9)
unf (0.1.4)
unf_ext (0.0.7.7)
uuidtools (2.2.0)
vsphere-automation-cis (0.4.7)
vsphere-automation-runtime (0.4.7)
vsphere-automation-vcenter (0.4.7)
webauthn (2.5.0)
webrick (1.7.0, default: 1.4.2)
xmlrpc (0.3.2, 0.3.0)
zendesk_api (1.28.0)
zlib (default: 1.0.0)

do you have any idea of my issue ?

Regards

More information :
When i do “gem list” with the user oneadmin i’ve not the nokogiri gem installed

oneadmin@NUBIBUS:/usr/share/one/gems$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.4)
cmath (default: 1.0.0)
csv (default: 1.0.0)
date (default: 1.0.0)
dbm (default: 1.0.0)
did_you_mean (1.2.1)
etc (default: 1.0.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
gdbm (default: 2.0.0)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
json (default: 2.1.0)
minitest (5.11.3)
net-telnet (0.1.1)
openssl (default: 2.1.2)
power_assert (1.1.1)
psych (default: 3.0.2)
rake (12.3.1)
rdoc (default: 6.0.1)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
test-unit (3.2.8)
webrick (default: 1.4.2)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

if i try to install

oneadmin@NUBIBUS:/usr/share/one/gems-dist$ gem install --install-dir /usr/share/one/gems/ --bindir /usr/share/one/gems/bin/ --no-document --conservative nokogiri
Fetching: nokogiri-1.11.7-x86_64-linux.gem (100%)
ERROR: While executing gem … (Gem::FilePermissionError)

regards

Hello @David_Martins,

In order to use the OpenNebula installed gems, you need to add this at the top of your script: Using Hooks — OpenNebula 6.0.2 documentation.

If you need to install extra dependencies, you have to do it in the gem location used by oneadmin, you can find more info in the warning section inside Single Front-end Installation — OpenNebula 6.0.2 documentation.

Hi,

The solution was the first one.

Thank you

Regards,

1 Like