×

UniFi Video will reach end-of-support on December 31st, 2020.

For more information, please refer to the official community notice.

UISP - Device Log Analysis

Overview

This article describes some of the most common issues seen in UISP 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 UISP (While Establishing Connection)
  8. Connection Terminated by UISP (While Getting System Info)
  9. UISP 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 UISP server. Check that the device can ping the UISP server and that it can connect to UISP via WebSocket with SSL. There is a detailed tutorial on how to verify this in 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 the UISP hostname. See our UISP - 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 UISP, therefore, no network issue is present, but the connection is closed by UISP 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 UISP or UISP 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 match the AES key designated to it in UISP. There could be several reasons, but the most reliable solution, albeit the longest to configure, would be the following:

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

Shorter solutions with possible disadvantages:

  • Remove the device from UISP, losing device statistics, backups, etc.
  • Use UISP Remote Discovery which fixes the AES key when the device is connected through it. This solution may be limited since some devices are not able to be discovered. 
  • If the device is present in UISP with the triangle error icon and the button 'Reset UISP key' you can use this button to automatically delete the device's AES key record from UISP and insert the generic UISP key into the devices. Immediately after this is done and the device is connected again a new AES key is generated for the device and recorded both in the device (as a device-specific UISP key) and in the UISP records. 

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 UISP key

This error will appear when a device with a badly formatted UISP key tries to connect. An incorrect format could be caused by a forgotten space in the UISP 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 UISP 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 UISP key for any errors.

2. Error with a custom reverse proxy

This error only affects users that are using their own custom proxy between UISP devices. Those devices use WebSocket Secure connection (WSS) for communication with UISP, 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. UISP 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 UISP 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 the UISP certificate.

Connection Terminated by UISP (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 UISP but UISP terminates the connection. It's typically followed by this error in the UISP 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 UISP. Please use the Ubiquiti support request form to create a support ticket. Please add the device support info so that we can identify the cause of this issue. 

Connection Terminated by UISP (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 UISP 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 use the Ubiquiti support request form to create a support ticket. We would like to know your device model, firmware version, and see the UISP logs and device support info.

UISP 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 UISP 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 UISP connection in the device's UI.
  2. Copy the UISP 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

UISP - How to Find Logs and Report Bugs

UISP - Reverse Proxy

UISP - Connecting Devices in Private IP Range

UISP - Device Discovery

Was this article helpful?
0 out of 2 found this helpful