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

A service discovery issue on Linux #427

Open
ganfm opened this issue Jan 10, 2025 · 6 comments
Open

A service discovery issue on Linux #427

ganfm opened this issue Jan 10, 2025 · 6 comments

Comments

@ganfm
Copy link

ganfm commented Jan 10, 2025

After deploying Avahi on Linux and running ‘nmos-cpp-node’, the log printed 'After DNSServiceBrowse DNSServiceBrowseReply received error: -65537‘. From the Avahi source code, I found that the reason for this error code is unknown (kDNServiceErrUnUnknown). How can I solve this problem? Thanks a lot for your help.

@garethsb
Copy link
Contributor

Please run nmos-cpp-node with a config.json setting "logging_level": -40 and share the whole log.

@ganfm
Copy link
Author

ganfm commented Jan 11, 2025

Please run nmos-cpp-node with a config.json setting "logging_level": -40 and share the whole log.
Thank you very much for taking the time to answer my question. I have attached the complete log below. From the log, it It looks like there are three error codes (i.e. -65544 -65548 -65537). Hope you can provide us with some ideas for solving the problem. Thanks again.

------------------------------------------------Here is the log------------------------------------------------------------------------
Build settings: cpprestsdk/2.10.16 (listener=asio; client=asio); WebSocket++/0.8.2; Boost 1.72.0; OpenSSL 1.1.1q 5 Jul 2022
Initial settings: {"host_address":"10.40.50.248","host_addresses":["10.40.50.248","10.40.50.41"],"label":"Nova Star","seed_id":"6ba900a4-a54c-4421-848c-fdd36a8c2098"}
2022-11-09 07:25:24.167: info: 281472854093856: Configuring nmos-cpp node with its primary Node API at: http://10.40.50.248:3212/x-nmos/node/v1.3
2022-11-09 07:25:24.317: info: 281472854093856: Preparing for connections
2022-11-09 07:25:24.321: too much info: 281472796782784: asio::init_asio
*** WARNING *** The program 'nmos-cpp-node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
*** WARNING *** The program 'nmos-cpp-node' called 'DNSServiceCreateConnection()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
2022-11-09 07:25:24.323: error: 281472678097088: DNSServiceCreateConnection reported error: -65544
*** WARNING *** The program 'nmos-cpp-node' called 'DNSServiceCreateConnection()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/blog/projects/avahi-compat.html
2022-11-09 07:25:24.324: too much info: 281472796782784: set_validate_handler
2022-11-09 07:25:24.324: too much info: 281472796782784: set_open_handler
2022-11-09 07:25:24.324: too much info: 281472796782784: set_close_handler
2022-11-09 07:25:24.324: too much info: 281472796782784: set_message_handler
update model setting at node_implementation_init, current settings is = {"host_address":"10.40.50.248","host_addresses":["10.40.50.248","10.40.50.41"],"label":"Nova Star","seed_id":"6ba900a4-a54c-4421-848c-fdd36a8c2098"}
Start create node, node id = d9b54692-c8b2-58df-8927-814f21d917a2
Create node success
Start add device & receiver
2022-11-09 07:25:24.324: too much info: 281472796782784: asio::listen
2022-11-09 07:25:24.324: info: 281472796782784: asio listen error: system:98 (Address already in use)
2022-11-09 07:25:24.324: info: 281472796782784: listening with IPv6 failed; retrying with IPv4 only
2022-11-09 07:25:24.325: too much info: 281472796782784: asio::listen
2022-11-09 07:25:24.325: info: 281472796782784: asio listen error: system:98 (Address already in use)
2022-11-09 07:25:24.326: too much info: 281472796782784: asio::init_asio
2022-11-09 07:25:24.325: error: 281472593555648: DNSServiceCreateConnection reported error: -65544
2022-11-09 07:25:24.330: info: 281472266989760: Updated model with node: d9b54692-c8b2-58df-8927-814f21d917a2
2022-11-09 07:25:24.330: too much info: 281472266989760: Notifying node behaviour thread
2022-11-09 07:25:24.333: more info: 281472283898048: Trying System API discovery
2022-11-09 07:25:24.334: info: 281472283898048: Attempting discovery of a System API in domain: .
2022-11-09 07:25:24.335: info: 281472492105920: DNSServiceBrowse for regtype: _nmos-system._tcp domain: . on interface: 0
2022-11-09 07:25:24.336: too much info: 281472796782784: set_validate_handler
2022-11-09 07:25:24.336: too much info: 281472796782784: set_open_handler
2022-11-09 07:25:24.336: too much info: 281472796782784: set_close_handler
2022-11-09 07:25:24.336: too much info: 281472796782784: set_message_handler
2022-11-09 07:25:24.336: too much info: 281472796782784: asio::listen
2022-11-09 07:25:24.336: info: 281472796782784: asio listen error: system:98 (Address already in use)
2022-11-09 07:25:24.336: info: 281472796782784: listening with IPv6 failed; retrying with IPv4 only
2022-11-09 07:25:24.337: too much info: 281472796782784: asio::listen
2022-11-09 07:25:24.337: info: 281472796782784: asio listen error: system:98 (Address already in use)
2022-11-09 07:25:24.339: info: 281472854093856: Ready for connections
2022-11-09 07:25:24.353: error: 281472585101504: DNSServiceRegister reported error: -65548 while registering advertisement for: nmos-cpp_node_10-40-50-248:3212._nmos-node._tcp..
2022-11-09 07:25:24.354: more info: 281472399110336: Trying Registration API discovery
2022-11-09 07:25:24.354: info: 281472399110336: Attempting discovery of a Registration API in domain: .
2022-11-09 07:25:24.355: info: 281472449835200: DNSServiceBrowse for regtype: _nmos-register._tcp domain: . on interface: 0
2022-11-09 07:25:24.355: info: 281472424472768: DNSServiceBrowse for regtype: _nmos-registration._tcp domain: . on interface: 0
2022-11-09 07:25:24.359: too much info: 281472492105920: DNSServiceProcessResult for 976ms
2022-11-09 07:25:24.359: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.359: too much info: 281472492105920: DNSServiceProcessResult for 976ms
2022-11-09 07:25:24.359: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.359: too much info: 281472492105920: DNSServiceProcessResult for 975ms
2022-11-09 07:25:24.363: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.363: too much info: 281472492105920: DNSServiceProcessResult for 971ms
2022-11-09 07:25:24.363: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.363: too much info: 281472492105920: DNSServiceProcessResult for 971ms
2022-11-09 07:25:24.367: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.367: too much info: 281472492105920: DNSServiceProcessResult for 968ms
2022-11-09 07:25:24.367: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.367: too much info: 281472492105920: DNSServiceProcessResult for 967ms
2022-11-09 07:25:24.369: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.369: too much info: 281472492105920: DNSServiceProcessResult for 966ms
2022-11-09 07:25:24.369: error: 281472492105920: After DNSServiceBrowse, DNSServiceBrowseReply received error: -65537
2022-11-09 07:25:24.369: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.369: too much info: 281472492105920: DNSServiceProcessResult for 966ms
2022-11-09 07:25:24.375: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.375: too much info: 281472492105920: DNSServiceProcessResult for 960ms
2022-11-09 07:25:24.375: too much info: 281472492105920: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.375: too much info: 281472492105920: DNSServiceProcessResult for 959ms
2022-11-09 07:25:24.381: too much info: 281472449835200: DNSServiceProcessResult for 973ms
2022-11-09 07:25:24.382: too much info: 281472449835200: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.382: too much info: 281472449835200: DNSServiceProcessResult for 973ms
2022-11-09 07:25:24.383: too much info: 281472449835200: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.383: too much info: 281472449835200: DNSServiceProcessResult for 972ms
2022-11-09 07:25:24.386: too much info: 281472424472768: DNSServiceProcessResult for 969ms
2022-11-09 07:25:24.386: too much info: 281472424472768: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.386: too much info: 281472424472768: DNSServiceProcessResult for 969ms
2022-11-09 07:25:24.393: too much info: 281472449835200: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.393: too much info: 281472449835200: DNSServiceProcessResult for 962ms
2022-11-09 07:25:24.393: too much info: 281472449835200: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.393: too much info: 281472449835200: DNSServiceProcessResult for 961ms
2022-11-09 07:25:24.394: too much info: 281472449835200: After DNSServiceBrowse, DNSServiceProcessResult succeeded
2022-11-09 07:25:24.394: too much info: 281472449835200: DNSServiceProcessResult for 960ms
2022-11-09 07:25:24.394: error: 281472449835200: After DNSServiceBrowse, DNSServiceBrowseReply received error: -65537

