Warning: An error occured while loading module hammer_cli_katello

From a fresh CentOS 6 installation, all modules seem to be installed
correctly, but when trying to use the hammer_cli_katello commands, they are
not available. I can see the hammer foreman commands, but not the ones from
katello.
A while ago I created a script to install and configure a katello server
from scratch from the GIT repositories. There are no errors on the
execution and I don't know where to look at. Here is the script:

*# Start with a fresh install of CentOS *yum -y update
yum install -y git ruby rubygems

*# Install Installer *
git clone https://github.com/Katello/katello-deploy.git
cd katello-deploy
./setup.rb centos6 --skip-installer

*# Run Installer *
katello-installer --foreman-admin-password="changeme"
–foreman-authentication=true --capsule-tftp=true
–capsule-tftp-servername="10.10.10.10" --capsule-dhcp=true
–capsule-dhcp-gateway="10.10.10.10" --capsule-dhcp-interface="eth1"
–capsule-dhcp-range="10.10.10.20 10.10.10.200" --capsule-dns=true
–capsule-dns-forwarders "10.10.10.10" --capsule-dns-interface="eth1"
–capsule-dns-reverse="10.10.10.in-addr.arpa" --capsule-dns-zone "hq.ltg"

*# Here is the error.*After installing, the following command gives the
hammer cli katello error:
hammer -u admin -p changeme organization create --name Test_Cloud7
–description "Cloud Servers in VM internal network"
Warning: An error occured while loading module hammer_cli_katello

And here is the copy of the logs:
[root@satellite ~]# hammer -d log
[ INFO 2014-08-07 12:08:18 Init] Initialization of Hammer CLI (0.1.1) has
started…
[DEBUG 2014-08-07 12:08:18 Init] Running at ruby 1.8.7-p352
[ INFO 2014-08-07 12:08:18 Init] Configuration from the file
/etc/hammer/cli_config.yml has been loaded
[ INFO 2014-08-07 12:08:18 Init] Configuration from the file
/etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2014-08-07 12:08:18 Init] Configuration from the file
/etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2014-08-07 12:08:19 Connection] Registered: foreman
[Foreman] username: admin
[Foreman] password for admin:
[DEBUG 2014-08-07 12:08:24 API] Global headers: {
"Accept-Language" => "en",
:content_type => "application/json",
:accept => "application/json;version=2"
}
[ INFO 2014-08-07 12:08:25 Modules] Extension module hammer_cli_foreman
(0.1.1) loaded
[ERROR 2014-08-07 12:08:25 Modules] Error while loading module
hammer_cli_katello
Warning: An error occured while loading module hammer_cli_katello
[ERROR 2014-08-07 12:08:25 Modules] <NoMethodError> undefined method
`lazy_subcommand' for HammerCLI::MainCommand:Class
/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/lib/hammer_cli_katello.rb:27

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in 

gem_original_require&#39; /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:60:in
require_module&#39; /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:39:inload!'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:54:in
load&#39; /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:65:inload_all'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:in
each&#39; /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:inload_all'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:93
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
[DEBUG 2014-08-07 12:08:25 Init] Using locale 'en'
[DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain 'hammer-cli'
loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale'
[DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain
'hammer-cli-foreman' loaded from
'/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale'
[DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain
'hammer-cli-katello' loaded from
'/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale'
[ INFO 2014-08-07 12:08:25 HammerCLI::MainCommand] Called with options:
{"option_debug"=>true}
[ERROR 2014-08-07 12:08:25 Exception] Error: No such sub-command 'log'

See: 'hammer --help'
Error: No such sub-command 'log'

See: 'hammer --help'
[ERROR 2014-08-07 12:08:25 Exception]

Clamp::UsageError (No such sub-command 'log'):
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:28:in
find_subcommand_class&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:17:ininstatiate_subcommand'
/usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:10:in
execute&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/./apipie/…/abstract.rb:22:in
run&#39; /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:inrun'
/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:106
/usr/bin/hammer:19:in `load'
/usr/bin/hammer:19
[root@satellite ~]#

Thanks,
IB

Ignacio,

