Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API call timeout #32

Open
cscan opened this issue Jun 13, 2018 · 7 comments
Open

API call timeout #32

cscan opened this issue Jun 13, 2018 · 7 comments

Comments

@cscan
Copy link

cscan commented Jun 13, 2018

I always experienced this:

Error: API call timed out
at Function.Error.create (/root/proxy/node_modules/simple-errors/index.js:25:11)
at Function.Error.http (/root/proxy/node_modules/simple-errors/index.js:68:21)
at unhandledApiError (/root/proxy/node_modules/express-request-proxy/lib/proxy.js:254:25)
at Request. (/root/proxy/node_modules/express-request-proxy/lib/proxy.js:86:7)
at emitOne (events.js:121:20)
at Request.emit (events.js:211:7)
at Timeout._onTimeout (/root/proxy/node_modules/request/request.js:848:16)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)

I found that it caches the incomplete result even it is timeout. How to avoid that?

@lionep
Copy link
Contributor

lionep commented Jul 9, 2018

Did you change the timeout option in the middleware ?
It defaults to 5000 ms, it might be short in some cases.

@ttraenkler
Copy link

ttraenkler commented Aug 19, 2018

having a similar issue for streaming a .mp4 video with timeout set to 10000

Error: API call timed out
at Function.Error.create (.../node_modules/simple-errors/index.js:25:11)
at Function.Error.http .../node_modules/simple-errors/index.js:68:21)
at unhandledApiError (.../node_modules/express-request-proxy/lib/proxy.js:254:25)
at Request. (.../node_modules/express-request-proxy/lib/proxy.js:86:7)
at emitOne (events.js:121:20)
at Request.emit (events.js:211:7)
at ClientRequest. (.../node_modules/request/request.js:815:16)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at ClientRequest.emit (events.js:208:7)
at Socket.emitTimeout (_http_client.js:706:34)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at Socket._onTimeout (net.js:410:8)
at ontimeout (timers.js:498:11)

@kborisevich
Copy link

kborisevich commented Nov 5, 2018

I have the same problem when try to proxy request with body. The same request without body works well.

@kborisevich
Copy link

It is not a clue but may be it will help somebody. Solution for me was to change content-type from 'application/json' to 'text/plain'. Direct request with content type 'application/json' works well.

@dylanjt
Copy link

dylanjt commented Jan 18, 2019

This is also an issue for me. I'm using .all, and curiously the issue does not occur on GET requests but does occur on PUT and POST requests.

@dylanjt
Copy link

dylanjt commented Jan 18, 2019

Hi all - for me, the issue was something with bodyParser. Moving my app.use for bodyParser and jsonParser until after the app.alls for the proxy solved the issue.

@edgarhurtado27
Copy link

It is not a clue but may be it will help somebody. Solution for me was to change content-type from 'application/json' to 'text/plain'. Direct request with content type 'application/json' works well.

This worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants