# TimeoutError: Timeout awaiting 'request' for 2500ms

**URL:** <https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878>\
**Category:** Questions\
**Created:** [June 22, 2020, 11:41am UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878 "2020-06-22T11:41:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![psharma](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@psharma](https://devforum.okta.com/u/psharma)\
**Post date:** [June 22, 2020, 11:41am UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/1 "2020-06-22T11:41:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Quintarous](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/quintarous/32/1940_2.png) [@Quintarous](https://devforum.okta.com/u/Quintarous)\
**Post date:** [July 7, 2020, 9:23pm UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/2 "2020-07-07T21:23:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![coderite](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/coderite/32/1999_2.png) [@coderite](https://devforum.okta.com/u/coderite)\
**Post date:** [July 23, 2020, 9:21am UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/3 "2020-07-23T09:21:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![donavon](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@donavon](https://devforum.okta.com/u/donavon)\
**Post date:** [February 26, 2021, 10:50pm UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/4 "2021-02-26T22:50:08Z")

</div>

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](https://github.com/sindresorhus/got/issues/699)

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.

---

<div class="post-metadata">

**Author:** ![psharma](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@psharma](https://devforum.okta.com/u/psharma)\
**Post date:** [March 1, 2021, 12:31pm UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/5 "2021-03-01T12:31:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cescnguyen](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/cescnguyen/32/4994_2.png) [@cescnguyen](https://devforum.okta.com/u/cescnguyen)\
**Post date:** [October 12, 2023, 3:39pm UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/6 "2023-10-12T15:39:58Z")

</div>

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

 ![Screenshot 2023-10-12 at 22.38.28](https://global.discourse-cdn.com/oktadev/original/2X/7/79fb80253b6b8a692ee40fdc58927cf0bbba9e05.png)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 13, 2024, 12:29am UTC](https://devforum.okta.com/t/timeouterror-timeout-awaiting-request-for-2500ms/9878/7 "2024-02-13T00:29:36Z")

</div>

Closed on February 13, 2024, 12:29am UTC