I see undefined methodlazy_subcommand' for
HammerCLI::MainCommand:Class. Would you rungem list` for me and paste
the output? I'm wondering if you managed to get a different version of
hammer_cli that's not compatible with hammer_cli_katello.

··· On Thursday, August 7, 2014 1:03:16 PM UTC-4, Ignacio Bravo wrote: > > > From a fresh CentOS 6 installation, all modules seem to be installed > correctly, but when trying to use the hammer_cli_katello commands, they are > not available. I can see the hammer foreman commands, but not the ones from > katello. > A while ago I created a script to install and configure a katello server > from scratch from the GIT repositories. There are no errors on the > execution and I don't know where to look at. Here is the script: > > > > *# Start with a fresh install of CentOS *yum -y update > yum install -y git ruby rubygems > > *# Install Installer * > git clone https://github.com/Katello/katello-deploy.git > cd katello-deploy > ./setup.rb centos6 --skip-installer > > *# Run Installer * > katello-installer --foreman-admin-password="changeme" > --foreman-authentication=true --capsule-tftp=true > --capsule-tftp-servername="10.10.10.10" --capsule-dhcp=true > --capsule-dhcp-gateway="10.10.10.10" --capsule-dhcp-interface="eth1" > --capsule-dhcp-range="10.10.10.20 10.10.10.200" --capsule-dns=true > --capsule-dns-forwarders "10.10.10.10" --capsule-dns-interface="eth1" > --capsule-dns-reverse="10.10.10.in-addr.arpa" --capsule-dns-zone "hq.ltg" > > > *# Here is the error.*After installing, the following command gives the > hammer cli katello error: > hammer -u admin -p changeme organization create --name Test_Cloud7 > --description "Cloud Servers in VM internal network" > Warning: An error occured while loading module hammer_cli_katello > > > And here is the copy of the logs: > [root@satellite ~]# hammer -d log > [ INFO 2014-08-07 12:08:18 Init] Initialization of Hammer CLI (0.1.1) has > started... > [DEBUG 2014-08-07 12:08:18 Init] Running at ruby 1.8.7-p352 > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli_config.yml has been loaded > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli.modules.d/foreman.yml has been loaded > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli.modules.d/katello.yml has been loaded > [DEBUG 2014-08-07 12:08:19 Connection] Registered: foreman > [Foreman] username: admin > [Foreman] password for admin: > [DEBUG 2014-08-07 12:08:24 API] Global headers: { > "Accept-Language" => "en", > :content_type => "application/json", > :accept => "application/json;version=2" > } > [ INFO 2014-08-07 12:08:25 Modules] Extension module hammer_cli_foreman > (0.1.1) loaded > [ERROR 2014-08-07 12:08:25 Modules] Error while loading module > hammer_cli_katello > Warning: An error occured while loading module hammer_cli_katello > [ERROR 2014-08-07 12:08:25 Modules] undefined method > `lazy_subcommand' for HammerCLI::MainCommand:Class > /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/lib/hammer_cli_katello.rb:27 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in > `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:60:in > `require_module' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:39:in > `load!' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:54:in > `load' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:65:in > `load_all' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:in > `each' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:in > `load_all' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:93 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > [DEBUG 2014-08-07 12:08:25 Init] Using locale 'en' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain 'hammer-cli' > loaded from '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain > 'hammer-cli-foreman' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain > 'hammer-cli-katello' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale' > [ INFO 2014-08-07 12:08:25 HammerCLI::MainCommand] Called with options: > {"option_debug"=>true} > [ERROR 2014-08-07 12:08:25 Exception] Error: No such sub-command 'log' > > See: 'hammer --help' > Error: No such sub-command 'log' > > See: 'hammer --help' > [ERROR 2014-08-07 12:08:25 Exception] > > Clamp::UsageError (No such sub-command 'log'): > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:28:in > `find_subcommand_class' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:17:in > `instatiate_subcommand' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:10:in > `execute' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run' > */usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/*.*/apipie/*../abstract.rb:22:in > `run' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:106 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > [root@satellite ~]# > > > Thanks, > IB > >

I got it working after running an update on the packages from katello:
yum update rubygem-hammer_cli rubygem-hammer_cli_foreman

Apparently the repos were not being updated and that caused a versioning
issue.

Thanks!

IB

··· On 08/11/2014 03:17 PM, Adam Price wrote: > Ignacio, > > I see `undefined method `lazy_subcommand' for > HammerCLI::MainCommand:Class`. Would you run `gem list` for me and > paste the output? I'm wondering if you managed to get a different > version of hammer_cli that's not compatible with hammer_cli_katello. > > On Thursday, August 7, 2014 1:03:16 PM UTC-4, Ignacio Bravo wrote: > > > From a fresh CentOS 6 installation, all modules seem to be > installed correctly, but when trying to use the hammer_cli_katello > commands, they are not available. I can see the hammer foreman > commands, but not the ones from katello. > A while ago I created a script to install and configure a katello > server from scratch from the GIT repositories. There are no errors > on the execution and I don't know where to look at. Here is the > script: > > > *# Start with a fresh install of CentOS > *yum -y update > yum install -y git ruby rubygems > > *# Install Installer * > git clone https://github.com/Katello/katello-deploy.git > > cd katello-deploy > ./setup.rb centos6 --skip-installer > > *# Run Installer * > katello-installer --foreman-admin-password="changeme" > --foreman-authentication=true --capsule-tftp=true > --capsule-tftp-servername="10.10.10.10" --capsule-dhcp=true > --capsule-dhcp-gateway="10.10.10.10" > --capsule-dhcp-interface="eth1" --capsule-dhcp-range="10.10.10.20 > 10.10.10.200" --capsule-dns=true --capsule-dns-forwarders > "10.10.10.10" --capsule-dns-interface="eth1" > --capsule-dns-reverse="10.10.10.in-addr.arpa" --capsule-dns-zone > "hq.ltg" > > *# Here is the error. > *After installing, the following command gives the hammer cli > katello error: > hammer -u admin -p changeme organization create --name Test_Cloud7 > --description "Cloud Servers in VM internal network" > Warning: An error occured while loading module hammer_cli_katello > > > And here is the copy of the logs: > [root@satellite ~]# hammer -d log > [ INFO 2014-08-07 12:08:18 Init] Initialization of Hammer CLI > (0.1.1) has started... > [DEBUG 2014-08-07 12:08:18 Init] Running at ruby 1.8.7-p352 > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli_config.yml has been loaded > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli.modules.d/foreman.yml has been loaded > [ INFO 2014-08-07 12:08:18 Init] Configuration from the file > /etc/hammer/cli.modules.d/katello.yml has been loaded > [DEBUG 2014-08-07 12:08:19 Connection] Registered: foreman > [Foreman] username: admin > [Foreman] password for admin: > [DEBUG 2014-08-07 12:08:24 API] Global headers: { > "Accept-Language" => "en", > :content_type => "application/json", > :accept => "application/json;version=2" > } > [ INFO 2014-08-07 12:08:25 Modules] Extension module > hammer_cli_foreman (0.1.1) loaded > [ERROR 2014-08-07 12:08:25 Modules] Error while loading module > hammer_cli_katello > Warning: An error occured while loading module hammer_cli_katello > [ERROR 2014-08-07 12:08:25 Modules] undefined > method `lazy_subcommand' for HammerCLI::MainCommand:Class > /usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/lib/hammer_cli_katello.rb:27 > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in > `gem_original_require' > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in > `require' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:60:in > `require_module' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:39:in > `load!' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:54:in > `load' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:65:in > `load_all' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:in > `each' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli/modules.rb:64:in > `load_all' > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:93 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > [DEBUG 2014-08-07 12:08:25 Init] Using locale 'en' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain > 'hammer-cli' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/locale' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain > 'hammer-cli-foreman' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.1.1/locale' > [DEBUG 2014-08-07 12:08:25 Init] 'mo' files for locale domain > 'hammer-cli-katello' loaded from > '/usr/lib/ruby/gems/1.8/gems/hammer_cli_katello-0.0.4/locale' > [ INFO 2014-08-07 12:08:25 HammerCLI::MainCommand] Called with > options: {"option_debug"=>true} > [ERROR 2014-08-07 12:08:25 Exception] Error: No such sub-command > 'log' > > See: 'hammer --help' > Error: No such sub-command 'log' > > See: 'hammer --help' > [ERROR 2014-08-07 12:08:25 Exception] > > Clamp::UsageError (No such sub-command 'log'): > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:28:in > `find_subcommand_class' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:17:in > `instatiate_subcommand' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:10:in > `execute' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in > `run' > //usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/lib/hammer_cli//.//apipie//../abstract.rb:22:in > `run' > /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run' > > /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.1.1/bin/hammer:106 > /usr/bin/hammer:19:in `load' > /usr/bin/hammer:19 > [root@satellite ~]# > > > Thanks, > IB > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Foreman users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/foreman-users/TnEKPbDiuIU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > foreman-users+unsubscribe@googlegroups.com > . > To post to this group, send email to foreman-users@googlegroups.com > . > Visit this group at http://groups.google.com/group/foreman-users. > For more options, visit https://groups.google.com/d/optout.