TimeoutError: Timeout awaiting 'request' for 2500ms

I have configured the okta middleware ExpressOIDC for connection but I am getting timeout error:
TimeoutError: Timeout awaiting ‘request’ for 2500ms
at ClientRequest. (/node/node_modules/got/source/request-as-event-emitter.js:176:14)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:327:22)
at ClientRequest.origin.emit (/node/node_modules/@szmarczak/http-timer/source/index.js:37:11)
at Immediate.timeoutHandler (/node/node_modules/got/source/utils/timed-out.js:63:11)
at processImmediate (internal/timers.js:458:21)
Already using open-client custom.setHttpOptionsDefaults for changing the default timeout, still getting it. Mostly I am getting this if I stay on login page for more time around 1 minute.
Please let me know the root cause of this.
Thank you

Same problem here. The strangest thing is if I keep attempting to login it eventually works and the timeout errors stop until I reset my server.

I am getting this error, periodically, when logging out.

So far, I have not found a guaranteed method of reproducing it.

Have you guys managed to find a fix?

Same here. It appears that it’s somewhere in the bowels of the node_modules down at Got.

see: TimeoutError: Timeout awaiting 'request' · Issue #699 · sindresorhus/got · GitHub

I just started digging into this, but I found that okta middleware uses open-id-client, which uses got. If you look at open-id-client request.js line 21, you will see timeout: 2500.

Still don’t know the root cause, but I’m getting close.

I have switched the logic to the front-end vue.js and it worked like a charm.

I also had the same problem as you and how I solved it