Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With PE PLAN no such file to load -- rbvmomi #87

Open
anissmajlovic opened this issue Sep 30, 2021 · 4 comments
Open

With PE PLAN no such file to load -- rbvmomi #87

anissmajlovic opened this issue Sep 30, 2021 · 4 comments

Comments

@anissmajlovic
Copy link

Good morning everyone

I am trying to use patching with PE 2019.8 but I am getting error below:

For example if I use puppet plan run patching::snapshot_vmware action=create targets=xxxxxxx vsphere_datacenter=xxxxxxx vsphere_host=xxxxxxx vsphere_insecure=true vsphere_password=xxxxxxx vsphere_username=xxxxxxx

Then I receive error:
{
"msg": "no such file to load -- rbvmomi",
"kind": "bolt/plan-failure",
"details": {
"class": "LoadError"
}
}

I tried on PE to do this
/opt/puppetlabs/server/bin/puppetserver gem install rbvmomi
and restart pe-puppetserver but it didn't help.

Any idea?

Thanks

@Pedmu
Copy link

Pedmu commented Sep 1, 2022

Hello everyone,
@anissmajlovic did you find a solution?
I solved 1 issue but then get others of the same kind

I solved 1 issue by replacing 'rbvmomi' to '/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/rbvmomi-3.0.0/lib/rbvmomi'
But then I get
{
"msg" : "no such file to load -- nokogiri",
"kind" : "bolt/plan-failure",
"details" : {
"class" : "LoadError"
}
}

If I replace the require for 'nokogiri' to '/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.8-x86_64-linux/lib/nokogiri' in the files

/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/rbvmomi-3.0.0/lib/rbvmomi/trivial_soap.rb
/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/rbvmomi-3.0.0/lib/rbvmomi/utils/deploy.rb
/opt/puppetlabs/bolt/lib/ruby/gems/2.7.0/gems/rbvmomi-3.0.0/lib/rbvmomi/sms.rb

I get
{
"msg" : "no such file to load -- isorelax",
"kind" : "bolt/plan-failure",
"details" : {
"class" : "LoadError"
}
}

I got the idea from [(https://stackoverflow.com/questions/9154365/ruby-loaderror-cannot-load-such-file)] but I have no knowledge about ruby

Changing every file this way is only temporary until the next synchronization and tiresome.

Is there no other solution?

I am using PE 2021.6

@anissmajlovic
Copy link
Author

Yes, I found solution. I will share in couple of hours. I am out now.

Thanks

@anissmajlovic
Copy link
Author

This helped me to resolve this by executing commands below on PE.

Command 1

echo "jruby-puppet: { gem-home: /opt/puppetlabs/server/apps/bolt-server/lib/ruby }" > /tmp/jruby.conf

Command 2

/opt/puppetlabs/server/bin/java -cp :/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar:/opt/puppetlabs/server/apps/puppetserver/jruby-9k.jar:/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter.jar:/opt/puppetlabs/share/java/bcprov-jdk15on.jar:/opt/puppetlabs/share/java/bcpkix-jdk15on.jar:/opt/puppetlabs/server/data/puppetserver/jars/* clojure.main -m puppetlabs.puppetserver.cli.gem --config /tmp/jruby.conf -- install --no-document rbvmomi

Restart

puppet resource service pe-orchestration-services ensure=stopped
puppet resource service pe-orchestration-services ensure=running

Test

@Pedmu
Copy link

Pedmu commented Sep 2, 2022

When I excecute the command 2, I get an error message:

> /opt/puppetlabs/server/bin/java -cp :/opt/puppetlabs/server/apps/puppetserver/puppet-server-release.jar:/opt/puppetlabs/server/apps/puppetserver/jruby-9k.jar:/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter.jar:/opt/puppetlabs/share/java/bcprov-jdk15on.jar:/opt/puppetlabs/share/java/bcpkix-jdk15on.jar:/opt/puppetlabs/server/data/puppetserver/jars/* clojure.main -m puppetlabs.puppetserver.cli.gem --config /tmp/jruby.conf -- install --no-document rbvmomi
Fetching rbvmomi-3.0.0.gem
Fetching nokogiri-1.13.8-java.gem
ERROR: Error installing rbvmomi:

     ` The last version of nokogiri (~> 1.10) to support your Ruby & RubyGems was 1.12.5. Try installing it with gem install nokogiri -v 1.12.5 and then running the current command again`
     `nokogiri requires Ruby version >= 2.6.0. The current ruby version is 2.5.8.0.`

That error message is strange because version 2.7 is installed
> ruby --version
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

I found 3 binaries, and everyone is ruby 2.7

> /opt/puppetlabs/bolt/bin/ruby --version
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

> /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

> /opt/puppetlabs/bolt/bin/ruby --version
ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]

If I use your command to install nokogiri -v 1.12.5 and then use it to install rbvmomi, it turns successfully

I dont get the error message anymore, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants