Rayfin

Errors and troubleshooting

A symptom-to-fix index of the errors Rayfin builders hit most — client setup, deployment, schema apply, secrets, functions, connectors, and Fabric auth.

This page is a symptom → cause → fix index across every area of Rayfin. Search it by the error text you're seeing, then jump to the matching heading — or to the area's own troubleshooting section — for the full fix.

Quick reference

SymptomCauseFix
"Internal server error" from the data API, after a deploy that reported success@text() field with no max produced NVARCHAR(MAX) on MSSQLAdd @text({ max: N }) to every string field, then reapply the schema
Dialect is required when Data module is enabled (400 at deploy time)services.data.enabled: true with no dialect in rayfin.ymlSet dialect: mssql
Entity name 'Date' is a built-in GraphQL scalar type reserved by the platformThe entity name collides with a GraphQL built-in typeRename the class, or pass another name with @entity('EventDate')
Failed to acquire authentication tokenNot signed in, or no OS credential storage availablerayfin login; on machines without a keychain add --encryption-fallback-enabled
rayfin up db apply refuses to run, warns of data lossThe pending change drops a column/table or alters a typeReview the change; re-run with --force only once you accept the loss
A newly added entity isn't readable right after a deploy that reported successThe schema migration step hadn't finished applying, or the client/cache is staleRun rayfin up status; confirm schema apply completed before querying the new entity
Deployment fails with 401 or 403Your Fabric session expiredrayfin login, then retry rayfin up
The Fabric capacity assigned to this workspace is exhausted and cannot create another Rayfin item.The workspace has no room for another itemTarget another workspace with --workspace-id, or pass --capacity-id; see Deployment troubleshooting
Static hosting is enabled but services.staticHosting.assetAccess is not set in rayfin.ymlThe static-hosting access posture is missingSet assetAccess: protected or public; see Static hosting posture
No remote endpoint configured from staticapp deployNo full deployment has happened yetRun rayfin up once, then use staticapp deploy for subsequent updates
Static deploy exceeds the size limitBuild output includes source maps or dev-only assetsExclude dev artifacts from the production build
rayfin secret set exits without promptingstdin is not a TTY, or CI=truePass the value with --stdin, or many values with --env-file
Invalid services.functions.auth: authentication is required when Functions are enabled.Since Rayfin 1.36, enabled Functions require application authSet services.functions.auth.type: application
No value available for secret '<NAME>'. in a functionThe secret isn't declared in rayfin.yml or has no valueDeclare and set it with rayfin secret set <NAME>
HTTP 502 from a function call while npm run dev is runningA local Functions host is configured but not runningRestart npm run dev; see Run functions locally
The installed @microsoft/fabric-user-data-functions@<version> ... but this CLI writes '3.0'.The functions project's worker is older than the 2.0 CLIInstall @microsoft/fabric-user-data-functions at the CLI's exact version; see Functions worker is older than the CLI
A window handle must be configured when the local Functions host startsThe functions host.json allows a Preview extension bundle older than 4.49.0Set extensionBundle.version to [4.49.0, 5.0.0); see Run functions locally
MISSING_BASE_URL, MISSING_AUTH_MODE, or INVALID_CONFIG when the app startsThe 2.0 client was built with 1.x options or without an auth adapterUse RayfinClient.create with auth; see Client construction errors
The built bundle is not parseable JavaScript from rayfin upThe frontend bundle still contains TC39 decorator syntaxEnable Stage 3 decorators in the SWC plugin; see The built bundle is not parseable JavaScript
Unsupported TypeScript <version> at <path>.Schema compilation needs TypeScript ^5.7.2 || ^6.0.2Update TypeScript in the schema package
HTTP 403 ANONYMOUS_DATA_ACCESS_BLOCKED_BY_TENANT_ADMIN on schema applyAn entity grants the anonymous role and the tenant setting is offAsk a Fabric admin to enable anonymous data access, or use @authenticated()
Connector type "eventhouse" is not available in this release.New Eventhouse connectors are held back in 2.0Keep existing Eventhouse connectors; choose another connector type for new sources
Unknown connector type "kusto"rayfin connector add, inspect, or search was given --type kusto, which 2.0 renamed to eventhouseChoose another connector type for a new source; new Eventhouse connectors are held back in 2.0
Connector "<name>" has unsupported type "kusto"rayfin.yml still declares a 1.36 kusto connectorMigrate the entry as Eventhouse describes
SELECTION_REQUIRED from a connector queryThe chain has no explicit selectionAdd .select([...]), or list the entity in connectorConfig.entities
FEATURE_NOT_ENABLED or 404 from /connector-invoke/<name>Connector invocation is not enabled for the Fabric workspaceAsk your Fabric admin to enable it; app changes do not help
Popup blocked during Fabric sign-inensureSignedInWithFabric was called outside a user-gesture handlerCall it directly from a button's onClick
FABRIC_AUTH_POPUP_CLOSEDThe user closed the Fabric sign-in windowShow error.message and let the user retry
SIGN_IN_DENIED or AUTH_CLAIMS_* on sign-inThe app's dynamic claims provider denied or failed the sign-inSee Dynamic auth claims
Can't reach Microsoft Entra ID from rayfin loginThe network blocks Entra ID, often WSL2 behind Global Secure Access or a VPNSee rayfin login

