smehboub / deb_subscription

GNU General Public License v3.0
0 stars 2 forks source link

Problem with Foreman 1.22 and Katello 3.12 #1

Open frankpau opened 5 years ago

frankpau commented 5 years ago

Hi,

when using deb_subscription on a debian 9 system to register with a foreman 1.22/katello 3.12 server i get the following error:

Traceback (most recent call last): File "/usr/local/bin/deb_subscription", line 112, in entry = 'deb%shttps://%s/pulp/deb/%s/%s/%s/%s/%s/%s %s %s\n' % (trusted, KatelloBase.fqdn, org, environment_name, content_view_name, repository['product_type'], repository['product']['name'], repository['name'], release, components) KeyError: 'product_type'

smehboub commented 5 years ago

Hello Frank,

I just made a fix. Can you do : pip install -U deb-subscription

Then retry please

Thanks in advance. Rgs,

Sophian Mehboub

frankpau commented 4 years ago

Hi Sophian,

after updating the package i get the following output:

The operatingsystems Debian 9.9 is not created, the post http request to foreman api failed

jostra commented 4 years ago

Hi I have the same setup Foreman 1.22 and Katello 3.12 and try to register Ubuntu 1804 and I got this error: The operatingsystems Ubuntu 18.04 Bionic is not created, the post http request to foreman api failed

/var/log/foreman/production.log 2019-09-19T14:03:08 [I|app|3a08480c] Processing by Api::V2::OperatingsystemsController#create as JSON 2019-09-19T14:03:08 [I|app|3a08480c] Parameters: {"architectures"=>[{"name"=>"x86_64"}], "major"=>"18", "name"=>"Ubuntu", "family"=>"Ubuntu", "title"=>"Ubuntu 18.04 Bionic", "created_at"=>"2019-09-19 12:03:08 UTC", "release_name"=>nil, "updated_at"=>"2019-09-19 12:03:08 UTC", "minor"=>"04", "password_hash"=>"[FILTERED]", "apiv"=>"v2", "operatingsystem"=>{"major"=>"18", "name"=>"Ubuntu", "minor"=>"04", "created_at"=>"2019-09-19 12:03:08 UTC", "updated_at"=>"2019-09-19 12:03:08 UTC", "release_name"=>nil, "password_hash"=>"[FILTERED]", "title"=>"Ubuntu 18.04 Bionic"}} 2019-09-19T14:03:08 [I|app|3a08480c] Authorized user admin(Admin User) 2019-09-19T14:03:08 [I|app|3a08480c] Current user set to admin (admin) 2019-09-19T14:03:08 [E|app|3a08480c] Unprocessable entity Operatingsystem (id: new): Release name can't be blank

2019-09-19T14:03:08 [I|app|3a08480c] Rendering api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout 2019-09-19T14:03:08 [I|app|3a08480c] Rendered api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout (1.5ms) 2019-09-19T14:03:08 [I|app|3a08480c] Completed 422 Unprocessable Entity in 73ms (Views: 2.8ms | ActiveRecord: 15.8ms)

Regards

frankpau commented 4 years ago

Even creating an operating system inside of foreman with the requested parameters doesn't solve the probem. i have created an OS with the requested parameters from /var/log/foreman/production.log. Now it complains about the DNS Domain: 2019-09-19T14:59:05 [I|app|ccca2ad4] Rendering api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout 2019-09-19T14:59:05 [I|app|ccca2ad4] Rendered api/v2/errors/unprocessable_entity.json.rabl within api/v2/layouts/error_layout (0.6ms) 2019-09-19T14:59:05 [I|app|ccca2ad4] Completed 422 Unprocessable Entity in 32ms (Views: 1.1ms | ActiveRecord: 6.9ms) 2019-09-19T14:59:05 [I|app|60f2df75] Started GET "/api/locations" for at 2019-09-19 14:59:05 +0200 2019-09-19T14:59:05 [I|app|60f2df75] Processing by Api::V2::LocationsController#index as JSON 2019-09-19T14:59:05 [I|app|60f2df75] Parameters: {"apiv"=>"v2", "location"=>{}} 2019-09-19T14:59:05 [I|app|60f2df75] Authorized user admin(Admin User) 2019-09-19T14:59:05 [I|app|60f2df75] Current user set to admin (admin) 2019-09-19T14:59:05 [I|app|60f2df75] Rendering api/v2/taxonomies/index.json.rabl within api/v2/layouts/index_layout 2019-09-19T14:59:05 [I|app|60f2df75] Rendered api/v2/taxonomies/index.json.rabl within api/v2/layouts/index_layout (1.5ms) 2019-09-19T14:59:05 [I|app|60f2df75] Completed 200 OK in 22ms (Views: 1.9ms | ActiveRecord: 5.5ms) 2019-09-19T14:59:05 [I|app|fa6b8c07] Started POST "/api/domains" for at 2019-09-19 14:59:05 +0200 2019-09-19T14:59:05 [I|app|fa6b8c07] Processing by Api::V2::DomainsController#create as JSON 2019-09-19T14:59:05 [I|app|fa6b8c07] Parameters: {"organizations"=>[{"id"=>1}], "fullname"=>nil, "location_id"=>2, "name"=>nil, "apiv"=>"v2", "domain"=>{"name"=>nil, "fullname"=>nil}} 2019-09-19T14:59:05 [I|app|fa6b8c07] Authorized user admin(Admin User) 2019-09-19T14:59:05 [I|app|fa6b8c07] Current user set to admin (admin) 2019-09-19T14:59:05 [E|app|fa6b8c07] Unprocessable entity Domain (id: new): DNS domain can't be blank

benvanloock commented 4 years ago

From personal experience, make sure:

At least, that's what I did to get the debian host into katello. This resulted in a not changed /etc/apt/sources.list file,and an additional list file under /etc/apt/sources.list.d, in my case -Debian9-stretch.list.

jostra commented 4 years ago

@benvanloock yes the solution is to create OS under Hosts -> Operating Systems, then registration works

now I have some new issue, when I try to run apt update then I get this error The key(s) in the keyring /etc/apt/trusted.gpg.d/custom-foreman1.test.local.gpg are ignored as the file has an unsupported filetype.

question: why this script create this key or can I regenerate some how? work around is to remove /etc/apt/trusted.gpg.d/custom-foreman1.test.local.gpg