Illegal character in hostname (NS_CCM) exception while establishing OPC-UA Communication

We have WinCC OPC-UA server with below details

Host Name: NS_CCM
IP Address: 10.169.57.7
Port: 4862

We have successfully connected third party OPC UA client (using IP address)

But when we are trying to communicate using Ignition OPC-UA, we are getting “Illegal Character in Hostname” Exception

Discover endpoint using IP address (Enclosed few snapshots)

Any help on this, much appreciated

Thanks
Avinash

Underscores are not generally allowed in host names, though many systems do so, and there are ways to support more.

Try setting the “Host Override” advanced property to the IP address you used in the discovery step.

Step 1 :
To trick the system, I have added different host name “NS-CCM3” against IP “10.169.57.7” in Windows/System32/driver/hosts file and tried pinging with new host name.

But same if I go with Ignition discover point, Ignition is discovering original host name from DNS

Step 2:
Tried setting “Host Override” in advance property with IP address, now getting new error “OPC server connection is faulted. Type “Production_ServerType” is not a known server type.” (Enclosed snapshot)

“Production_ServerType” is something the OEE/Downtime modules add. You must be looking at the status for their wrong connection now.

Also, I didn’t realize you were on 7.9.5. It might be worth seeing if this is fixed in 7.9.10 or 7.9.11.

Hi Kevin, I didn’t realize that i have installed older trial version for testing.
I have tried your suggestion on actual production server “7.9.10” and restarted gateway services

Still getting same error “java.net.URISyntaxException: Illegal character in hostname at index 12: opc.tcp://NS_CCM3:4862”

It looks like we’ve added a workaround to 7.9.11 that should make using the IP address on the discovery step and then again in the host override work.

Previously both Ignition and the UA stack it uses relied on Java’s URI class to parse the endpoint URLs, which is a strict implementation that correctly fails to parse URLs that have an underscore in them because it’s not a legal character.

It’s unfortunate that this device uses a Windows hostname with an underscore by default. I’ve seen this previously with people trying to connect to Beckhoff devices.

1 Like

Dear Kevin Thanks for all your help,

I have tried installing newer version of ignition (8.0.1) and i could able to connect OPC-UA successfully.

Yes, it’s fixed in 8.0.x as well.

2 Likes

I’m using Ignition 7.9.7 that has the same issue. In my case, the illegal character (underscore) is in the domain name. Kepware is the OPC server we are connecting to and it gives the fully qualified host name in the endpoint url. Short of upgrading Ignition or changing the domain name, is there any other work around on the Ignition side? I’ve looked for a way to force Kepware to use the ip address instead of host name but haven’t been successful. It appears that it will do that but only if it can’t resolve the host name.

You could try adding a hostname entry to your hosts file that is legal and and points to the Kepware machines IP and then create the connection using that hostname… not sure if that will work or break somewhere else though.

Best bet is an upgrade.

Thanks for the quick reply, Kevin.

I actually tried that already. The host file (on the ignition side) is only used when doing the discovery. Kepware still replies with the URLs and uses the fully qualified host name from the server side.

Unfortunately, this is a validated server so upgrading Ignition is an option that I can do in the short term. Upgrade is planned for next year.

Kevin,

It turned out not to be a road block. Kepware uses the fully qualified computer name when you select the Default network adaptor in the endpoint configuration. If you modify the endpoint to use a specific network adaptor, the endpoint URL changes to the IP address.

Thanks again.

2 Likes