@garethsb
Copy link
Contributor

Please try adding "domain": "local" to your config.json.

@ganfm
Copy link
Author

ganfm commented Jan 13, 2025

Thanks a lot for your help.I have successfully solved this problem through the above method. Now I have another question that I need your help with. Can I specify a specific network port to send mdns broadcast packets to perform service discovery. In the code, I found that the service discovery is implemented through the DNSServiceBrowse function. Can I configure the 'interacteIdex' parameter to achieve this?

DNSServiceBrowse
(
DNSServiceRef                       *sdRef,
DNSServiceFlags                     flags,
**uint32_t                            interfaceIndex,**
const char                          *regtype,
const char                          *domain,    /* may be NULL */
DNSServiceBrowseReply               callBack,
void                                *context    /* may be NULL */
)

@garethsb
Copy link
Contributor

The lower levels of the DNS-SD implementation in nmos-cpp support that, but the higher level always uses 0 (any interface), see nmos::details::resolve_service.

Why do you need to limit the discovery operation to a single interface?

@ganfm
Copy link
Author

ganfm commented Jan 14, 2025

Thank you very much for your help. This issue has been resolved. At that time, we encountered an issue where mdns packets could not be sent out, so we wanted to specify the network port to investigate the problem. The result was that the corresponding network port did not have multicast enabled. Of course, setting the 'interacte_id' to 0 in the code is always correct.

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

No branches or pull requests

2 participants