Hammer CLI Import: Issueshttps://projects.theforeman.org/https://projects.theforeman.org/favicon.ico?16970236342018-04-27T09:14:44ZForeman
Redmine Bug #23418 (Rejected): Unable to instanciate a new host via the create host formhttps://projects.theforeman.org/issues/234182018-04-27T09:14:44ZSébastien Bernardsbernard@nerim.net
<p>Creation was working OK before upgrading from 1.16.1 to 1.17.</p>
<p>Now every attemps to create a VM yield an exception :<br /><pre>
| NoMethodError: undefined method `first' for nil:NilClass
| /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:498:in `clone_vm'
| /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:443:in `create_vm'
</pre></p>
<p>I'm joining an extract from the production log with some name expurged.<br />Some of the messages are in french but they are not critical for the understanding.</p> Bug #23323 (Closed): As a hammer user I would like to see "skipped contents" information in a repohttps://projects.theforeman.org/issues/233232018-04-19T02:49:06ZPartha Ajipaji@redhat.com
<p><a class="external" href="http://projects.theforeman.org/issues/22803">http://projects.theforeman.org/issues/22803</a> will provide the ability to skip content in a repo like srpms, drpms, erratum etc.</p>
<p>We would like hammer repository info call to display this information.</p> Bug #23058 (Rejected): Warning: lib/hammer_cli_import/persistentmap.rb:27: warning: constant ::Fi...https://projects.theforeman.org/issues/230582018-03-29T10:54:23ZLukas Zapletal
<p>On every hammer command, this is nightly 1.18.</p> Bug #17589 (Closed): Unable to import, first import content view with id https://projects.theforeman.org/issues/175892016-12-06T10:27:36ZAdam Priceadprice@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1168964">https://bugzilla.redhat.com/show_bug.cgi?id=1168964</a></p>
<p>Description of problem:</p>
<p>when trying to import system profiles with hammer I get the following error:</p>
<p>Import content-host with arguments --csv-file /tmp/exports/system-profiles.csv --export-directory /root/rpm-working-dir Unable to import, first import content view with id 102 Unable to import</p>
<p>How reproducible:</p>
<p>Steps to Reproduce:</p>
<p>1. install satellite 6 on rhel 6.6<br />2. on satellite 5.6 machine run spacewalk-export --entities users,system-profiles<br />3. # mkdir -p /tmp/exports<br />4. # chgrp -R apache /tmp/exports/ # chmod -R 0750 /tmp/exports/<br />5. # hammer import all --directory=/tmp/exports</p>
<p>Actual results:<br />Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Unable to import, first import content view with id 102 Summary No</p>
<p>Expected results:<br />orgs to import or come back with a message why they didnt import</p>
<p>Additional info: mine shows up with 144, so i am assuming the number is based on the system profile or something of that nature</p> Bug #16581 (Rejected): Error while loading module hammer_cli_importhttps://projects.theforeman.org/issues/165812016-09-16T08:20:13ZLukas Pramuk
<p>It seems that hammer_cli_import requires too old hammer_cli_katello:</p>
<pre>
[ERROR 2016-09-16 08:14:00 Modules] Error while loading module hammer_cli_import
Warning: An error occured while loading module hammer_cli_import
[ERROR 2016-09-16 08:14:00 Modules] <Gem::LoadError> Could not find 'hammer_cli_katello' (~> 0.0.6) - did find: [hammer_cli_katello-0.1.0]
</pre> Bug #16558 (Closed): hammer_cli_import fails to load with hammer_cli_katello-0.1.0https://projects.theforeman.org/issues/165582016-09-14T10:34:25ZStephen Benjaminstephen@redhat.com
<p>hammer_cli_import needs compatability with 0.1.0 and a new release with the correct versions in the rpm spec.</p>
<p>hammer_cli_import causes errors in hammer:</p>
<pre>
Warning: An error occured while loading module hammer_cli_import
</pre>
<p>The reason is because of this:<br /> [ERROR 2016-09-14 10:30:16 Modules] <Gem::LoadError> Could not find 'hammer_cli_katello' (~> 0.0.6) - did find: [hammer_cli_katello-0.1.0]</p> Bug #14970 (Closed): Lifecycle environment is searched for multiple times when given as a name.https://projects.theforeman.org/issues/149702016-05-09T10:19:39ZZach Huntington-Meathzhunting@redhat.com
<p>The Katello API is being called multiple times when searching for a lifecycle environment name. The EnvironmentName resolver and LifecyclEnvironmentName resolver can be changed to have it only be called once.</p> Bug #14616 (Closed): hammer import config-file on RHEL7 fails to generate puppet moduleshttps://projects.theforeman.org/issues/146162016-04-13T10:49:20ZThomas McKaythomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325880">https://bugzilla.redhat.com/show_bug.cgi?id=1325880</a> <br /> Description of problem:<br />hammer import config-file on RHEL7 fails to generate puppet modules.<br />It uses "puppet module generate <name>" and on RHEL7 it fails to parse command interview questions at all, while on RHEL6 command output with interview questions is parsed successfully.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch</p>
<p>How reproducible:<br />always on RHEL7</p>
<p>Steps to Reproduce:<br />1. # cat users.csv <br />organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active<br />1,SatelliteQE,1,admin,Admin,Admin,,root@localhost,Satellite Administrator,2014-09-10 19:39:59,2016-04-07 01:00:14,enabled</p>
<p>2. # hammer import organization --verbose --csv-file users.csv <br />Importing from users.csv<br />Creating new organization: SatelliteQE<br />Summary<br /> Created 1 organization.</p>
<p>3. # cat config-files-latest.csv <br />org_id,channel_id,channel,channel_type,path,file_type,file_id,revision,is_binary,contents,delim_start,delim_end,username,groupname,filemode,symbolic_link,selinux_ctx<br />1,3,config-1,normal,/etc/config1,file,3,2,N,config1 file ver.2,{|,|},apache,apache,0,,</p>
<p>4. # hammer import config-file --debug --csv-file config-files-latest.csv --generate-only<br />Importing from config-files-latest.csv<br />Caught EOFError:end of file reached while processing CSV line:
{"org_id"=>"1", "channel_id"=>"3", "channel"=>"config-1", "channel_type"=>"normal", "path"=>"/etc/config1", "file_type"=>"file", "file_id"=>"3", "revision"=>"2", "is_binary"=>"N", "contents"=>"config1 file ver.2", "delim_start"=>"{|", "delim_end"=>"|}", "username"=>"apache", "groupname"=>"apache", "filemode"=>"0", "symbolic_link"=>nil, "selinux_ctx"=>nil}<br />Writing converted files<br />Found module satelliteqe-config_1<br />Caught Errno::ENOENT:No such file or directory @ dir_s_mkdir - /root/puppet_work_dir/satelliteqe-config_1/files while post_import<br />Summary<br /> No action taken.</p>
<p>5. # less import.log:<br />...<br />I, [2016-04-11T08:03:46.664346 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] INFO -- : Importing from config-files-latest.csv<br />D, [2016-04-11T08:03:46.665697 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] DEBUG -- : Removing /root/puppet_work_dir/satelliteqe-config_1<br />E, [2016-04-11T08:03:47.255283 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] ERROR -- : Caught EOFError:end of file reached while processing CSV line:
{"org_id"=>"1", "channel_id"=>"3", "channel"=>"config-1", "channel_type"=>"normal", "path"=>"/etc/config1", "file_type"=>"file", "file_id"=>"3", "revision"=>"2", "is_binary"=>"N", "contents"=>"config1 file ver.2", "delim_start"=>"{|", "delim_end"=>"|}", "username"=>"apache", "groupname"=>"apache", "filemode"=>"0", "symbolic_link"=>nil, "selinux_ctx"=>nil}<br />E, [2016-04-11T08:03:47.255556 <a class="issue tracker-1 status-3 priority-4 priority-default closed" title="Bug: installer text recommends 'rpm -e' instead of 'yum erase', resulting in error (Resolved)" href="https://projects.theforeman.org/issues/17137">#17137</a>] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:146:in `readline'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:146:in `block (2 levels) in generate_module_template_for'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:143:in `each'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:143:in `block in generate_module_template_for'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:199:in `popen_run'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/open3.rb:93:in `popen3'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:141:in `generate_module_template_for'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:193:in `generate_module'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/configfile.rb:251:in `import_single_row'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:527:in `call'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:527:in `block (2 levels) in cvs_iterate'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/importtools.rb:324:in `call'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/importtools.rb:324:in `handle_missing_and_supress'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:526:in `block in cvs_iterate'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/csvhelper.rb:55:in `block in csv_each'<br />/opt/rh/rh-ruby22/root/usr/share/ruby/csv.rb:1739:in `each'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/csvhelper.rb:44:in `csv_each'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:525:in `cvs_iterate'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:533:in `import'<br />/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_import-0.10.23/lib/hammer_cli_import/base.rb:569:in `execute'</p>
<p>Actual results:<br />fails to generate a puppet module (afterwards it is uploaded)</p>
<p>Expected results:<br />generates a puppet module successfully (to be then uploaded onto server)</p> Bug #14615 (Closed): hammer import content-host fails with ISE - Content View and Environment not...https://projects.theforeman.org/issues/146152016-04-13T10:48:12ZThomas McKaythomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325497">https://bugzilla.redhat.com/show_bug.cgi?id=1325497</a> <br /> Description of problem:<br />hammer import content-host fails with ISE - Content View and Environment not set for registration. No content-host are being created.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap6.2<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el7sat.noarch</p>
<p>How reproducible:<br />always</p>
<p>Steps to Reproduce:<br />1. # cat users.csv <br />organization_id,organization,user_id,username,last_name,first_name,position,email,role,creation_time,last_login_time,active<br />1,SatelliteQE,1,admin,Admin,Admin,,root@localhost,Satellite Administrator,2014-09-10 19:39:59,2016-04-07 01:00:14,enabled</p>
<p>2. # hammer import organization --verbose --csv-file users.csv <br />Importing from users.csv<br />Creating new organization: SatelliteQE<br />Summary<br /> Created 1 organization.</p>
<p>3. # cat system-profiles.csv <br />server_id,profile_name,hostname,description,organization_id,organization_name,base_channel_id,base_channel_label,child_channel_id,child_channel_label,system_group_id,system_group,release,architecture,virtual_host,virtual_guest,is_virtualized,virt_type<br />1000010009,profile1,tyan-gt24-01.example.com,,1,Red Hat SatTeam QA,,,,,,,7Server,x86_64,,,No,</p>
<p>4. # hammer -d import content-host --verbose --csv-file system-profiles.csv --export-directory .<br />...<br />Importing from system-profiles.csv<br />Creating new system: profile1<br />[ INFO 2016-04-09 11:25:42 API] POST /katello/api/systems<br />[DEBUG 2016-04-09 11:25:42 API] Params: {<br /> :name => "profile1",<br /> :description => "\nsat5_system_id: 1000010009",<br /> :facts => {<br /> "release" => "7Server",<br /> "architecture" => "x86_64" <br /> },<br /> :type => "system",<br /> :organization_id => 8,<br /> :content_view_id => nil,<br /> :host_collection_ids => []<br />}<br />[DEBUG 2016-04-09 11:25:42 API] Headers: {}<br />[DEBUG 2016-04-09 11:25:43 API] 500 Internal Server Error
{<br /> "displayMessage" => "Content View and Environment not set for registration.",<br /> "errors" => [<br /> [0] "Content View and Environment not set for registration." <br /> ]<br />}<br />Caught RestClient::InternalServerError:500 Internal Server Error while processing CSV line:
{"server_id"=>"1000010009", "profile_name"=>"profile1", "hostname"=>"tyan-gt24-01.example.com", "description"=>nil, "organization_id"=>"1", "base_channel_id"=>nil, "base_channel_label"=>nil, "child_channel_id"=>nil, "system_group_id"=>nil, "release"=>"7Server", "architecture"=>"x86_64", "virtual_host"=>nil, "virtual_guest"=>nil}<br />Summary<br /> No action taken.</p>
<p>Actual results:<br />ISE, no content-host is created</p>
<p>Expected results:<br />content-hosts are successfully created</p> Bug #14614 (Rejected): hammer import activation-key fails to create composite CVshttps://projects.theforeman.org/issues/146142016-04-13T10:45:45ZThomas McKaythomasmckay@redhat.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1325124">https://bugzilla.redhat.com/show_bug.cgi?id=1325124</a> <br /> Description of problem:<br />hammer import activation-key fails to create composite CVs. Import activation-key used to use imported CVs and create composite CV out of them (=grouping base and child channel based CVs togheter).<br />But CV import was broken for sometime so that broken ability to create a composite CV during AK import cannot be simply revealed till now as BZ #1316110 has been fixed.</p>
<p>Version-Release number of selected component (if applicable):<br />@Sat6.2.0-Beta-Snap6.2<br />tfm-rubygem-hammer_cli_import-0.10.23-1.el6sat.noarch</p>
<p>How reproducible:<br />always</p>
<p>Steps to Reproduce:<br />0. Import a organization and upload manifest (manually)</p>
<p>1. Run import repository-enable for RH repositories (manually) and sync 'em (rhel-x86_64-server-7 + rhn-tools-rhel-x86_64-server-7)</p>
2. Prepare csv file for AK import
<ol>
<li>cat activation-keys.csv<br />org_id,token,note,usage_limit,is_disabled,deploys_configs,entitlement,channel_label,base_channel_id,child_channel_id,cfg_channel_pos,server_group,server_group_id,package_name<br />1,1-key,None,,0,N,enterprise_entitled;monitoring_entitled;provisioning_entitled,rhel-x86_64-server-7;rhn-tools-rhel-x86_64-server-7,103;None,None;106,config-1|1,,,</li>
</ol>
3. Run AK import
<ol>
<li>hammer import activation-key --verbose --csv-file activation-keys.csv<br />Importing from activation-keys.csv<br />Creating new activation key: 1-key<br />Creating new ak content view: ak_1<br />Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 1<br />Summary<br /> Created 1 activation_key.</li>
</ol>
<p>Actual results:<br />500 ISE, composite CV not created</p>
<p>Expected results:<br />composite CV successfully created</p>
<p>Additional info:<br />the error message is the same as with BZ #1316110 - undefined method `composite?' for nil:NilClass</p> Bug #14550 (Rejected): hammer import uses obsolete systems apihttps://projects.theforeman.org/issues/145502016-04-08T09:13:49ZThomas McKaythomasmckay@redhat.com
<p>hammer import no longer works for creating content hosts since the removal of systems api</p> Bug #12379 (Rejected): Improve messaging for hammer importhttps://projects.theforeman.org/issues/123792015-11-03T09:53:28ZBryan Kearneybryan.kearney@gmail.com
<p>Cloned from <a class="external" href="https://bugzilla.redhat.com/show_bug.cgi?id=1277501">https://bugzilla.redhat.com/show_bug.cgi?id=1277501</a> <br /> Description of problem:</p>
<p>The standard output from "hammer import repositories" is vague. For a successful import and sync the only output (unless you use -v) is "Summary: No action taken."</p>
<p>Version-Release number of selected component (if applicable):</p>
<p>How reproducible:</p>
<p>Always?</p>
<p>Steps to Reproduce:<br />1. Take a 5.7 export and extract as per user doc<br />2. Import orgs, etc., as described in the doc<br />3. Run "hammer import repositories" as described in the doc:</p>
<ol>
<li>hammer import repository --synchronize --wait --no-async \</li>
</ol>
<blockquote>
<p>--csv-file /tmp/exports/repositories.csv</p>
</blockquote>
<p>[Foreman] Username: admin<br />[Foreman] Password for admin:</p>
<p><several hours later></p>
<p>Summary<br /> No action taken.</p>
<p>Actual results:</p>
<p>The import was successful, as evidenced by hammer organization list and hammer product list, but the message doesn't indicate that.</p>
<p>Expected results:</p>
<p>Something along the lines of "All repositories imported and synchronized successfully."</p>
<p>Additional info:</p>