Drıftstack docs
Docs

Session operation exceeded its timeout (504)

You might be here because: “The session took too long to respond. Try again” · “Session timeout” · “504 session-timeout” · “The session did not answer within N seconds” · “The operation exceeded the supplied timeout of N ms” · “timeout_ms” · “my command timed out” · “the page is slow and the step gives up” · “gateway timeout from the API” · “the session keeps timing out”

Short answer

A tap or typing sent to the session got no answer in time; the session itself is usually still running. The API answers HTTP 504 session-timeout, detail “The session did not answer within N seconds, so it is not known whether the event was applied.”. Look at the page first: if the tap or typing did land, sending it again repeats it.

Check first

  • Is the session still running in the Sessions tab? A 504 is about one action, not the session.
  • Is the page slow through the profile’s proxy? A slow proxy makes every step slow.
  • Did the tap or typing land? Check the live view before you send it again.

Likely causes and fixes

  1. The session was slow to answer. This error is kept apart from a failure on purpose, so you can tell “no answer in time” from “failed”. Fix: check the page, then send the tap or typing again only if it did not land.

  2. Retrying from code. A 504 is not one of the SDKs’ retryable classes, so isRetryable returns false and the built-in retry does not repeat it. Fix: retry deliberately, after deciding whether the action is safe to run twice — a tap that did land would land again.

  3. The page is still loading. A slow page does not cause this error by itself, but a phone busy loading a heavy page can answer an input late. See the page-load page for the proxy and DNS checks.

  4. It times out every time. The session has probably stopped answering the steps sent to it, even if the live view still shows the page. Fix: stop the session and launch the profile again.

Self-hosted only: timeout_ms

On the hosted service, the navigate, interact and wait calls of a session started through your proxy are refused with 503 and nothing runs, so this part does not apply there. On a self-hosted server those calls take an optional timeout_ms: navigate 1–120 s (30 s if you leave it out), interact 0.1–60 s (10 s), wait 0.1–120 s (30 s). With the built-in mock driver, a call that runs past it answers 504 session-timeout, detail “The operation exceeded the supplied timeout of N ms.”, with the limit repeated in timeout_ms. Fix: set a larger timeout_ms.

If it still fails

If a fresh session on the same profile times out on its first action, press Talk to a person in this chat (or open Help) and include the session id, what the action was, the number of seconds the error named, and the time. Nothing here needs an account or billing action.