Page 1 of 1

Configuration database locking issue?

Posted: Fri May 16, 2014 5:39 pm
by nytstevenlu
Hi,

I encountered this strange behavior a few times when I tried to remove a host using the nagiosql command:

First I "deleted" the services associated with the host using nagiosql_delete_service.php with the --config flag, the script output told me "14 services deleted successfully!" (there were 14 services on that host). However when I tried to delete the host using nagiosql_delete_host.php it told me "Host has dependent relationships", which should never happen *if* the delete_service script did its job. Then I ran the nagiosql_delete_service.php script again using the same argument, and it claimed "14 services deleted successfully!" again...I did that 4-5 times however the database entries remained untouched regardless of the "success" messages. And after a 5-min coffee break I tried the commands one more time and this time the services were really removed and I was finally able to remove the host.

Could there be some kind of database locking? Is this expected? And how do I troubleshoot if I see this kind of behavior again?

Thanks,
Steven

Re: Configuration database locking issue?

Posted: Mon May 19, 2014 12:21 pm
by lmiltchev
Steven,

There is definitely something buggy here - I was able to recreate the issue for two of my hosts, but then all of a sudden it worked (not only for these two hosts, but also for a few more that I tried)... The results are not consistent with what one might expect. We will need to do some more digging into this.

Re: Configuration database locking issue?

Posted: Mon May 19, 2014 2:47 pm
by nytstevenlu
I did run some more tests over the weekend, and the results were also not consistent. Thanks a lot for looking into this!

Re: Configuration database locking issue?

Posted: Mon May 19, 2014 5:01 pm
by lmiltchev
It seems like this happens when the apply configuration (reconfigure_nagios.sh) hasn't been run within the last hour. Cookie files don't get updated properly. We have an internal bug report already filed in (Task ID = 2815).