SystemLink Forum

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -251042 The web server responded with error 401 Unauthorized

Hi,

 

cRIO: LabVIEW 2020, NI Linux image 20.5

Systemlink: 2023 Q3

 

We have 8 cRIOs running 24/7, with tags and tdms files being pushed to Systemlink.

 

Over the weekend, we had an issue after midnight.  The cRIO rebooted itself via watchdog.

 

When we started back up, we got this error:

 

{"status":true;

"code":-251042;

"source":"NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001<ERR>\nThe web server responded with error 401 Unauthorized.\n\n\n<b>

 

Response body:</b>\n<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>401 Unauthorized</title>\n</head><body>\n<h1>Unauthorized</h1>\n<p>This server could not verify that you\nare authorized to access the document\nrequested. Either you supplied the wrong\ncredentials (e.g.; bad password); or your\nbrowser doesn't understand how to supply\nthe credentials required.</p>\n</body></html>\n\n\n\n<b>

 

Complete call chain:</b>\n NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001\n NI Skyline Utilities.lvlib:Execute HTTP Verb.vi:7500001\n NI Skyline Tag HTTP Library.lvlib:Multi Write Core.vi:5310001\n NI Skyline Tag HTTP Library.lvlib:Multi Write.vi:4780001\n NI Skyline Tag HTTP.lvclass:Multi Write HTTP 2.vi:1870001\n NI Skyline Tag.lvclass:Multi Write 2.vi:6740001\n SystemLink.lvlib:Write Tags.vi\n SystemLink.lvlib:Main.vi:4140003\n SystemLink.lvlib:Main.vi.ACBRProxyCaller.E7F0001D<DQMH>MHL Frame: Send Tags</DQMH><DQMH>Event Handling Loop</DQMH>"}

 

From here on, the cRIO was disconnected from Systemlink, and no further uploads of files or tags from the cRIO to Systemlink were received, and this error continued to appear.

 

Any suggestions on where to look to resolve?  Is the API key we're using timing out?  Is Systemlink not realising that we rebooted, and therefore not allowing the same device with same credentials to reconnect?

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 1 of 6
(330 Views)

I should note that the initial error occurred at Open Tag.vi:

 

20240810_000426,Utilities,Error,

{"status":true;

"code":-251042;

"source":"NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001<ERR>\nThe web server responded with error 401 Unauthorized.\n\n\n<b>Response body:</b>\n<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>401 Unauthorized</title>\n</head><body>\n<h1>Unauthorized</h1>\n<p>This server could not verify that you\nare authorized to access the document\nrequested. Either you supplied the wrong\ncredentials (e.g.; bad password); or your\nbrowser doesn't understand how to supply\nthe credentials required.</p>\n</body></html>\n\n\n\n<b>

 

Complete call chain:</b>\n NI Skyline Utilities.lvlib:Parse HTTP Error.vi:5080001\n NI Skyline Utilities.lvlib:Execute HTTP Verb.vi:7500001\n NI Skyline Tag HTTP Library.lvlib:Open Tag Core.vi:6620001\n NI Skyline Tag HTTP Library.lvlib:Open Tag.vi:1540001\n NI Skyline Tag HTTP.lvclass:Open Tag Core.vi:6620001\n NI Skyline Tag HTTP.lvclass:Open Tag HTTP.vi:3570001\n SystemLink.lvlib:Write Tags.vi\n SystemLink.lvlib:Main.vi:4140003\n SystemLink.lvlib:Main.vi.ACBRProxyCaller.3860001D<DQMH>MHL Frame: Send Tags</DQMH><DQMH>Event Handling Loop</DQMH>"}.,

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 2 of 6
(325 Views)

So, I'm guessing you're using the Open Configuration (HTTP auto) to connect to the server? That pulls the token from the minion to authenticate automatically as the 'automated agent' role.

Is the cRIO still showing up as disconnected in SystemLink? Is it showing up in the Pending Systems list at all?

I'm guessing the server has cached an old public key for that specific client and the client is trying to connect using a different public key. This is an expected behavior after removing the SystemLink Client application and then re-installing it onto the client computer. The SystemLink Client will then create a new public key but the server still has the old public key cached.

To fix this situation you need to delete the cached public key from the SystemLink Server computer, restart the SystemLink Client and approve it again:

  1. On the server: C:\Program Files\National Instruments\Shared\salt-master>salt-key -d <$minion_id of the system>
  2. Restart the cRIO
  3. The cRIO should show up under pending systems for you to re-add

Let me know if that doesn't work, or the steps aren't making sense.

Cheers!

TJ G
0 Kudos
Message 3 of 6
(282 Views)

Hi TJ. 

 

Actually, we're using Open Configuration (API Key). 

 

Does your advice still stand if using this method?

 

Thanks!

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

0 Kudos
Message 4 of 6
(265 Views)

Hmmm, that could depend on how you obtained the API key. Did you use this method to generate it? Using API Key in SystemLink HTTP API - NI. If so, then these instructions likely wouldn't apply.

If you used the minion's API key that is stored on disk, then my instructions would apply.

 

Am I correct that the cRIO is currently plugged in and should be connected to SystemLink, but is currently registering as disconnected?

Cheers!

TJ G
0 Kudos
Message 5 of 6
(240 Views)

Yes TJ, the cRIO is currently plugged in and should be connected to SystemLink, but is currently registering as disconnected. The cRIOs keep performing a refresh job but it fails evey time.

0 Kudos
Message 6 of 6
(227 Views)