Bug #12195
closed
- Translation missing: en.field_release deleted (
73)
Thanks for the report, I see two issues in this ticket - 1) it tries to delete nodes and clients regardless of settings, 2) the deletion fails.
Ad 1) did you restart httpd (foreman) after you changed the value? What is your use case of not deleting data from chef-server? (I wonder if it should be disabled by default)
Ad 2) what is your smart_proxy_chef version? A new version fixing deletion API responses was published recently. Make sure you have 0.1.5 installed (and proxy restarted after updating).
I had the same issue just because I had foreman_chef installed - haven't even really configured or used it.
Hosts were deleted, but gave this error at the end.
So I suppose indeed it should be checked for nil at line 132 as suggested or with "if run.value && run.value.error?"
It does try to delete nodes regardless of the setting, but it still actually does delete the host in the Foreman.
I did restart my httpd service (NGINX) after I changed the value, and I also touched 'tmp/restart.txt' inside the app for good measure. My use case for not deleting hosts from the Chef server is that I want to orchestrate that through our own means. There are a lot of other records in our various services that should also be deleted when a host is a removed (e.g. DNS, AD, Logging, etc...). I do think auto_deletion should be set to false by default as I would suspect our case wouldn't be unique.
I was using smart_proxy_chef version 0.1.4; I just updated to 0.1.5 and the problem still remains.
If you need anymore information please let me know!
It seems that there might be issue with dynflow executor not running. How did you install your foreman, was it using packages or gems? Could you try starting an executor with
RAILS_ENV=production rake foreman_tasks:dynflow:executor
and retry the deletion?
EDIT: I reproduced it locally and it helped
- Project changed from Chef to foreman-tasks
- Category deleted (
foreman_chef)
Moving this issue to foreman-tasks to make the error message clearer.
I installed my Foreman the manual way (i.e. git repo, & bundle commands) as I find it's easier to update when it's installed like this.
I ran the rake task and deleted a host and it worked! No errors. Do I need to setup a background task for this?
Yes, you need to have the executor running. We should document this and fix foreman-tasks so it does display a better error message.
- Related to Bug #12259: Host deletion generates error: undefined method `error?' for nil:NilClass added
Thanks for your help, Marek! I've created a service script for dynflow-executor. It assumes you're running dynflow-executor inside an RVM environment, and it should be easy enough to modify for those that aren't doing this.
https://gist.github.com/Ginja/fb123759d48b04b5f338
awesome, thank you, we should probably put this in gem docs
Marek Hulán wrote:
awesome, thank you, we should probably put this in gem docs
Also getting some variation on this where in 1.10rc2 and foreman_chef 0.2.0 it's Not actually deleting the clients/nodes from the chef server. I didn't install from the ground up, I used the installer (for both chef and foreman_chef) on ubuntu trust 14.04.03
- Status changed from New to Ready For Testing
- Assignee set to Marek Hulán
- Pull request https://github.com/theforeman/foreman-tasks/pull/149 added
- Status changed from Ready For Testing to Resolved
I created a PR with the example service file. If the deletion still does not work it can be a different bug, could you please open a new issue with logs from failed deletion if you still encounter it (probably against foreman-chef project)? Closing this as resolved.
Also available in: Atom
PDF