BroadbandForum / obuspa

OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent. https://github.com/BroadbandForum/obuspa/wiki
BSD 3-Clause "New" or "Revised" License
93 stars 62 forks source link

Getting HandleCliCommandRemotely(178): connect failed : (err=2) No such file or directory #104

Closed Aymen-halouani closed 7 months ago

Aymen-halouani commented 8 months ago

Hi all, I run obuspa -c get Device.DeviceInfo.SoftwareVersion I get en error : HandleCliCommandRemotely(178): connect failed : (err=2) No such file or directory For info the usp agent is running

Do you have any idea how to fix this ? Thanks in advance

holme-r commented 8 months ago

"obuspa -c' is trying to connect to a Unix domain socket which the USP agent created and is listening on. The location of this is set by CLI_UNIX_DOMAIN_FILE in vendor_defs.h. By default it is "/tmp/usp_cli". Perhaps the USP agent did not have permission for that path ?

holme-r commented 8 months ago

Another case where you can cause this issue is if you start another instance of the agent, then stop it. In this case the second agent 'takes over' the CLI socket from the first, and when you stop the second agent, nothing is listening on the CLI socket. It is quite easy to get into this situation by accident. For example if you forget to put '-c' in 'obuspa -c get', then you're invoking a second agent, and when you realise your mistake and exit this invocation, the damage has been done to the CLI socket.

holme-r commented 7 months ago

We've changed the code so that if you accidentally start a second instance daemon of OBUSPA, instead of stealing the CLI socket, it detects that the first daemon instance is connected, and aborts with an error message. Closing, as a fix to the possible cause of the issue is available in v8.0.2