# Troubleshooting and Support

From [Descope Operations](https://learn.descope.io/c/operations): Move users in, go live, and find out what broke when something does.

Take this course interactively at https://learn.descope.io/c/operations/troubleshooting

---

![Audit Logs.](video:troubleshooting-audit-logs)

Audit logs are Descope's system of record for who did what, and when. They cover individual end-user activity (logins, profile changes) and administrative activity such as role changes, SSO configuration, and tenant management, which makes them the first stop for debugging and compliance questions alike.

Events come in two scopes. Project-level events record activity inside a single project: end-user logins, user and tenant changes, flow updates, role and permission edits. Company-level events record actions spanning your whole Descope company (creating or deleting projects, managing management keys, changing company settings) and are tagged `Level=Company` inside the same audit table. You can query all of it three ways: the Audits page in the Console, the Management SDKs, or the Search Audit API.

## Fields every event carries

- Actor ID: who performed the action (a Descoper's user ID, or the management key ID if the call came from the API or SDK).
- User ID: the user the action was performed on.
- Action and Occurred: what happened, and when.
- Device, Method, Remote Address, Country: the origin of the request.
- Data: the full request payload, including flow ID and execution ID where relevant.
- External Request ID: an identifier you pass in from your own SDK calls to correlate a Descope event with your application's logs.

> [!NOTE]
> The default retention period for audit logs in the Console is 30 days. If you need longer, stream them out with an Audit connector before that window closes.

## Key terms

- Project-level event: scoped to a single project: logins, user and tenant changes, flow updates, role edits.
- Company-level event: spanning the whole company, tagged `Level=Company`.
- External Request ID: the identifier that correlates a Descope audit event with your own logs.

## Summary

- That audit logs serve both debugging and compliance
- The two event scopes and how to tell them apart
- The three ways to query, and the fields you can rely on
- The default retention window, and what it implies

---

![Troubleshooting Logs.](video:troubleshooting-troubleshooting-logs)

Audit logs tell you what happened at the identity level: a login succeeded, a role changed. Troubleshooting logs tell you what happened inside a flow while it was running: which step failed, what a connector returned, and why a user got stuck partway through.

The Troubleshooting Logs page shows flow-level failures: connector errors, sign-in and sign-up action failures, and any other error tied to a specific step. For connector failures the complete error response is logged rather than a generic message, since that detail is usually what tells you whether the problem is on Descope's side or the third party's.

## Which log to reach for

- Audit Trail: identity and compliance events (logins, admin changes, SCIM). Keyed by `correlation_id` in Data. Found on the Console's Audits page.
- Troubleshooting Logs: what broke inside a flow, and where. Keyed by Flow Execution ID. Found under Audits & Troubleshooting.

The fastest way to watch a flow fail is the Flow Runner: open the flow and click Run, and the runner writes error messages, console output, and every connector request and response to the Runner messages panel as it executes. For hosted flows, appending `&debug=true` to the URL turns on an in-browser debugger panel, which is what you want when an issue will not reproduce inside the Console. Inside a Scriptlet action, `console.log`, `console.warn`, `console.error`, and `console.debug` are captured automatically and appear in the runner messages, so you can leave your own breadcrumbs in custom logic.

Flow Activity is the unified view. Rather than cross-referencing execution IDs between the audit log and the troubleshooting page by hand, it shows per-task status, timing, and error details for a whole execution in one table (Execution ID, Status, Task Type, Error Message, Connector ID, Tenant ID and more), with a free-text search matching across all of them.

## Key terms

- Troubleshooting Logs: flow-level failure records, distinct from identity-level audit events.
- Flow Execution ID: the key identifier for looking up a specific run.
- Flow Activity: the unified per-task view of one flow execution.

## Summary

- Which question each log type answers
- That connector failures capture the full upstream response
- How to watch a flow fail live, and how to debug a hosted one
- Where to look when you would otherwise correlate IDs by hand

---

![Reading Descope Errors.](video:troubleshooting-reading-descope-errors)

Every SDK call that reaches the Descope servers can fail, and when it does, the SDK reports three things: a Descope error code such as E061102, a human-readable description, and sometimes a more specific message. The code is the useful part. It is stable, it can be compared in code, and it can be looked up on the Common Errors page, which is usually the fastest route from a confused user's screenshot to the actual cause.

How the error reaches your code depends on the SDK. The Node.js SDK does not throw when the server returns an error: every call returns an `SdkResponse` whose `ok` is false on failure, with the details in `error`. The one exception is a response whose body is not valid JSON, such as a gateway's HTML error page or an empty 401, which rejects instead, so robust Node code checks `ok` and keeps a `try`/`catch` as well.

```js
const resp = await descopeClient.otp.verify.email(loginId, code);
if (!resp.ok) {
  console.log(resp.error?.errorCode);        // "E061103"
  console.log(resp.error?.errorDescription);
  if (resp.code === 429) {
    // rate limited
  }
}
```

The Node.js SDK also exports typed constants for the codes worth branching on, such as `DescopeErrors.tooManyOTPAttempts` for E061103, so a check reads as intent rather than as a magic string.

## Failures the SDKs retry on their own

- HTTP 503, 520, 521, 522, 524 and 530: the service-unavailable and Cloudflare statuses
- Up to three retries after the first attempt
- 100 milliseconds before the first retry, then 5 seconds before each of the next two
- Nothing else: a wrong code or a missing user is a definitive answer and is returned, not retried

## Codes you will meet most

- E062903: password sign-in failed (a wrong password, or an imported hash that does not verify)
- E061102, E061103, E061104: a one-time code that is invalid, attempted too many times, or expired
- E062108: user not found; check which login ID the step or SDK call is using
- E023001: the user is disabled, and is enabled again through the Console or the API
- E061003: a redirect URL that is not on the project's approved domains list
- E064002: no refresh token was provided; with a custom domain, check whether the DS and DSR cookies or storage entries are actually there
- E102116 and E102103: the next flow step was not found, so a step is not connected through to the end
- E102111: a flow ran more than 1,000 tasks, which almost always means a loop
- E103205: a flow component idled too long; refreshing it starts a new execution
- E125004: a connector failed at runtime (an unreachable URL, or a response slower than the step's timeout)

Read as a group, the codes sort into a handful of questions: is it the user, the credential, the configuration, or the flow's own structure? Asking which of those a code belongs to is often faster than reading its description, because it tells you which part of the system to open next.

## Key terms

- Error code: the stable Descope identifier for a failure, such as E061102, looked up on the Common Errors page.
- SdkResponse: the Node.js SDK's return value, with `ok`, the HTTP `code`, and `error` details instead of a thrown exception.
- DescopeErrors: the SDK's typed constants for common codes, such as `tooManyOTPAttempts`.

## Summary

- What a Descope error code is, and where to look one up
- How the Node.js SDK reports errors, and the one case that throws
- Which failures the SDKs retry, and which they return immediately
- The codes you will meet most, and the questions they sort into

---

![Common Customer Issues.](video:troubleshooting-common-customer-issues)

A short catalog of the issues that recur most. None of them are mysterious once you have seen them, and recognizing the shape of a problem is most of the work of resolving it, so this is less a troubleshooting procedure than a set of silhouettes.

## Recurring scenarios

- 502s: somebody else's server failed to answer. Inside a flow that is almost always a connector, and Troubleshooting Logs capture the complete upstream response rather than a generic message, which is what tells you whether the fault is Descope's or the third party's.
- Redirect mismatch: the address a user is sent back to does not match what is registered. Check Approved Domains, the OAuth Callback URL at the provider, and whether a custom domain moved one without the other.
- Missing SSO attributes: the user signs in successfully and arrives with nothing attached. Either the identity provider is not sending the claim, or the attribute mapping on the connection does not name it correctly.
- SCIM delays: SCIM is pushed by the identity provider on its own schedule. A change that has not appeared yet is usually waiting at the IdP rather than lost in Descope.
- Token failures after a domain change: a refresh that fails with E064002 means no refresh token reached Descope. With a custom domain, check whether the DS and DSR cookies, or their storage entries, are actually there.
- Flow routing loops: a condition whose input never changes between evaluations, so the run keeps taking the same branch back to where it started.

Two patterns are worth drawing out, because they account for most of the time lost.

The first is that a configuration mismatch rarely announces itself as a configuration error. A redirect mismatch surfaces as an error at the end of an identity provider's sign-in, so it reads as an SSO problem; a missing refresh token after a domain change surfaces as users being signed out, so it reads as a session problem. In both cases the error names the symptom and not the cause, so the useful instinct is to ask what recently changed about a domain rather than to read the message literally.

The second is that "nothing happened" is itself evidence. A user who stalls mid-flow leaves a `LoginStarted` with no completion, and a SCIM change that never arrives leaves no event at all. An absence tells you which system to go and ask, which is why the previous lesson's distinction between the two logs matters more than any individual error string.

> [!NOTE]
> Before assuming a bug, establish which half of the journey broke. A flow that never finished is a Troubleshooting Logs question; a flow that finished and left the user without the access they expected is an authorization question, and the token itself will tell you which.

## Key terms

- Redirect mismatch: a return address that does not match what is registered, at the provider or in Approved Domains.
- Attribute mapping: the per-connection translation from the identity provider's claims to Descope's user fields.
- Routing loop: a flow returning repeatedly to the same branch because the value its condition reads never changes.

## Summary

- The six issues you are most likely to meet, and how to recognize each
- That a configuration mismatch usually reports a symptom rather than its cause
- Why an absent event is evidence, and which log an absence points you at
- How to tell a flow that broke from a flow that finished with the wrong result

---

![Email Delivery Problems.](video:troubleshooting-email-delivery-problems)

Authentication email has a deadline that ordinary email does not. A magic link or a one-time code is only useful for a few minutes, so a message that arrives late is, to the user, a message that did not arrive at all, and a message that lands in spam is the same failure with an extra step. Both problems have known causes, and the evidence for each sits in a different place.

## Diagnosing a delayed email

- Confirm the configuration first: the sender address, and the SMTP or provider settings on the email connector
- Ask whether the customer uses an email gateway, such as Cisco IronPort, whose security checks can hold messages
- Check the Audit page for the send events on that user and time window
- Get the .eml file of a delayed message and read its headers, one hop at a time
- Check SPF and DKIM, and confirm there are no bounce reports

The .eml headers are the decisive evidence, because each Received line stamps when one server handed the message to the next. A message created at 14:20:15, received by a customer's security gateway at 14:20:17 and by their mailbox at 14:25:22 was delayed at the gateway, which is where the investigation goes next. Rate limits at the email provider, DNS records that are missing or wrong, a sending IP on a blocklist, and content that trips spam filters account for most of the rest.

Spam complaints are the slower, more damaging version of the same problem. When recipients mark messages as spam, mailbox providers lower the sending domain's reputation, and that degrades every message sent from it, including the password resets and sign-in links people are actively waiting for. A provider such as AWS SES or SendGrid may throttle or pause sending if the complaint rate climbs.

## What drives spam complaints

- Unverified or scraped addresses, often submitted by bots. Sending to unverified recipients is off by default in OTP and Magic Link settings
- Too many messages to one recipient, which Number of Retries and Attempts Timeframe cap
- Bot traffic triggering sign-up, login or reset flows, which the Check Rate Limit flow action can stop before an email is sent, on Growth and Enterprise plans
- Missing SPF, DKIM or DMARC records for the sending domain
- A sender address users do not recognize, fixed with a custom Sender Address and Sender Name on the connector
- Template content with excessive links, images or urgent language

Change one thing at a time where you can, so the effect of each change on the complaint rate is visible, and keep monitoring through the provider's own bounce and complaint tooling as well as Descope's audit logs. If a provider has paused sending, it will usually want a short account of what caused the complaints, what changed, and why it will not recur.

> [!NOTE]
> Your email provider's suppression list is the single biggest lever. It stops further sends to addresses that have already bounced or complained, which is exactly the traffic that keeps a complaint rate high.

## Key terms

- .eml file: a saved email including its full headers, whose Received lines form a timeline of every hop.
- Email gateway: a security system in front of a customer's mailboxes that can hold mail for scanning.
- Complaint rate: how often recipients mark messages as spam, which mailbox providers track per sending domain.
- Suppression list: a provider feature that stops sending to addresses that have bounced or complained.

## Summary

- Why lateness and spam folders are failures, not inconveniences, for authentication email
- How to read an .eml file's headers to find where a message waited
- What drives spam complaints, and the setting or action that addresses each
- How to change sending practices safely, and what a paused provider will ask for

---

![Browser and Environment Issues.](video:troubleshooting-browser-and-environment-issues)

Some failures have nothing to do with how a Descope project is configured. They come from where the application runs: a browser's cookie rules, a front-end router, a corporate network, or a compiler setting. These are worth knowing as a set, because each one produces a symptom that points somewhere misleading, usually at Descope, and each has a short, specific fix once it is recognized.

## Four environment problems and their fixes

- Safari over HTTP: with `sessionTokenViaCookie`, the session cookie is never stored, because Safari will not set a `Secure` cookie from JavaScript on a page served over HTTP. Serve the app over HTTPS, including in development
- Hash-based routing in Angular: magic links and OAuth return users to the sign-in page with no progress and no error, because the default hash routing drops the query parameters carrying the token. A custom location strategy that keeps the query string fixes it
- Self-signed certificates: behind a corporate proxy, a tunnel or an internal environment, SDK calls fail TLS verification with messages such as `x509: certificate signed by unknown authority` or `CERTIFICATE_VERIFY_FAILED`. Make the runtime trust the certificate, rather than turning verification off
- Node.js import error: `TypeError: node_sdk_1.default is not a function` when TypeScript compiles the SDK's CommonJS module into an ES module codebase. Set `esModuleInterop` to true in `tsconfig.json`

The self-signed certificate case deserves the warning the docs give it. Setting `NODE_TLS_REJECT_UNAUTHORIZED=0`, Python's `verify=False` or Go's `InsecureSkipVerify` does make the error disappear, by accepting any certificate at all, and that exposes the application to man-in-the-middle attacks. Trusting the proxy's root certificate fixes the same error and keeps verification on.

```bash
# Trust a corporate root CA in Node.js
export NODE_EXTRA_CA_CERTS=/path/to/corp-root-ca.pem
node app.js
```

> [!NOTE]
> Every Flow component has a debug option built in. Turning it on in your own application lets you debug a flow where it actually runs, which is often the only way to reproduce an environment problem that never appears in Descope's hosted pages.

## Key terms

- sessionTokenViaCookie: the setting that stores the session token in a cookie, which Safari will not set from an HTTP page.
- Location strategy: how an Angular app maps URLs to routes; the default hash strategy drops the query string a magic link carries.
- NODE_EXTRA_CA_CERTS: the Node.js setting for trusting an additional root certificate without disabling verification.
- esModuleInterop: the TypeScript option that lets an ES module codebase import a CommonJS module's default export.

## Summary

- Why some failures come from the environment rather than the project
- The four common ones, their misleading symptoms, and their specific fixes
- Why disabling TLS verification is never the fix for a self-signed certificate
- How the Flow component's debug option helps reproduce environment problems

---

![Support Escalation Readiness.](video:troubleshooting-support-escalation-readiness)

An escalation moves faster when it arrives complete. Most of the delay on a support ticket is not diagnosis; it is the round trip where somebody asks which project, which user, and when, and waits a day for the answer.

## Collect before escalating

- Project ID: which project, of the several a company usually has across environments.
- Tenant ID: which customer, where the behaviour might be tenant-specific configuration.
- User ID: who it happened to, rather than the login ID they typed.
- Execution ID: which run of which flow, resolving straight to one record.
- Timestamps: when, with a timezone, so the search window is unambiguous.
- Request IDs: the correlation ID that ties every event from one request together.
- Screenshots: what the user actually saw, including the error wording.
- HAR files: the full browser-side exchange, for redirect, cookie and CORS problems.
- Reproduction steps: what to do to see it happen again.

The list sorts into three jobs. The identifiers narrow a search from an entire project to one record. The timestamps and request IDs make that search unambiguous when the identifiers alone would match several runs. And the screenshots, HAR file and reproduction steps describe the half of the story Descope's own logs cannot see: what the browser did, what the user was told, and whether it happens every time or once in twenty.

Descope's own guide to collecting debugging information adds what to send for each kind of problem, and it is worth matching, because it is what the support team will ask for next.

## What to send, by kind of problem

- A flow: the errors shown when running it in the flow builder, and an export of the flow itself
- Live behavior: debug information captured with the flow's debug flag
- Configuration such as custom domains, templates or connectors: screenshots of the relevant settings
- A failed backend SDK request: the `cf-ray` header and other response metadata, captured in code rather than by reproducing it in a browser
- Anything browser-side: a HAR file and the console log, recorded with Preserve log on while reproducing the issue
- Whether the same behavior reproduces in an incognito window as well

HAR files go to Descope inside a support conversation: in the Console, open the ? icon, choose Get Help, and upload the file within a new or existing conversation. If the problem is in a flow, attach the flow's export there too.

> [!WARNING]
> A HAR file is a complete record of a browser session, which means it contains tokens, cookies and anything else the page sent. Treat one as a credential: scrub it before attaching it, and do not paste it anywhere you would not paste a session token.

Collect while the evidence still exists. Audit events are retained for 30 days by default, so a problem reported late in that window is one you should look up immediately rather than after the weekend. And if the answer matters beyond a month, the Audit connector covered earlier in this module is what keeps it reachable.

## Key terms

- Execution ID: the identifier resolving to one specific run of one flow.
- Correlation ID: the identifier tying every event produced by a single request together.
- HAR file: a full capture of the browser's network exchange, and a credential in its own right.

## Summary

- The nine items to gather before raising an escalation
- The three jobs that list does: narrow the search, disambiguate it, and describe what Descope cannot see
- What Descope's support team asks for, by kind of problem, and where to send a HAR file
- Why a HAR file needs scrubbing before it is shared
- That the retention window sets how long you have to collect any of it

---