Deployment and schema apply

"Internal server error" after a successful deploy

Symptom: rayfin up (or rayfin up db apply) reports success, but the GraphQL or REST data API returns a generic "Internal server error" at runtime.

Cause: a @text() field with no max option produces an NVARCHAR(MAX) column on MSSQL. Rayfin's metadata provider can fail to build a GraphQL schema from that column type.

Fix: add an explicit length to every string field targeting MSSQL — @text({ max: 200 }) rather than bare @text() — then reapply the schema (npx rayfin up db apply --force if the column already exists with the wrong type). See @microsoft/rayfin-core and Known limitations.

"Dialect is required when Data module is enabled"

Symptom: rayfin up fails with a 400 error during deployment.

Cause: rayfin.yml has services.data.enabled: true but no dialect key.

Fix: add dialect: mssql (Fabric apps support MSSQL only) under services.data:

rayfin/rayfin.yml
services:
  data:
    enabled: true
    dialect: mssql

Database apply refuses to run (potential data loss)

Symptom: rayfin up db apply stops and warns instead of applying the change.

Cause: the pending schema change would drop a column, drop a table, or alter a column's type — all are treated as potentially destructive.

Fix: review the listed operations. If the data loss is acceptable, re-run with --force:

npx rayfin up db apply --force

Never pass --force without reviewing what will be dropped.

A newly added entity isn't readable after a deploy that reported success

Symptom: rayfin up prints success, but querying a newly added entity immediately afterward returns nothing, or errors as if the entity doesn't exist.

Cause: the static app and runtime settings can finish deploying slightly before the database schema migration for the new entity has fully applied, or a client built before the deploy is still caching the old schema.

Fix: run npx rayfin up status and confirm the deployment is fully healthy before relying on the new entity. Refresh or rebuild the frontend client so it isn't holding a stale schema.

Deployment fails with 401 or 403

Symptom: rayfin up fails partway through with an authorization error.

Cause: your signed-in Fabric session has expired.

Fix: npx rayfin login to reauthenticate, then retry npx rayfin up.

The built bundle is not parseable JavaScript

New in 1.36

Symptom: npm run build succeeds, but rayfin up stops with The built bundle is not parseable JavaScript, so the deployed app would be a blank page, or the Vite dev server reports Expression expected at @entity().

Cause: frontend code imports an entity class as a value — for example for toStandardSchema() or a connector's connectorConfig — and @vitejs/plugin-react-swc is not compiling TC39 Stage 3 decorators.

Fix: enable Stage 3 decorators in the SWC plugin (and in vitest.config.ts if specs import entities), then rebuild. See Enable decorators in the SWC plugin.

Unsupported TypeScript for schema compilation

New in 2.0

Symptom: rayfin dev or rayfin up fails with Unsupported TypeScript <version> at <path>. Rayfin tooling supports ^5.7.2 || ^6.0.2.

Cause: the package that holds your schema has a TypeScript version outside the range the 2.0 CLI compiles with.

Fix: install a supported version in that package and commit the lockfile:

npm install --save-dev "typescript@^5.7.2"

Anonymous data access is blocked by the tenant

Symptom: applying the schema fails with HTTP 403 and ANONYMOUS_DATA_ACCESS_BLOCKED_BY_TENANT_ADMIN, in rayfin dev or rayfin up.

Cause: an entity grants the anonymous role a permission, and the Fabric tenant setting Enable anonymous data access for Fabric Apps (Preview) is off — or limited to security groups that do not include the app owner.

Fix: ask a Fabric tenant administrator to enable the setting for the app owner, or replace @anonymous(...) with @authenticated(...) and sign users in. See Permissions.

Sign-in and secrets

Sign-in or keychain failures

Symptom: rayfin login or any command needing authentication fails with Failed to acquire authentication token or a similar credential-storage error.

Cause: you aren't signed in, or the current environment (a container, a restricted CI runner) has no OS-backed credential storage for the CLI's token cache.

Fix: run npx rayfin login — the account picker is always shown, so you can choose a different account. On systems without OS credential storage, pass --encryption-fallback-enabled (or set RAYFIN_ENCRYPTION_FALLBACK_ENABLED=true) — development environments only, because the token cache is then stored in plaintext.

rayfin secret set refuses to prompt

Symptom: rayfin secret set <NAME> exits without asking for a value.

Cause: stdin is not a TTY, or CI=true is set, so the masked prompt can't run.

Fix: pipe the value in with --stdin, or set several secrets at once from a dotenv file with --env-file:

printf '%s' "$API_KEY" | npx rayfin secret set API_KEY --stdin
npx rayfin secret set --env-file .env.secrets

See Secrets for CI usage and rotation.

Permission denied setting or listing secrets

Symptom: rayfin secret set or rayfin secret list fails with a permission error.

Cause: the signed-in account doesn't have access to the target Fabric workspace, or the project has not been deployed yet.

Fix: run npx rayfin up first so the workload exists. Then confirm you're signed in with an account that has workspace access — run npx rayfin login again, the account picker is always shown.

"Can't reach Microsoft Entra ID"

New in 2.0

Symptom: rayfin login fails with Can't reach Microsoft Entra ID before or after the browser opens.

Cause: the CLI cannot reach login.microsoftonline.com. Inside WSL2 or a dev container, a Windows network client such as Global Secure Access or a VPN commonly answers DNS with addresses WSL2 cannot reach.

Fix: follow the recovery steps the CLI prints. See rayfin login for the WSL2 configuration change and the RAYFIN_TOKEN fallback.

Client construction errors

New in 2.0

Symptom: the app throws a ClientCompositionError or SdkError with a code such as MISSING_BASE_URL, MISSING_PUBLISHABLE_KEY, MISSING_AUTH_MODE, INVALID_CONFIG, INVALID_AUTH_CONFIG, or INVALID_SERVICE_FACTORY as soon as it creates the client.

Cause: the client is built with 1.x options. Common cases: no auth adapter, useProxy instead of baseUrl: '', top-level authStorage or accessToken, or an async service factory.

Fix: build the client with RayfinClient.create, pass browserSession() or suppliedToken() as auth, and register services synchronously. See @microsoft/rayfin-client for every code.

Static hosting

Static folder not found / empty static folder

Symptom: deployment fails saying the static output folder doesn't exist, or it exists but is empty.

Cause: the folder path in rayfin.yml (relative to root, or the project root) is wrong, or buildCommand didn't actually produce output.

Fix: verify the staticHosting.folder path, and run the build command manually (npm run build) to confirm it produces files where expected.

Deployment too large

Symptom: static deployment fails because the packaged archive exceeds the limit.

Cause: the compressed build output exceeds the 100 MB static hosting limit — often source maps or unoptimized assets.

Fix: exclude development artifacts (source maps, unminified assets) from the production build, and serve large media from outside the static bundle.

Static hosting posture is missing

Symptom: rayfin up stops with Static hosting is enabled but services.staticHosting.assetAccess is not set in rayfin.yml, or the deployed app reports that the access posture has not been recorded.

Cause: since Rayfin 1.35.1, a static-hosted app must declare who can load it.

Fix: set the posture explicitly, then redeploy with npx rayfin up:

rayfin/rayfin.yml
services:
  staticHosting:
    enabled: true
    assetAccess: protected # or: public

protected requires Fabric sign-in before the app loads; public serves anyone with the link. A non-interactive rayfin up writes protected for you when the value is missing. See Hosting and Deployment troubleshooting for the related posture errors.

"No remote endpoint configured"

Symptom: rayfin up staticapp deploy fails, saying no remote endpoint is configured.

Cause: staticapp deploy only redeploys static content for a deployment that already exists — it can't create one.

Fix: run npx rayfin up once to provision the remote deployment, then use npx rayfin up staticapp deploy for subsequent static-only updates.

Functions

See Run functions locally and Deploying functions for the full lists.

