MAAS sends multiple stop_dhcp_server tasks even though there's no dhcp server running.

Bug #1328656 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Raphaël Badin

Bug Description

As seen here: http://d-jenkins.ubuntu-ci:8080/view/MAAS/job/utopic-adt-maas-manual/24/artifact/results/artifacts/maas-logs/var/log/maas/celery.log the stop_dhcp_server task is failing to stop the dhcp server.

A restart task triggered later on restarted the service. It seems that the MAAS server is trying to stop the dhcp server but fails because it wasn't running in the first place.

Package version: 1.6+bzr2367+2412+278-0ubuntu1

[2014-06-10 16:45:07,400: INFO/MainProcess] Received task: provisioningserver.tasks.stop_dhcp_server[27e5ebdb-66ed-4977-b0d5-de5e4c06e090]
[2014-06-10 16:45:08,055: ERROR/Worker-2] stop_dhcp_server: Command `sudo -n service maas-dhcp-server stop` returned non-zero exit status 1:
stop: Unknown instance:
[2014-06-10 16:45:08,063: ERROR/MainProcess] Task provisioningserver.tasks.stop_dhcp_server[27e5ebdb-66ed-4977-b0d5-de5e4c06e090] raised unexpected: ExternalProcessError()
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 97, in wrapper
    func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 402, in stop_dhcp_server
    call_and_check(['sudo', '-n', 'service', 'maas-dhcp-server', 'stop'])
  File "/usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.py", line 160, in call_and_check
    raise ExternalProcessError(process.returncode, command, output=stderr)
ExternalProcessError

Related branches

Revision history for this message
Diogo Matsubara (matsubara) wrote :
summary: - stop_dhcp_server task fails on utopic
+ stop_dhcp_server task fails
Revision history for this message
Diogo Matsubara (matsubara) wrote :

This is not so much of a problem because there's no maas-dhcp-server service running at the moment but it does pollute the logs which distracts from users debugging real issues

summary: - stop_dhcp_server task fails
+ MAAS sernds multiple stop_dhcp_server tasks even though there's no dhcp
+ server running.
summary: - MAAS sernds multiple stop_dhcp_server tasks even though there's no dhcp
+ MAAS sends multiple stop_dhcp_server tasks even though there's no dhcp
server running.
Revision history for this message
Raphaël Badin (rvb) wrote :

The problem is due to the command "sudo service maas-dhcp-server stop" failing (return code is 1) if the server is not running. If a return code of 1 means the server is stopped (I think that's the only thing it can mean but we need to double check), then the code that calls this command should just ignore this return code instead of stacktracing.

Changed in maas:
importance: Undecided → High
status: New → Triaged
Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → Fix Committed
milestone: none → 1.6.0
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.