ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

REST API regularly returns error with HTTP status 401

book

Article ID: 112276

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

We experience some issues with the REST API.

We use it to request alarms and the probe status for some robots.

Most of the time, the API returns the requested information as expected, but on regular basis it returns HTTP status 401 and sometimes also HTTP status 500.

The user is authorized to request information from the API.

Cause

Appears to be a random issue with querying the LDAP server
In the log we see LDAP errors such as
hub: login [LDAP] - open failed: auth failed: 'Can't contact LDAP server' (81)

hub: do_ldap_query [LDAP] - query failed: ldap_search_ext_s: 'Can't contact LDAP server' (81)



 

Environment

Release:
Component: UIMWSR

Resolution

The HUB is calling open LDAP API's.

The LDAP server is not connecting at some particular time and due to that request for that particular time is failing with
 
'Can't contact LDAP server' (81)
It is happening for milliseconds only. Some time we observed that even after successful LDAP login the next step which required LDAP server communication is failing due to server unreachable. 

On going through the 3rd party LDAP Code flow we have found that LDAP_SERVER_DOWN(error code : 0x51, error text : 'Can't contact LDAP server') return type is generic for all LDAP API's where request is not reaching to server. In our case, sometimes LDAP API's are not reaching the server even after a successfull login.

This means that for that particular time, something happened into network. 

As these are 3rd Party LDAP API's there is nothing in the UIM code at the time of the error
The only option left is to have your networks team identify why some LDAP requests are not reaching the server when others are.

Attachments

1558536731074nimsoft-SDK-HF1.zip get_app