Project

General

Profile

Actions

Bug #3570

closed

Error during delete an Host

Added by Olivier Cruilles over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

NoMethodError
undefined method `[]' for nil:NilClass
app/controllers/hosts_controller.rb:120:in `destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

Thank in advance
Olivier


Files

Foreman_log_Bug_#3570.log Foreman_log_Bug_#3570.log 22.3 KB Foreman_log_Bug_#3570.log Olivier Cruilles, 11/05/2013 01:59 PM
Foreman_log_Bug_#3570_v2.log Foreman_log_Bug_#3570_v2.log 15.4 KB Foreman_log_Bug_#3570_v2.log Olivier Cruilles, 11/05/2013 02:03 PM
Foreman_log_Bug_#3570_v3.log Foreman_log_Bug_#3570_v3.log 39.9 KB Foreman_log_Bug_#3570_v3.log Olivier Cruilles, 11/05/2013 02:48 PM
Actions #1

Updated by Dominic Cleal over 10 years ago

  • Status changed from New to Need more information

Can you provide any more details?

Which version of Foreman is it exactly? (RPM or deb version)
Is this all hosts, or only certain ones?
Can you run Foreman in debug mode and gather logs of the entire request? http://projects.theforeman.org/projects/foreman/wiki/Troubleshooting#How-do-I-enable-debugging

Actions #2

Updated by Olivier Cruilles over 10 years ago

Foreman version 1.3.0-1.el6
Centos 6.4

I have no more than 2 hosts configured + the smart-proxy itself.

So for the 2 hosts, same problem.

Log resulting after deleting the both hosts:

D, [2013-11-04T14:24:31.712633 #24057] DEBUG -- : Found puppetca at /usr/sbin/puppetca
D, [2013-11-04T14:24:31.712862 #24057] DEBUG -- : Found sudo at /usr/bin/sudo
D, [2013-11-04T14:24:31.712969 #24057] DEBUG -- : Executing /usr/bin/sudo S /usr/sbin/puppetca --ssldir /var/lib/puppet/ssl --clean 7f93d42a-ab40-405e-9f7b-da8c58c1e362
I, [2013-11-04T14:24:32.769862 #24057] INFO -
: Attempt to remove nonexistant client certificate for 7f93d42a-ab40-405e-9f7b-da8c58c1e362
E, [2013-11-04T14:24:32.770331 #24057] ERROR -- : Attempt to remove nonexistant client certificate for 7f93d42a-ab40-405e-9f7b-da8c58c1e362
I, [2013-11-04T14:24:32.922866 #24057] INFO -- : Attempt to remove nonexistant client autosign for 7f93d42a-ab40-405e-9f7b-da8c58c1e362
E, [2013-11-04T14:24:32.923026 #24057] ERROR -- : Attempt to remove nonexistant client autosign for 7f93d42a-ab40-405e-9f7b-da8c58c1e362

Actions #3

Updated by Olivier Cruilles over 10 years ago

After some tries, I can create new Hosts but not delete them.

Say to me if it's the log is suffisient to troubleshoot this problem.

Actions #4

Updated by Dominic Cleal over 10 years ago

I'm not sure those errors in the logs are the failure reason or not. Can you follow the debug enabling instructions I linked and then supply the request logs from /var/log/foreman/production.log?

Actions #5

Updated by Olivier Cruilles over 10 years ago

Hi,

This is the full log, sorry for the delais.

Olivier

Actions #6

Updated by Dominic Cleal over 10 years ago

The error in the logs indicates a problem with tokens and database keys, which is bug #3468. Could you try clicking the Cancel Build button on the host page (which deletes the token) and then try deleting the host?

Actions #8

Updated by Dominic Cleal over 10 years ago

The error's coming from the puppetdb_foreman plugin, I think because its configuration is missing. Our RPM does contain an example config in /usr/share/foreman/config/settings.plugins.d/, so I think if you just move that into place and restart Foreman it will work.

Maybe the RPM should deploy a config that's disabled by default and provide the example as well.

Actions #9

Updated by Olivier Cruilles over 10 years ago

Can you tell me exactly where I need to move this file ?
I assume that I must rename this file like this: puppetdb_foreman.yaml

I tried to rename this example file in the same directory then restarted httpd service (httpd+passenger) and restarted foreman service.

Actions #10

Updated by Olivier Cruilles over 10 years ago

After restarted services, nothing change, same error deleting host.

Actions #11

Updated by Olivier Cruilles over 10 years ago

Ok, now after this modification, a different error message appair:

RuntimeError
Could not deactivate host: getaddrinfo: Name or service not known
app/controllers/hosts_controller.rb:120:in `destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'

So, why can not destroy this host if this host does not exist in DNS server.
I assume that is a king of protection (may be) but I trying Foreman for the moment and I do some test.
Is there a way to destroy it without declare it in the DNS or not ?
Thank you in advance

Actions #12

Updated by Dominic Cleal over 10 years ago

I can't tell if that's the problem or not from that short log snippet, could you provide debug logs again? If you still have the puppetdb_foreman plugin installed and enabled then you would need to ensure that config file is correct or it might generate this error trying to contact a non-existent PuppetDB server. Perhaps you want to uninstall the RPM if you're not using it.

Actions #14

Updated by Dominic Cleal over 10 years ago

So yes, it's the puppetdb_foreman plugin trying to contact a non-existent server, see my previous reply. I'd suggest uninstalling or disabling it if you're not intending to use or configure it.

Actions #15

Updated by Olivier Cruilles over 10 years ago

Ok, after disabled puppetdb_plugin in Foreman, I been able to delete this host.

So, in fact it was not a bug but an mistake from me about best practice configuring Foreman+puppet.

Thank you for all

You can close this ticket.

Actions #16

Updated by Dominic Cleal over 10 years ago

  • Tracker changed from Bug to Support
  • Assignee set to Dominic Cleal

No problem, glad it's sorted.

Actions #17

Updated by Dominic Cleal over 10 years ago

  • Tracker changed from Support to Bug
  • Status changed from Need more information to Rejected
Actions #18

Updated by Dominic Cleal over 10 years ago

I've added a default "disabled" config now into the plugin package, hopefully it'll stop any more people tripping over the same issue.

Actions

Also available in: Atom PDF