UaServer can't register with LDS

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
tuan_phan
Jr. Member
Jr. Member
Posts: 1
Joined: 20 Jul 2017, 08:16

UaServer can't register with LDS

Post by tuan_phan »

I have installed the UA Local Discovery Server (LDS) and edit ualds.ini file. Purpose for allow when UaServer register LDS without security

Code: Select all

[General]
# The OPCUA application uri used by the LDS.
ServerUri = urn:[gethostname]:UALocalDiscoveryServer

# maximum age of registered server entries before they expire in seconds. (Default=600)
ExpirationMaxAge = 600

# AllowLocalRegistration: (default=no) this will disable certificate trust checks for connections comming from
# localhost. Note that this is a security risk. Only enable this feature if you are aware of the full implications.
AllowLocalRegistration = yes

# Endpoint configuration
# Number of available endpoints
Endpoints/size = 1
Endpoints/0/Url = opc.tcp://[gethostname]:4840
Endpoints/0/SecurityPolicies = SecurityPolicy_None

[SecurityPolicy_None]
Url = http://opcfoundation.org/UA/SecurityPolicy#None
MessageSecurity = None


Then I register to LDS, see logfile :
[*]
ServerUri '' is invalid (needs to start with 'urn:' or 'http://')
[*]

So I can't register with LDS.

Any idea of where could be the mistake?

Thank you very much,

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: UaServer can't register with LDS

Post by Support Team »

Yes, read the error message. The problem is that the ServerUri is invalid. Your server seems to send an empty ApplicationUri. That is not allowed by OPC UA standard.
Check your server configuration to provide a valid ApplicationUri.
In our C++ DemoServer for example you can set the Uri in the ServerConfig.xml:

Code: Select all

<ServerUri>urn:[NodeName]:UnifiedAutomation:UaServerCpp</ServerUri>
Best regards
Unified Automation Support Team

joshua.eliser
Jr. Member
Jr. Member
Posts: 3
Joined: 03 Jan 2020, 18:24

Re: UaServer can't register with LDS

Post by joshua.eliser »

Sorry to post on an old thread, but I'm having a problem with registering with the OPCUA LDS. I completely started over by using a fresh checkout of the LDS and the UA C++ SDK. I'm using the latest LDS application from the OPC Foundation (https://github.com/OPCFoundation/UA-LDS) and I'm using the UA SDK server examples. There is a section in the UA configuration for DiscoveryRegistration, and there is note for enabling the Url of the LDS. I did that in the UA configuration below ...

Code: Select all

        <!--Discovery configuration
            Configuration for registration with discovery server(s)-->
        <DiscoveryRegistration>
            <!--Flag indicating if the certificates should be exchanged with the windows certificate store -->
            <AutomaticCertificateExchange>false</AutomaticCertificateExchange>
            <!--Path of the local discovery server trust list. This is where the server copies it's certificate to
                if the file based store of the new LDS is used. -->
            <DiscoveryServerTrustListLocation></DiscoveryServerTrustListLocation>
            <!--Store name used for the local discovery server in the windows certificate store -->
            <DiscoveryServerStoreName>UA Applications</DiscoveryServerStoreName>
            <!--Certificate name of the local discovery server in the windows certificate store -->
            <DiscoveryServerCertificateName>UA Local Discovery Server</DiscoveryServerCertificateName>
            <!--Interval in milliseconds for registration with discovery server(s) -->
            <RegistrationInterval>30000</RegistrationInterval>
            <!--List of discovery servers to register with.
                If the list is empty, no registration is executed.
                Default is opc.tcp://localhost:4840 for the local discovery server.
                Additional remote discovery servers can be added -->
            <Url>opc.tcp://127.0.0.1:4840</Url>
        </DiscoveryRegistration>
        <!--Discovery configuration end-->
When the UA server example starts up and performs the LDS registration, the LDS application is closing the channel due to an error.

Code: Select all

Fri Jan  3 10:30:43 [11933]: Server startup complete. Host name is jeliser-thinkpad-x1.
Fri Jan  3 10:30:43 [11933]: Using certificate store at /opt/opcfoundation/ualds/pki/...
Fri Jan  3 10:30:43 [11933]: Opening endpoint 'opc.tcp://127.0.0.1:4840'...
Fri Jan  3 10:30:43 [11933]: Endpoint is open.
Fri Jan  3 10:30:45 [11933]: ualds_endpoint_callback called: Event=SecureChannelOpened, SecureChanneldId=0x00000001, uStatus=0x00000000
Fri Jan  3 10:30:45 [11933]: ualds_endpoint_callback: SecureChannel 0x00000001 opened with http://opcfoundation.org/UA/SecurityPolicy#None in mode 1 status 0x00000000!
Fri Jan  3 10:30:45 [11933]: [uastack] OpcUa_SecureListener_ProcessRequest: Closing channel due error 0x800B0000!
0x800B0000 corresponds to a UA_SCBADSERVICEUNSUPPORTED (https://documentation.unified-automatio ... e90a436aee). I'm at a loss where to go from here. I looked through the UA server base class and didn't find anything that jumped out at me. I thought maybe there was a virtual method or something that was missing, but I couldn't find anything.

Thanks again for the help!

joshua.eliser
Jr. Member
Jr. Member
Posts: 3
Joined: 03 Jan 2020, 18:24

Re: UaServer can't register with LDS

Post by joshua.eliser »

Also, I'm using the demo version of the SDK while the PO is being processed. Is the discovery component of the server note included with the demo SDK?

joshua.eliser
Jr. Member
Jr. Member
Posts: 3
Joined: 03 Jan 2020, 18:24

Re: UaServer can't register with LDS

Post by joshua.eliser »

We've purchased the licensed version of the UA C++ SDK and I'm still having the same problem. The UA server examples is unable to register with the LDS.

Post Reply