"authentication is required when Functions are enabled"

Symptom: rayfin up or rayfin dev fails with Invalid services.functions.auth: authentication is required when Functions are enabled.

Cause: since Rayfin 1.36, enabled Functions must declare application authentication.

Fix: add the auth block:

rayfin/rayfin.yml
services:
  functions:
    enabled: true
    auth:
      type: application

"No value available for secret"

Symptom: a function throws No value available for secret 'API_KEY'. Ensure it is declared in rayfin.yml and set with 'rayfin secret set'.

Cause: the function reads ctx.Secrets.API_KEY, but the secret is not declared, or it has no value in the deployed item.

Fix: run npx rayfin secret set API_KEY --describe="What the key is for", then redeploy. See Secrets in functions.

HTTP 502 from a function call during development

Symptom: while npm run dev is running, client.functions.<name>.invoke() fails with HTTP 502.

Cause: the Vite dev server proxies function calls to the local Functions host that rayfin dev configured, and that host is not running. The proxy never falls back to the deployed function. When no local Functions host is configured at all, the adapter forwards the call to the deployed backend instead. Changed in 2.0

Fix: restart npm run dev, or run npx rayfin dev functions apply and read its output.

Functions worker is older than the CLI

New in 2.0

Symptom: rayfin dev, rayfin functions init, or rayfin up stops before generating types or deploying, with a message such as The installed @microsoft/fabric-user-data-functions@1.36.2 ... but this CLI writes '3.0'.

Cause: the 2.0 CLI writes runtime metadata schema 3.0, which older workers cannot read.

Fix: run the npm install command the CLI prints — it installs @microsoft/fabric-user-data-functions at the CLI's exact version in the functions project — then retry. See Run functions locally.

"A window handle must be configured"

Symptom: the local Functions host exits on startup with A window handle must be configured, typically when a coding agent runs rayfin dev.

Cause: a function declares an audience, so the host must sign you in, and a Preview extension bundle older than 4.49.0 cannot show that prompt without a terminal window.

Fix: set extensionBundle.version to [4.49.0, 5.0.0) in the functions host.json. Since 2.0, rayfin dev warns before starting the host and names the file to change. Changed in 2.0 See Run functions locally.

Connectors

See Connectors and the rayfin connector reference for per-command errors.

SELECTION_REQUIRED

Cause: a query chain with .where(), .orderBy(), or .first() has no explicit selection, or the entity is missing from connectorConfig.entities.

Fix: add .select([...]) to the chain, and list the entity in connectorConfig.entities.

FEATURE_NOT_ENABLED or 404 from /connector-invoke/<name>

Cause: connector invocation is disabled for the Fabric workspace. The message comes from the service, not from your app.

Fix: ask your Fabric administrator to enable it for the workspace. Changing the app does not help.

Connector type "eventhouse" is not available in this release.

Changed in 2.0

Cause: new Eventhouse connectors — the type 1.x called kusto — are held back in 2.0.

Fix: existing Eventhouse connectors keep working; see Eventhouse. Choose another connector type for new sources.

Unknown connector type "kusto"

Changed in 2.0

Cause: rayfin connector add, rayfin connector inspect, or rayfin connector search received --type kusto. 2.0 renamed the type to eventhouse.

Fix: new Eventhouse connectors cannot be added in 2.0, so choose another connector type for a new source. To work with an existing Eventhouse connector, see Eventhouse.

Connector "<name>" has unsupported type "kusto"

Changed in 2.0

Cause: rayfin.yml still declares a 1.36 connector with type: kusto, and rayfin up validation no longer recognizes it.

Fix: change the entry to type: eventhouse with auth.type: application, move its queries into additionalPayload, and switch to @microsoft/rayfin-connector-eventhouse. See Migrate a 1.36 kusto connector.

INVALID_QUERY_INPUT from an Eventhouse connector

Cause: the call sent query text or cluster fields instead of a saved queryId, or its parameters do not match the saved template.

Fix: save the query under the connector's additionalPayload.queries, run npx rayfin up, and call it with { queryId, parameters }. See Eventhouse.

AMBIGUOUS_CONNECTOR

New in 2.0

Cause: connector names are case-insensitive, and two keys in your connector configs differ only by case, so client.connectors.<name> cannot pick one.

Fix: rename or remove one of the entries in rayfin.yml and in the configs passed to connectorsService. rayfin up and rayfin dev validation also flag the duplicate.

connector-additional-payload-not-acknowledged

New in 2.0

Cause: the backend saved the connector settings but dropped a declared additionalPayload, which means it does not support the field yet.

Fix: deploy to a backend that supports it, or remove additionalPayload from the named connectors.

Fabric brokered auth

See @microsoft/rayfin-auth-provider-fabric for the full option reference these fixes refer to.

Cause: ensureSignedInWithFabric (or initiateFabricLogin) was called outside a synchronous user-gesture handler.

Fix: call it directly from a button's onClick, not on page load or after an await.

Sign-in fails with no visible message

Cause: the app catches the sign-in error and discards it, for example with an empty catch or by only resetting the user to signed out.

Fix: catch errors from every ensureSignedInWithFabric() call and render error.message on the sign-in screen; it is a user-safe, localized description. initEmbeddedAuth() does not reject, so when it returns null, show the sign-in button and let the click report the error. See Fabric SSO.

FABRIC_AUTH_POPUP_CLOSED

New in 2.0

Cause: the user closed the Fabric sign-in window before sign-in completed. The call rejects about one second later instead of waiting for the five-minute timeout.

Fix: show error.message and keep the sign-in button available so the user can retry.

SIGN_IN_DENIED or AUTH_CLAIMS_*

New in 2.0

Cause: the app's udf.authClaims provider denied the user (SIGN_IN_DENIED), timed out (AUTH_CLAIMS_UNAVAILABLE), threw or is not deployed (AUTH_CLAIMS_FAILED), or returned claims that do not match the deployed contract (AUTH_CLAIMS_INVALID_OUTPUT).

Fix: see Dynamic auth claims. To stop a failing provider without redeploying functions, set services.auth.dynamicClaims.enabled: false and run any deploy.

Session not persisting

Cause: the client is misconfigured — usually the wrong baseUrl or publishableKey, or browserSession({ storage: false }) or persistSession: false, which keep the session in memory only.

Fix: confirm both values match your deployed backend, and that the browser session adapter uses storage.

Timeout after 5 minutes

Cause: the Fabric portal never sent the handoff code back.

Fix: confirm returnOrigin matches your app's actual origin.

Origin mismatch

Cause: fabricPortalUrl doesn't match the Fabric portal environment you're actually using (production, PPE, dev).

Fix: use the correct portal URL for your environment.

initEmbeddedAuth returns null

Cause: the SDK didn't detect embedded mode, or embedded sign-in failed — it logs a console warning and resolves to null instead of rejecting.

Fix: ensure the URL includes ?fabricEmbedded=true, or set fabricEmbedded: true explicitly in FabricAuthOptions. If embedded mode is detected, check the console warning, or click sign in to see the error.

State mismatch error

Cause: the response's state parameter didn't match the request — a stale response from a previous flow, or a replay attempt.

Fix: retry the sign-in flow from scratch.

See also

Something wrong on this page?Report an issueEdit this page

On this page

Quick referenceDeployment and schema apply"Internal server error" after a successful deploy"Dialect is required when Data module is enabled"Database apply refuses to run (potential data loss)A newly added entity isn't readable after a deploy that reported successDeployment fails with 401 or 403The built bundle is not parseable JavaScriptUnsupported TypeScript for schema compilationAnonymous data access is blocked by the tenantSign-in and secretsSign-in or keychain failuresrayfin secret set refuses to promptPermission denied setting or listing secrets"Can't reach Microsoft Entra ID"Client construction errorsStatic hostingStatic folder not found / empty static folderDeployment too largeStatic hosting posture is missing"No remote endpoint configured"Functions"authentication is required when Functions are enabled""No value available for secret"HTTP 502 from a function call during developmentFunctions worker is older than the CLI"A window handle must be configured"ConnectorsSELECTION_REQUIREDFEATURE_NOT_ENABLED or 404 from /connector-invoke/<name>Connector type "eventhouse" is not available in this release.Unknown connector type "kusto"Connector "<name>" has unsupported type "kusto"INVALID_QUERY_INPUT from an Eventhouse connectorAMBIGUOUS_CONNECTORconnector-additional-payload-not-acknowledgedFabric brokered authPopup blockedSign-in fails with no visible messageFABRIC_AUTH_POPUP_CLOSEDSIGN_IN_DENIED or AUTH_CLAIMS_*Session not persistingTimeout after 5 minutesOrigin mismatchinitEmbeddedAuth returns nullState mismatch errorSee also