Problem:
After upgrade from 1.24.2 to 3.2 (1.24->2.0-2.1->2.2->2.3->2.4->2.5->3.0->3.1->3.2) at least one hammer cli command is failing.
hammer proxy import-classes --id 1 --puppet-environment sbx
returns 502
Expected outcome:
Classes imported correctly.
Foreman and Proxy versions:
foreman.noarch 3.2.0-1.el7
foreman-cli.noarch 3.2.0-1.el7
foreman-debug.noarch 3.2.0-1.el7
foreman-dynflow-sidekiq.noarch 3.2.0-1.el7
foreman-ec2.noarch 3.2.0-1.el7
foreman-installer.noarch 1:3.2.0-1.el7
foreman-installer-katello.noarch 1:3.2.0-1.el7
foreman-libvirt.noarch 3.2.0-1.el7
foreman-ovirt.noarch 3.2.0-1.el7
foreman-postgresql.noarch 3.2.0-1.el7
foreman-proxy.noarch 3.2.0-1.el7
foreman-release.noarch 3.2.0-1.el7
foreman-release-scl.noarch 7-3.el7
foreman-selinux.noarch 3.2.0-1.el7
foreman-service.noarch 3.2.0-1.el7
katello.noarch 4.4.0-1.el7
katello-ca-consumer-dapmgmtsbx01.dap.noarch
katello-certs-tools.noarch 2.8.2-1.el7
katello-client-bootstrap.noarch 1.7.8-1.el7
katello-common.noarch 4.4.0-1.el7
katello-debug.noarch 4.4.0-1.el7
katello-default-ca.noarch 1.0-1
katello-repos.noarch 4.4.0-1.el7
katello-selinux.noarch 4.0.2-1.el7
katello-server-ca.noarch 1.0-1
katello-service.noarch 3.14.1-1.el7
Distribution and version:
CentOS 7
[root@dapmgmtsbx01 ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@dapmgmtsbx01 ~]# uname -a
Linux dapmgmtsbx01.dap 3.10.0-1160.53.1.el7.x86_64 #1 SMP Fri Jan 14 13:59:45 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Other relevant data:
Foreman production log doesn’t show any errors:
2022-05-04T08:35:43 [I|app|280520fd] Started GET "/api/locations?search=name+%3D+%22Default+Location%22&per_page=1000&page=1" for 172.16.2.5 at 2022-05-04 08:35:43 +0200
2022-05-04T08:35:43 [I|app|280520fd] Processing by Api::V2::LocationsController#index as JSON
2022-05-04T08:35:43 [I|app|280520fd] Parameters: {"search"=>"name = \"Default Location\"", "per_page"=>"1000", "page"=>"1", "apiv"=>"v2", "location"=>{}}
2022-05-04T08:35:43 [I|app|280520fd] Authorized user admin(Admin User)
2022-05-04T08:35:43 [I|app|280520fd] Rendering api/v2/taxonomies/index.json.rabl within api/v2/layouts/index_layout
2022-05-04T08:35:43 [I|app|280520fd] Rendered api/v2/taxonomies/index.json.rabl within api/v2/layouts/index_layout (Duration: 12.5ms | Allocations: 6460)
2022-05-04T08:35:43 [I|app|280520fd] Completed 200 OK in 118ms (Views: 16.8ms | ActiveRecord: 14.8ms | Allocations: 21611)
2022-05-04T08:35:43 [I|app|ddc5ce76] Started GET "/katello/api/organizations?search=name+%3D+%22Default+Organization%22&per_page=1000&page=1" for 172.16.2.5 at 2022-05-04 08:35:43 +0200
2022-05-04T08:35:43 [I|app|ddc5ce76] Processing by Katello::Api::V2::OrganizationsController#index as JSON
2022-05-04T08:35:43 [I|app|ddc5ce76] Parameters: {"search"=>"name = \"Default Organization\"", "per_page"=>"1000", "page"=>"1", "api_version"=>"v2", "organization"=>{}}
2022-05-04T08:35:43 [I|app|ddc5ce76] Authorized user admin(Admin User)
2022-05-04T08:35:43 [I|app|ddc5ce76] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.4.0.2/app/views/katello/api/v2/organizations/index.json.rabl within api/v2/layouts/index_layout
2022-05-04T08:35:43 [I|app|ddc5ce76] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.4.0.2/app/views/katello/api/v2/organizations/index.json.rabl within api/v2/layouts/index_layout (Duration: 4.1ms | Allocations: 2933)
2022-05-04T08:35:43 [I|app|ddc5ce76] Completed 200 OK in 98ms (Views: 7.1ms | ActiveRecord: 11.3ms | Allocations: 14806)
2022-05-04T08:35:43 [I|app|01b16159] Started GET "/foreman_puppet/api/environments?search=name+%3D+%22sbx%22&per_page=1000&page=1" for 172.16.2.5 at 2022-05-04 08:35:43 +0200
2022-05-04T08:35:43 [I|app|01b16159] Processing by ForemanPuppet::Api::V2::EnvironmentsController#index as JSON
2022-05-04T08:35:43 [I|app|01b16159] Parameters: {"search"=>"name = \"sbx\"", "per_page"=>"1000", "page"=>"1", "apiv"=>"v2", "environment"=>{}}
2022-05-04T08:35:43 [I|app|01b16159] Authorized user admin(Admin User)
2022-05-04T08:35:43 [I|app|01b16159] Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-3.0.5/app/views/foreman_puppet/api/v2/environments/index.json.rabl within api/v2/layouts/index_layout
2022-05-04T08:35:43 [I|app|01b16159] Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-3.0.5/app/views/foreman_puppet/api/v2/environments/index.json.rabl within api/v2/layouts/index_layout (Duration: 4.9ms | Allocations: 1952)
2022-05-04T08:35:43 [I|app|01b16159] Completed 200 OK in 103ms (Views: 8.1ms | ActiveRecord: 10.8ms | Allocations: 13980)
2022-05-04T08:35:43 [I|app|7d433254] Started POST "/api/environments/2/smart_proxies/1/import_puppetclasses" for 172.16.2.5 at 2022-05-04 08:35:43 +0200
2022-05-04T08:35:43 [I|app|7d433254] Processing by Api::V2::SmartProxiesController#import_puppetclasses as JSON
2022-05-04T08:35:43 [I|app|7d433254] Parameters: {"location_id"=>2, "organization_id"=>1, "dryrun"=>false, "apiv"=>"v2", "environment_id"=>"2", "id"=>"1", "smart_proxy"=>{}}
2022-05-04T08:35:43 [I|app|7d433254] Authorized user admin(Admin User)
Hammer in verbose mode also not really helpful:
[DEBUG 2022-05-04T08:35:43 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[ERROR 2022-05-04T08:50:43 API] 502 Bad Gateway
[DEBUG 2022-05-04T08:50:43 API] "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>502 Proxy Error</title>\n</head><body>\n<h1>Proxy Error</h1>\n<p>The proxy server received an invalid\r\nresponse from an upstream server.<br />\r\nThe proxy server could not handle the request <em><a href=\"/api/environments/2/smart_proxies/1/import_puppetclasses\">POST /api/environments/2/smart_proxies/1/import_puppetclasses</a></em>.<p>\nReason: <strong>Error reading from remote server</strong></p></p>\n</body></html>\n"
[DEBUG 2022-05-04T08:50:43 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_general_exception
[ERROR 2022-05-04T08:50:43 Exception] Error: 502 Bad Gateway
Error: 502 Bad Gateway
All services are up and running as they should. At least no errors in the logs or in GUI.
Puppet runs and reports are in Foreman.
puppetserver and puppetdb are installed on the same server as Foreman.
What else I can check?