This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

slow response from SWIS API

When i try and fetch the data from SWQL studio for the query

" SELECT TOP 1 NodeID, ObjectSubType, IPAddress FROM Orion.Nodes  " , i get the result instantaneously. 

However when i try to do the same from the query below , it takes around 5-6 mins. 

https://<SolarwindsServerIP>:17778/Solarwinds/InformationService/v3/Json/Query?query=SELECT%20TOP%201%20NodeID,%20ObjectSubType,%20IPAddress%20FROM%20Orion.Nodes%20

What am i doing wrong ?

  • There doesn't appear to be anything wrong with the way you are structuring the URL.  I tried it and got a sub-second response.  This is running in Chrome on my Windows 10 laptop against a VM running in the corporate intranet.  You might want to look at the Network tab in the Chrome DevTools (or the browser tools of your choice) to see if it reveals any clues.  You should also check the SolarWinds Information Service (SWIS) logs.  There is information about that here.  Do you encounter any problems browsing the web pages of Orion from the same location that you're trying to run this query?

    dan_jagnow_0-1588186908825.png

  • The Orion web pages don not have any issues loading or displaying data. 
    Here below is a curl output, 


    J:\>curl -k -v -u testuser:testuser https://<SOLARWINDS_IP>:17778/Solarwinds/InformationService/v3/Json/Query?query=SELECT%20TOP%201%20NodeID,%20ObjectSubType,%20IPAddress%20FROM%20Orion.Nodes%20
    * Trying <SOLARWINDS_IP>...
    * TCP_NODELAY set
    * Connected to <SOLARWINDS_IP>  port 17778 (#0)
    * schannel: SSL/TLS connection with <SOLARWINDS_IP> port 17778 (step 1/3)
    * schannel: disabled server certificate revocation checks
    * schannel: verifyhost setting prevents Schannel from comparing the supplied target name with the subject names in server certificates.
    * schannel: sending initial handshake data: sending 178 bytes...
    * schannel: sent initial handshake data: sent 178 bytes
    * schannel: SSL/TLS connection with solarwinds.fcstone.com port 17778 (step 2/3)
    * schannel: encrypted data got 913
    * schannel: encrypted data buffer: offset 913 length 4096
    * schannel: sending next handshake data: sending 358 bytes...
    * schannel: SSL/TLS connection with <SOLARWINDS_IP> port 17778 (step 2/3)
    * schannel: encrypted data got 91
    * schannel: encrypted data buffer: offset 91 length 4096
    * schannel: SSL/TLS handshake complete
    * schannel: SSL/TLS connection with <SOLARWINDS_IP> port 17778 (step 3/3)
    * schannel: stored credential handle in session cache
    * Server auth using Basic with user 'testuser'
    > GET /Solarwinds/InformationService/v3/Json/Query?query=SELECT%20TOP%201%20NodeID,%20ObjectSubType,%20IPAddress%20FROM%20Orion.Nodes%20 HTTP/1.1
    > Host: <SOLARWINDS_IP>:17778
    > Authorization: Basic dGVzdHVzZXI6dGVzdHVzZXI=
    > User-Agent: curl/7.55.1
    > Accept: */*
    >
    * schannel: client wants to read 102400 bytes
    * schannel: encdata_buffer resized 103424
    * schannel: encrypted data buffer: offset 0 length 103424
    * schannel: Curl_read_plain returned CURLE_RECV_ERROR
    * schannel: encrypted data buffer: offset 0 length 103424
    * schannel: encrypted data buffer: offset 0 length 103424
    * schannel: decrypted data buffer: offset 0 length 4096
    * schannel: schannel_recv cleanup
    * Closing connection 0
    * schannel: shutting down SSL/TLS connection with <SOLARWINDS_IP> port 17778
    * Send failure: Connection was reset
    * schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)
    * schannel: clear security context handle
    curl: (56) Send failure: Connection was reset
     

    If i run the same command 2-3 times continuously , i get a proper output on the 3rd attempt.

  • It looks like things are fine down to this...

    schannel: Curl_read_plain returned CURLE_RECV_ERROR

    ...

    Send failure: Connection was reset
    schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)

    I wonder if your network connection to the Orion server is spotty for some reason.  When attempting this from a browser, this works consistently, but takes a long time?  What happens when you run this on the Orion server itself?

    For reference, here is what the curl invocation looks like for me, with some masking for server names, passwords, etc:

    C:\WINDOWS\system32>curl -k -v -u <User>:<Password> https://<Server>:17778/Solarwinds/InformationService/v3/Json/Query?query=SELECT%20TOP%201%20NodeID,%20ObjectSubType,%20IPAddress%20FROM%20Orion.Nodes%20
    * Trying <IP Address>...
    * TCP_NODELAY set
    * Connected to <Server> (<IP Address>) port 17778 (#0)
    * schannel: SSL/TLS connection with <Server> port 17778 (step 1/3)
    * schannel: disabled server certificate revocation checks
    * schannel: verifyhost setting prevents Schannel from comparing the supplied target name with the subject names in server certificates.
    * schannel: sending initial handshake data: sending 181 bytes...
    * schannel: sent initial handshake data: sent 181 bytes
    * schannel: SSL/TLS connection with <Server> port 17778 (step 2/3)
    * schannel: failed to receive handshake, need more data
    * schannel: SSL/TLS connection with <Server> port 17778 (step 2/3)
    * schannel: encrypted data got 1213
    * schannel: encrypted data buffer: offset 1213 length 4096
    * schannel: sending next handshake data: sending 93 bytes...
    * schannel: SSL/TLS connection with <Server> port 17778 (step 2/3)
    * schannel: encrypted data got 51
    * schannel: encrypted data buffer: offset 51 length 4096
    * schannel: SSL/TLS handshake complete
    * schannel: SSL/TLS connection with <Server> port 17778 (step 3/3)
    * schannel: stored credential handle in session cache
    * Server auth using Basic with user '<User>'
    > GET /Solarwinds/InformationService/v3/Json/Query?query=SELECT%20TOP%201%20NodeID,%20ObjectSubType,%20IPAddress%20FROM%20Orion.Nodes%20 HTTP/1.1
    > Host: <Server>:17778
    > Authorization: Basic <Auth Token>
    > User-Agent: curl/7.55.1
    > Accept: */*
    >
    * schannel: client wants to read 102400 bytes
    * schannel: encdata_buffer resized 103424
    * schannel: encrypted data buffer: offset 0 length 103424
    * schannel: encrypted data got 246
    * schannel: encrypted data buffer: offset 246 length 103424
    * schannel: decrypted data length: 217
    * schannel: decrypted data added: 217
    * schannel: decrypted data cached: offset 217 length 102400
    * schannel: encrypted data buffer: offset 0 length 103424
    * schannel: decrypted data buffer: offset 217 length 102400
    * schannel: schannel_recv cleanup
    * schannel: decrypted data returned 217
    * schannel: decrypted data buffer: offset 0 length 102400
    < HTTP/1.1 200 OK
    < Content-Length: 78
    < Content-Type: application/json
    < Server: Microsoft-HTTPAPI/2.0
    < Date: Wed, 29 Apr 2020 19:30:23 GMT
    <
    {"results":[{"NodeID":1,"ObjectSubType":"Agent","IPAddress":"<IP Address>"}]}* Connection #0 to host <Server> left intact

    C:\WINDOWS\system32>

  • I get the output you shared only after 3-4 continuous attempts on curl. 

    On a browser i get a certificate warning first, followed by "This site cant be reached. Connection was reset" .

    On refreshing the browser 2-3 times , it prompts for credentials. After entering the credentials, i get the desired output after 2-3 minutes.

    This happens from within the solarwinds server as well as outside the server.

  • I was wondering if the below underlined configuration setting has something to do with the results.

    C:\Windows\system32>netsh http show sslcert

    SSL Certificate bindings:
    -------------------------

    IP:port : 0.0.0.0:17778
    Certificate Hash : <VALUE>
    Application ID : <VALUE>
    Certificate Store Name : (null)
    Verify Client Certificate Revocation : Enabled
    Verify Revocation Using Cached Client Certificate Only : Enabled
    Usage Check : Enabled
    Revocation Freshness Time : 0
    URL Retrieval Timeout : 0
    Ctl Identifier : (null)
    Ctl Store Name : (null)
    DS Mapper Usage : Disabled
    Negotiate Client Certificate : Disabled
    Reject Connections : Disabled
    Disable HTTP2 : Not Set

    IP:port : 0.0.0.0:443
    Certificate Hash : <VALUE>
    Application ID : <VALUE>
    Certificate Store Name : My
    Verify Client Certificate Revocation : Enabled
    Verify Revocation Using Cached Client Certificate Only : Disabled
    Usage Check : Enabled
    Revocation Freshness Time : 0
    URL Retrieval Timeout : 0
    Ctl Identifier : (null)
    Ctl Store Name : (null)
    DS Mapper Usage : Disabled
    Negotiate Client Certificate : Disabled
    Reject Connections : Disabled
    Disable HTTP2 : Not Set

  • The certificate warning is expected.  Orion uses its own certificate by default.  There are some details about that here, including instructions on replacing it with a legitimate certificate if you would like to use a valid certificate of your own.  That involves some effort, though.  The connection reset is the unexpected part.

  • I ran that command on my Orion server.  Here is the portion of the response for port 17778:

    IP:port : 0.0.0.0:17778
    Certificate Hash : <Value>
    Application ID : <Value>
    Certificate Store Name : (null)
    Verify Client Certificate Revocation : Enabled
    Verify Revocation Using Cached Client Certificate Only : Enabled
    Usage Check : Enabled
    Revocation Freshness Time : 0
    URL Retrieval Timeout : 0
    Ctl Identifier : (null)
    Ctl Store Name : (null)
    DS Mapper Usage : Disabled
    Negotiate Client Certificate : Disabled
    Reject Connections : Disabled
    Disable HTTP2 : Not Set

    This all looks the same as your configuration to me.

  • I think the next step is debugging the connection with tools like NetPathTraceroute NG, or Wireshark.  I'd also see if there is a difference depending on which client machine you use to connect to SWIS, including attempting a connection directly from the Orion server itself.