Skip to content

Bind failure will exit with status code 0 #21

@nagisa

Description

@nagisa

When the address that the velbustcp service ought to bind to is not available, it will exit with a status code 0, indicating success.

This then can lead to service manager to fail to attempt a restart in this failure scenario.

2025-12-07 12:57:37,572 - INFO - bus - Attempting to connect
2025-12-07 12:57:37,574 - ERROR - __main__ - could not bind on any address out of [('192.168.110.2', 27015)]
Traceback (most recent call last):
  File "/nix/store/gs7xkzzcvsb7s07j2n7ssrnxhidr7cl3-python-velbustcp-7eb4da4/lib/python3.13/site-packages/velbustcp/__main__.py", line 69, in main_as>
    loop.run_until_complete(await main.start())
                            ^^^^^^^^^^^^^^^^^^
  File "/nix/store/gs7xkzzcvsb7s07j2n7ssrnxhidr7cl3-python-velbustcp-7eb4da4/lib/python3.13/site-packages/velbustcp/__main__.py", line 39, in start
    await self.__bridge.start()
  File "/nix/store/gs7xkzzcvsb7s07j2n7ssrnxhidr7cl3-python-velbustcp-7eb4da4/lib/python3.13/site-packages/velbustcp/lib/connection/bridge.py", line 4>
    await asyncio.gather(serial_task, tcp_task)
  File "/nix/store/gs7xkzzcvsb7s07j2n7ssrnxhidr7cl3-python-velbustcp-7eb4da4/lib/python3.13/site-packages/velbustcp/lib/connection/tcp/networkmanager>
    await asyncio.gather(*tasks)
  File "/nix/store/gs7xkzzcvsb7s07j2n7ssrnxhidr7cl3-python-velbustcp-7eb4da4/lib/python3.13/site-packages/velbustcp/lib/connection/tcp/network.py", l>
    self.__server = await asyncio.start_server(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<4 lines>...
    )
    ^
  File "/nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/lib/python3.13/asyncio/streams.py", line 84, in start_server
    return await loop.create_server(factory, host, port, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/3lll9y925zz9393sa59h653xik66srjb-python3-3.13.9/lib/python3.13/asyncio/base_events.py", line 1633, in create_server
    raise OSError('could not bind on any address out of %r'
                  % ([info[4] for info in infos],))
OSError: could not bind on any address out of [('192.168.110.2', 27015)]
2025-12-07 12:57:37,577 - INFO - network - Stopped TCP connection ('192.168.110.2', 27015)
2025-12-07 12:57:37,577 - INFO - bus - Serial connection active on port /dev/serial/by-id/usb-Velleman_Projects_VMB1USB_Velbus_USB_interface-if00
2025-12-07 12:57:37,577 - INFO - bus - Stopping serial connection
2025-12-07 12:57:37,577 - INFO - __main__ - Shutdown
2025-12-07 12:57:37,578 - INFO - writerthread - Writer thread cancelled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions