Forum Discussion

PACT_member's avatar
PACT_member
Icon for Nimbostratus rankNimbostratus
May 09, 2018

Get qkview through API REST : Bad gateway 502

Hello,

I am trying to use API REST to get qkview from F5 BIG IP 3600. There are on version 12.1.2 Build 0.0.249

r = s.post("https://" + address_ip_input + "/mgmt/tm/util/qkview",json=({"command": "run"}))

I keep getting error 502 and the r.text is the following :

Bad Gateway!

The proxy server received an invalid response from an upstream server.

The proxy server could not handle the request .

Reason: Error reading from remote server

Error 502

Wed May 9 06:04:05 2018

 

What is strange, is that the qkview is created without trouble on the device.

Could you please tell me what's wrong ? I have already use API REST to get facts, save ucs, etc, so I'm pretty sure the structure of my request is good.

This request doesn't download the qkview locally isn't it ? What's the best way to retrieve it ? Through scp ? There are no API REST to get file ?

2 Replies

  • W59's avatar
    W59
    Icon for Nimbostratus rankNimbostratus

    Appears to me to be a similar issue like K18410170: The REST API may timeout while retrieving a large amount of data:

    [I][55850][][RestRequestReceiver] Unable to read headers on request from /127.0.0.1:54954: com.f5.rest.common.RestOperation$HttpException - End of stream on com.f5.rest.common.AsynchronousSocketChannelInsecure@745341 to null after 0 read.  Req hdr: 0 body: -1.  Buffer pos: 0 lim: 16384 cap: 16384 contentLength: -1 chunked: false
    
    
    [SEVERE][55852][][ChildWrapper] Timed out waiting for POST request at http://localhost:8100/tm/util/qkview/. Killing child process 
    [I][55853][][ChildWrapper] Killing IcrdChild process 
    [SEVERE][55854][][ChildWrapper] Child runner thread was interupted. Killing child: 
    [SEVERE][55855][][ChildWrapper] Child runner thread was interupted. Killing child: 
    [I][55856][][ChildWrapper] IcrdChild process  is starting
    [I][55857][][ChildWrapper] Killing IcrdChild process 
    [I][55858][][ChildWrapper] IcrdChild process  is starting
    [I][55859][][HttpSocketHelper]
            Socket error
            Op: 51396330
            URI: http://localhost:51844/tmapi_mapper/util/qkview/
            Referer: 
            Status: 400
            Content Length: 1395
            Buffer Position: 0
            Buffer Remaining: 16384
            Buffer Limit: 16384
            Buffer Capacity: 16384
            Header Byte Count: 0
            Retries: 0
            Channel: null
            Exception: java.nio.channels.AsynchronousCloseException
            at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finishRead(UnixAsynchronousSocketChannelImpl.java:408)
            at sun.nio.ch.UnixAsynchronousSocketChannelImpl.finish(UnixAsynchronousSocketChannelImpl.java:191)
            at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implClose(UnixAsynchronousSocketChannelImpl.java:225)
            at sun.nio.ch.AsynchronousSocketChannelImpl.close(AsynchronousSocketChannelImpl.java:144)
            at com.f5.rest.common.AsynchronousSocketChannelInsecure.close(AsynchronousSocketChannelInsecure.java:95)
            at com.f5.rest.common.Connection.close(Connection.java:156)
            at com.f5.rest.common.RestClientConnectionManager.closeNow(RestClientConnectionManager.java:772)
            at com.f5.rest.common.RestClientConnectionManager.closeOrReuse(RestClientConnectionManager.java:437)
            at com.f5.rest.common.RestClientConnectionManager.closeDueToError(RestClientConnectionManager.java:343)
            at com.f5.rest.common.RestRequestSender.checkExpiredOperations(RestRequestSender.java:631)
            at com.f5.rest.common.RestServer.checkAndExpirePendingWorkerOperations(RestServer.java:1411)
            at com.f5.rest.common.RestServer.access$500(RestServer.java:45)
            at com.f5.rest.common.RestServer$4.run(RestServer.java:1377)
            at com.f5.rest.common.ScheduleTaskManager$2$1.run(ScheduleTaskManager.java:123)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
            at java.util.concurrent.FutureTask.run(FutureTask.java:262)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:745)
    
    [I][55860][][ChildWrapper] Killing IcrdChild process 
    [I][55861][][ChildWrapper] IcrdChild process  is starting
    [I][55862][][ProcessManager] Got confirmation from child '': pid 19569,  port 46460
    [I][55863][0][RestRequestReceiver] Unable to read headers on request from /127.0.0.1:59642: com.f5.rest.common.RestOperation$HttpException - End of stream on com.f5.rest.common.AsynchronousSocketChannelInsecure@102917 to null after 0 read.  Req hdr: 0 body: -1.  Buffer pos: 0 lim: 16384 cap: 16384 contentLength: -1 chunked: false