Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log error when at least one list units request fails #649

Merged

Conversation

engelmi
Copy link
Member

@engelmi engelmi commented Nov 17, 2023

Relates to:
#567
#568

When list units for all nodes is run and the requests are submitted, it might happen that one of those is failing. Previously, this led to a failure when reading the message for the node where the request failed - which got propagated to the caller.
Now, an additional error log in BlueChi is made and the error code is extracted from the sd_bus_message.

One option to reproduce this is by registering a bluechi-agent, but not providing the list units method.
Previous error message with bluechictl:

$ bluechictl list-units
Failed to issue method call: Failed to create a reply message: No such device or address
Call to manager failed: Permission denied

New message:

$ bluechictl list-units
Failed to issue method call: Failed to create a reply message: Invalid request descriptor
Call to manager failed: Permission denied

Not sure this is better for the client, but sd_bus_message_get_errno retrieves error code 53 (Invalid request descriptor). The log in bluechi-controller provides more info:

msg="Failed to list units for node 'node1': Object does not exist at path “/org/eclipse/bluechi/internal/agent”"

Relates to:
eclipse-bluechi#567
eclipse-bluechi#568

When list units for all nodes is run and the requests are submitted,
it might happen that one of those is failing. Previously, this led
to a failure when reading the message for the node where the request
failed - which got propagated to the caller.
Now, an additional error log in BlueChi is made and the error code
is extracted from the sd_bus_message.
Also removes the top-most error print in the client to avoid printing
errors twice.

Signed-off-by: Michael Engel <[email protected]>
@engelmi engelmi force-pushed the improve-error-message-list-units branch from c179ea6 to 3ad8042 Compare November 17, 2023 13:00
@engelmi
Copy link
Member Author

engelmi commented Nov 17, 2023

/packit test

@dougsland
Copy link
Contributor

Looks like not related.

 result, output = ctrl.run_python(os.path.join("python", "monitor.py"))
        if result != 0:
>           raise Exception(output)
E           Exception: E
E           ======================================================================
E           ERROR: test_monitor_multiple_nodes_and_units (__main__.TestMonitorMultipleNodesAndUnits)
E           ----------------------------------------------------------------------
E           Traceback (most recent call last):
E             File "/tmp/pljzilvbdp", line 64, in test_monitor_multiple_nodes_and_units
E               assert node_foo.start_unit(service_simple, "replace") != ""
E             File "/usr/lib/python3.9/site-packages/bluechi/api.py", line 574, in start_unit
E               return self.get_proxy().StartUnit(
E             File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 444, in _call_method
E               return self._get_method_reply(
E             File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 477, in _get_method_reply
E               return self._handle_method_error(error)
E             File "/usr/lib/python3.9/site-packages/dasbus/client/handler.py", line 497, in _handle_method_error
E               raise exception from None
E           dasbus.error.DBusError: Method call timed out
E           
E           ----------------------------------------------------------------------
E           Ran 1 test in 30.199s
E           
E           FAILED (errors=1)

@engelmi
Copy link
Member Author

engelmi commented Nov 17, 2023

/packit test --label standard

@engelmi
Copy link
Member Author

engelmi commented Nov 17, 2023

Looks like not related.
...

Yes, probably the testing farm is under quite a bit of load. Restarted the tests.

@dougsland dougsland merged commit 180e3c5 into eclipse-bluechi:main Nov 17, 2023
@engelmi engelmi deleted the improve-error-message-list-units branch February 28, 2024 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants