theforeman / puppetdb_foreman

PuppetDB proxy in Foreman
http://theforeman.org
GNU General Public License v3.0
32 stars 23 forks source link

Unable to delete host from puppetDB via foreman #72

Open demonstrator opened 2 years ago

demonstrator commented 2 years ago

2022-08-10T18:21:58 [I|app|689e8e6f]   Parameters: {"apiv"=>"v2", "id"=>"puppet2.fq.dn"}
2022-08-10T18:24:34 [I|app|41a796ba] Started DELETE "/hosts/puppet2.fq.dn" for nnn.nnn.nnn.nnn at 2022-08-10 18:24:34 +0100
2022-08-10T18:24:34 [I|app|41a796ba]   Parameters: {"authenticity_token"=>"fjNoqGDOU+G8rNiXA7YIlYGsnaXrA9DdqEBWLC3AnL6/UigbAIR21XFDcsBbn6NHCa/iyw3WgcxPq90AE2g7zw==", "id"=>"puppet2.fq.dn"}
2022-08-10T18:24:34 [I|aud|41a796ba] Nic::Managed (80) destroy event on name puppet2.fq.dn
2022-08-10T18:24:34 [I|aud|41a796ba] Host::Base (27) destroy event on name puppet2.fq.dn
2022-08-10T18:24:35 [I|aud|41a796ba] LookupValue (120) destroy event on match fqdn=puppet2.fq.dn
2022-08-10T18:24:35 [I|aud|41a796ba] LookupValue (121) destroy event on match fqdn=puppet2.fq.dn
2022-08-10T18:24:35 [I|aud|41a796ba] LookupValue (122) destroy event on match fqdn=puppet2.fq.dn
2022-08-10T18:24:35 [I|app|41a796ba] Deactivating node in PuppetDB: puppet2.fq.dn
2022-08-10T18:24:35 [W|app|41a796ba] Failed to deactivate node puppet2.fq.dn in PuppetDB: Failed to open TCP connection to localhost:8081 (Permission denied - connect(2) for "localhost" port 8081)
2022-08-10T18:24:35 [I|app|41a796ba] Backtrace for 'Failed to deactivate node puppet2.fq.dn in PuppetDB: Failed to open TCP connection to localhost:8081 (Permission denied - connect(2) for "localhost" port 8081)
2022-08-10T18:24:35 [W|app|41a796ba] Rolling back due to a problem: [#<Orchestration::Task:0x000055699667c730 @name="Deactivating node puppet2.fq.dn in PuppetDB", @id="Deactivating node puppet2.fq.dn in PuppetDB", @status="failed", @priority=60, @action=[#<Host::Managed id: 27, name: "puppet2.fq.dn", last_compile: nil, last_report: nil, updated_at: "2022-08-09 08:04:16", created_at: "2022-05-29 14:13:08", root_pass: nil, architecture_id: 1, operatingsystem_id: 4, ptable_id: 172, medium_id: 15, build: true, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: nil, owner_id: 4, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 1, certname: nil, image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: "build", grub_pass: nil, global_status: 0, lookup_value_matcher: [FILTERED], pxe_loader: "PXELinux BIOS", initiated_at: "2022-05-30 15:02:51", build_errors: nil>, :delPuppetdb], @created=1660152275.160579, @timestamp=2022-08-10 17:24:35.233047143 UTC>]
2022-08-10T18:24:35 [E|app|41a796ba] Task 'Deactivating node puppet2.fq.dn in PuppetDB' *failed*```

I can connect to port 8081 on localhost

# telnet localhost 8081
Trying ::1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> quit

foreman 3.3.0
katello 4.5.0
foreman_puppet 4.0.1
puppetdb_foreman 5.0.0
puppetdb 7.11.0-1
puppetdb-termini 7.11
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)

I have even tried to delete the host using hammer but no luck. If you need any further information please let me know.
demonstrator commented 2 years ago

Is this module still being maintained?

Macleykun commented 1 year ago

hello! happend to see ya issue and i actually had the same problem!

I assume you don't use puppetDB (as it's by default turned off i've read) but funny enough, the puppetdb_enabled is sadly still turned on!

See if turning it off in: Administer > PuppetDB > puppetdb_enabled