info_i_25x25.png Due to unforeseen weather conditions we are experiencing higher chat wait times. Remember you can also submit a ticket and one of our support representatives will get back to you as soon as possible. We apologize for the inconvenience.

UNMS - Device Log Analysis


Overview


This article describes some of the most common issues seen in UNMS and how they will appear in device logs.


Table of Contents


  1. Introduction
  2. Connection Error
  3. Connection Established and Closed
  4. Problem with AES Encryption
  5. Connection Error HS: ACCEPT Missing
  6. Connection Error with SSL
  7. Connection Terminated by UNMS (While Establishing Connection)
  8. Connection Terminated by UNMS (While Getting System Info)
  9. UNMS Connector Can't Access Local Device Data
  10. How to Switch "udapi-bridge" to Verbose Mode
  11. Related Articles

Introduction


Back to Top

This article is intended for users who would like to analyze their own device logs. The following sections describe some of the most common scenarios along with an explanation of how that issue will appear in the device log.


Connection Error


Back to Top

Generic error

Sep 12 15:20:57 udapi-bridge[978]: connection error (XXX.YYY.ZZZ:443)

This is a generic network error which means that the device can't reach the UNMS server. Check that the device can ping the UNMS server and that it can connect to UNMS via WebSocket with SSL. There is a detailed tutorial on how to verify this on this help article. If the device in question is an EdgeRouter and it is being used as a gateway then it might be a problem with resolving UNMS hostname. See our UNMS - Connecting Devices in Private IP Range article for more information on that.

DNS error

Jun 12 08:10:12 udapi-bridge[27679]: unms: connecting to XXX.YYY.ZZZ:443
Jun 12 08:10:12 udapi-bridge[27679]: connection error (XXX.YYY.ZZZ:443): getaddrinfo (ipv4) failed

This is an error in the DNS settings. It is necessary to check that all DNS settings (even secondary ones) are set up properly. 


Connection Established and Closed


Back to Top

May 30 13:07:50 udapi-bridge[14170]: unms: connecting to XXX.YYY.ZZZ:443
May 30 13:07:50 udapi-bridge[14170]: connection established
May 30 13:07:50 udapi-bridge[14170]: connection closed

The device successfully connects to UNMS, therefore, no network issue is present, but the connection is closed by UNMS within a second or two. The most common cause is the AES key error. If you follow the AES key error troubleshooting guide but you are still getting the same error messages in the device log, search for IP/MAC of the affected device in the log. You should be able to find a specific reason for device disconnection. Either the device was sending data unreadable by UNMS or UNMS may be overloaded. 


Problem with AES Encryption


Back to Top

2017-07-26 11:53:04 ERROR failed to decrypt AES-encrypted message
2017-07-26 11:53:04 ERROR failed to decode message from UNMS 

This error means that the AES key for the device does not a match the the AES key designated to it in UNMS. There could be several reasons, but the most reliable solution, albeit the longest to configure, would be the following:

  1. Disable UNMS and remove the UNMS key in the device's UI.
  2. Click the refresh button on the device in UNMS's device list.
  3. Click the Add Device button in UNMS and copy the UNMS key to the clipboard.
  4. Paste the UNMS key to the device and enable UNMS.
  5. The device should now appear as connected in UNMS

Shorter solutions with possible disadvantages:

  • Remove the device from UNMS, losing device statistics, backups etc.
  • Use UMobile Discovery or UNMS Discovery which fixes the AES key when the device connects with it. This solution is limited by the fact that the Discovery feature must have access to the device in question. For example, it will not be possible with Cloud UNMS.

Connection Error HS: ACCEPT Missing


Back to Top

Nov 15 22:43:17 udapi-bridge[1936]: connection error (XXX.YYY.ZZZ:443): HS: ACCEPT missing

There are two most common reasons for this error:

1. Incorrect UNMS key

This error will appear when a device with a badly formatted UNMS key tries to connect. An incorrect format could be caused by a forgotten space in the UNMS key string or a non-standard character in front of it:

  • Correct:  wss//XXX.YYY.ZZZ:443+...

  • Incorrect:  -wss//XXX.YYY.ZZZ:443+...

There are several ways to incorrectly format a UNMS key, so it is recommended that if this message appears in the log, to first identify which device is the cause, and then check its UNMS key for any errors.

2. Error with a custom reverse proxy

This error only affects users that are using their own custom proxy between UNMS devices. Those devices use WebSocket Secure connection (WSS) for communication with UNMS, therefore the proxy must be configured to handle WebSocket communication with TLS properly on its public-https-port. See our example configurations for Nginx and Apache. UNMS brings its own preconfigured Nginx server, so it is not necessary to place a custom HTTPS proxy.


Connection Error with SSL


Back to Top

Sep  1 16:31:37 udapi-bridge[612]: connection error (XXX.YYY.ZZZ:443): lws_ssl_client_connect2 failed

This logline means that the device doesn't trust the UNMS certificate. There could be multiple reasons for this situation:

  • A device has a wrong time and it'ss necessary to allow NTP service.
  • It is a generic error for UNMS certificate.

Connection Terminated by UNMS (While Establishing a Connection)


Back to Top

Sep  9 14:25:16 udapi-bridge[3300]: peer closed connection (status 1000): Connection terminated by UNMS while establishing connection.
Sep 9 14:25:16 udapi-bridge[3300]: connection closed

This error will appear when the device can reach UNMS but UNMS terminates the connection. It's typically followed by this error in the UNMS log:

WS - problem with establishing connection from <ip of site>, unexpected data: Error: Unsupported state or unable to authenticate data)

In this case, the device returned something unexpected back to UNMS. Please contact us through UNMS community forum, as we will need your device support info to identify the cause of this issue. 


Connection Terminated by UNMS (While Getting System Info)


Back to Top

Jul 28 22:26:41 dapi-bridge[459]: peer closed connection (status 1000): Connection terminated by UNMS while getting system info.

This error means that UNMS can't connect with this device. It could mean that the device's model or firmware is not supported, or that there is a problem with parsing the device info. If you see this error, please contact us via UNMS community. We would like to know your device model, firmware version and see the UNMS logs and device support info.


UNMS Connector Can't Access Local Device Data


Back to Top

2017-08-06 00:37:55 ERROR recv(): socket closed
2017-08-06 00:37:55 ERROR failed to parse header
2017-08-06 00:37:55 ERROR failed to perform EdgeOS socket request
2017-08-06 00:37:55 ERROR connect(): Connection refused
2017-08-06 00:37:55 ERROR failed to initialize stats socket
2017-08-06 00:37:57 ERROR connect(): Connection refused
2017-08-06 00:37:57 ERROR failed to initialize stats socket

These error lines mean that the UNMS connector (udapi-bridge) can't access the local device sockets and receive device statistics and read configuration. In this case, please send us your device support files. See the following section on how to retrieve more information from udapi-bridge in verbose mode.


How to Switch "udapi-bridge" to Verbose Mode


In some cases, it will be necessary to have more information than the one provided in a standard device log. To retrieve this information follow these steps:

  1. Disable the UNMS connection in the device's UI.
  2. Copy the UNMS key.
  3. Connect to the device via SSH.
  4. Run udapi-bridge manually and check its output by typing in this command:
sudo udapi-bridge -v UNMS-KEY

Related Articles


Back to Top

UNMS - How to Find Logs and Report Bugs

UNMS - Reverse Proxy

UNMS - Connecting Devices in Private IP Range

UNMS - Device Discovery