agentleFS
wardawgmalviciouswardawgmalvicious/agent-config/skills/fabric/fabric-gotchas/SKILL.md

fabric-gotchas

Skill1 starsChanged 57 days agoMITView on GitHub

Use when troubleshooting Microsoft Fabric — common errors: 401 (wrong token audience), 403 on Power BI API (Viewer role), 404 EntityNotFound (permissions masquerading), PowerBIEntityNotFound (logicalId vs runtime ID), Login failed (wrong Initial Catalog), 24556/24706 snapshot conflict, nvarchar/datetime/money errors (Warehouse unsupported types), COPY INTO auth, MERGE/ALTER COLUMN failures, TMDL validation (tabs vs spaces, /// comments), DefaultJob jobType mistake, sqlcmd version, slow SQLEP (small files), notebook `400 exceptionCulprit:1` (bare-string cell source), Variable Library `InvalidContent (ValueMismatch)` (stale override / empty value), greyed-out deployment-rule dropdowns (Direct Lake), DirectQuery-transformations refresh error, PBIR-Legacy format, MissingDefinitionParts, empty visuals after publish (byConnection rebind), empty Top-N visuals + frozen save (bad TopN filter), RTDB `baseQueryId` error, Runtime 2.0 `LibraryManagementError`, warehouse 2.0 Git sync `DataLoss` block (pre-drop live).

  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify workspace has capacity before creating items (capacityId in workspace response)

    line 66
  2. Distinctive:

    Use parameterized notebooks and pipelines — no hardcoded workspace/item IDs

    line 67
  3. Distinctive:

    Use Delta Lake format for all Lakehouse tables

    line 68
  4. Very specific:

    Always specify database name in SQL connections (-d flag or Initial Catalog)

    line 71
  5. Distinctive:

    Use Entra ID auth everywhere — SQL auth not supported in Fabric

    line 72
  6. Distinctive:

    DELETE + INSERT over MERGE for production upserts

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Common gotchas & troubleshooting

IssueCauseFix
401 UnauthorizedWrong token audienceCheck audience table in fabric-auth skill; verify aud claim at jwt.ms
403 Forbidden on Power BI APIUser has Viewer roleRefresh/data sources/permissions APIs require Contributor+. Stop retrying — it's permissions.
404 EntityNotFound on getDefinitionInsufficient permissions masquerading as 404Check workspace role first; don't retry with different URLs
PowerBIEntityNotFound / EntityNotFound from pipeline, Variable Library, or REST callUsed .platform logicalId instead of runtime item IDFetch runtime ID from Fabric portal URL or GET /v1/workspaces/{wsId}/items. See fabric-rest-api skill (Item IDs section)
Login failed... database not foundWrong Initial CatalogUse item display name, not FQDN. Verify workspace role. Connections with no Initial Catalog now land deterministically on master (drill-verified) — confirm with SELECT DB_NAME() and switch with USE [<item display name>] instead of reconnecting.
Error 24556/24706 snapshot conflictConcurrent writes to same tableSerialize writes; retry with backoff
nvarchar / datetime / money errorsUnsupported types in Fabric WarehouseUse varchar, datetime2(6), decimal(19,4) (Warehouse only — fabric-database skill supports these)
COPY INTO auth errorMissing Storage Blob Data Reader on ADLSGrant role, use SAS in CREDENTIAL, or (GA August 2026) CREDENTIAL = (IDENTITY = 'Workspace Identity'), which reads Blob, ADLS Gen2 or OneLake as the workspace identity while the statement runs as you
MERGE failures in productionPreview feature with table-level conflict detectionUse DELETE + INSERT pattern instead (Warehouse only — fabric-database skill supports MERGE)
ALTER COLUMN failsNot supported in Fabric WarehouseUse CTAS + sp_rename workaround (Warehouse only — fabric-database skill supports ALTER COLUMN)
Table empty after Git sync of a DDL change (warehouse definition 1.0)Sync rebuilt the table (DacFx table-rebuild path) — even a nullable ADD COLUMN (observed 2026-09-03; mechanism undocumented). A 2.0 warehouse (definition 2.0 is preview) refuses instead — next rowCapture needed rows/state before syncing DDL to a populated table; re-register after. See fabric-warehouse — Schema Evolution
Git sync or pipeline deploy fails DataLoss: The column [s].[t].[c] is being dropped + Msg 50000 ... Rows were detected. The schema update is terminating (definition 2.0, preview)DacFx runs with BlockOnPossibleDataLoss = true, not configurable. The generated guard is IF EXISTS (SELECT TOP 1 1 FROM [s].[t]), so any row in the table trips it — an all-NULL dropped column doesn't helpCapture what you need, then ALTER TABLE s.t DROP COLUMN c on the live warehouse before syncing, so the plan carries no drop. See fabric-warehouse — Schema Evolution (observed Sept 2026; documented for pipelines)
TMDL validation errorSpaces instead of tabs, or // commentsUse literal tabs; use /// for descriptions
Parts missing after updateDefinitionOnly modified parts sentMust include ALL parts in every update
DefaultJob in job executionWrong jobTypeUse type-specific values: RunNotebook, Pipeline, SparkJob, Refresh
sqlcmd not found or ODBC errorsWrong sqlcmd versionUse Go version: winget install sqlcmd (not ODBC /opt/mssql-tools/ version)
Slow / stale Lakehouse SQLEP queriesSmall-file problem, or metadata-sync lag on newly-landed dataRun OPTIMIZE and VACUUM via Spark. If on the new metadata-sync preview, diagnose staleness via the DMV / targeted refresh in the note below
Query Insights emptyViews not yet generated after creationWait ~2 minutes
OneLake 401Wrong storage audienceMust use https://storage.azure.com/.default exactly
TDS connection timeoutPort 1433 blockedOpen outbound TCP 1433; allow *.datawarehouse.fabric.microsoft.com
Cross-database query failsItems in different regions or workspacesAll items must share same workspace AND region
Notebook upload 400 exceptionCulprit:1Cell source is a bare string, not an arrayConvert every cell's source to array-of-strings form (["line\n", "line\n", "last"]). Applies to markdown and code cells.
CloudEventPropertyMissingException: ...type is missing when publishing to a schema-associated Eventstream custom endpointAttributes sent in the JSON body / structured modeSend binary-mode CloudEvents: cloudEvents:-prefixed Event Hub application properties (not body). See [[fabric-eventstream]] — Producing to a schema-associated custom endpoint
InvalidContent (first issue: ValueMismatch) syncing Git → workspaceVariable Library value-set override names a nonexistent variable (rename not propagated to valueSets/*.json) or an empty valueRename in every value-set file; never commit "" values — use a FILL-ME-style sentinel. See [[fabric-variable-library]]
Deployment-rule dropdowns greyed out for a Direct Lake semantic modelDL on OneLake doesn't support data source rules; no M parameters exist yet for parameter rules (also requires item ownership)Parameterize the workspace/lakehouse GUIDs as M parameters and use parameter rules. See [[fabric-tmdl]] — Direct Lake Configuration
This query contains transformations that can't be used for DirectQuery refreshing a Direct Lake modelParameterized source + the model page's schema-and-data ribbon refresh, which re-evaluates the M (any parameterized shape)False alarm: data-only / workspace-page / scheduled / pipeline refreshes work — they only reframe. See [[fabric-tmdl]] (observed 2026-08-24, undocumented)
Report getDefinition returns a single report.json ("format": "PBIR-Legacy")Report never migrated to the enhanced PBIR folder format; PBIR file tooling can't process legacyRequest GET .../getDefinition?format=PBIR explicitly; if it still comes back legacy, upgrade the report (open + save as PBIP in Desktop, or rebuild) before file-level editing
MissingDefinitionParts on report create/updateDefinitionPart path values built with Windows backslashesPart paths must use forward slashes (definition/pages/.../visual.json) — build them explicitly, never from os.path / Join-Path output
Report publishes fine but every visual is emptyLocal byPath dataset reference pushed as-is, or PBIR field bindings name tables/columns that don't exist in the target modelRebind definition.pbir to byConnection ("connectionString": "semanticmodelid=<runtime-id>") before a single-item REST publish — Learn's Bulk Import example does send byPath to a model in the same request, unmeasured here; diff TMDL table/column names against the PBIR visual bindings to find mismatches
Error loading dashboard / /tiles/N/queryRef ... must have required property 'baseQueryId'Malformed queryRef.queryId UUID — the schema's oneOf fails the query branch and reports the baseQuery branch insteadFix the UUID (RFC-4122, generated not hand-typed). See [[fabric-realtime-dashboard]] (docs: git-real-time-dashboard)
Current tile size (12, 5) is smaller than the minimum supported tile size (15, 3) in one Real-Time Dashboard tile, the rest fineA multistat tile smaller than its slot grid: it needs 3 grid columns per slot column and 3 rows per slot row. No schema or load check catches it; the portal applies it only when it draws the tile (observed 2026-10-01). The portal prints two spaces before the second pair, so search on minimum supported tile sizeResize to at least 3 × slot width by 3 × slot height. See [[fabric-realtime-dashboard]] — Visuals
"LibraryManagementError": "An upgrade to the base Spark Python environment has been detected. Please republish the environment.|UserError", or warning: 1 deprecation (since 2.13.0); for details, enable :setting -deprecation or :replay -deprecation with Source: SparkCoreService — on notebook or SJD executionFabric Runtime 2.0's Python upgrade broke the environment item's python / wheel librariesRepublish the environment empty-first: remove all libraries → publish → re-add all libraries → publish again. See the Runtime 2.0 note below
Top-N visuals render empty AND the service report editor freezes on save-edits (report otherwise renders fine)Hand-authored PBIR TopN filter with the subquery inlined in In.Table (or a bare VisualTopN condition) — passes schema validation and pbir validate, but the engine matches nothing and the editor can't rebuild the filter cardUse the Desktop-canonical shape: subquery declared as a From source (Type: 2), referenced via In.Table.SourceRef. See [[pbir-filters]] — TopN (verified vs microsoft/BCApps, 2026-08)
520 / Internal service error / "@permanent": false from a Kusto admin command, with client advice to retry after backoffA state check reported through the generic internal-error envelope — the envelope's own metadata and retry advice are wrong. Commonly .rename tables against tables with OneLake availability onRead the nested @message before believing @permanent: "Tables cannot be renamed as at least one table has mirroring policy enabled." The command fails atomically, so treat it as a clean no-op and fix the state. Not the cold-table 520 below, which really is transient. See [[fabric-eventhouse]] — Schema Evolution
New column lands empty after a .create-merge, no error, success response with matching record countStreaming ingestion is writing the cached schema; the refresh is automatic but takes minutes.clear table <T> cache streamingingestion schema, or .clear database cache … for every table in one call. Also collapses the cold-table window in which a new table answers 520 to every ingest. See [[fabric-eventhouse]] — Ingestion
InvalidShortcutPayloadBatchErrors, "Target path doesn't exist" on a Lakehouse git syncA OneLake shortcut names a target table that does not exist — this fails the entire Lakehouse update, not just that shortcutAdd a shortcut only after its target exists. Don't let a generator emit shortcuts from a declaration list: a contract can legitimately declare a table before it is created, and the shortcut file is where that gap becomes an outage
SQL71501 ... unresolved reference ... [dbo].[SYSNAME] failing a whole warehouse import on branch-outUppercase built-in type name under a case-sensitive model collation — DacFx resolves it as a missing UDT. The engine stores built-in type names lowercase, so uppercase in a repo file is always a divergence from the live objectWrite built-in type names lowercase (sysname). It executes fine over sqlcmd, so it only surfaces at the DacFx build — which runs on branch-out and new-workspace-from-repo, not on ordinary syncs. See coding-tsql — Casing
Incorrect syntax near '.' importing a warehouse, from a generated CREATE SCHEMA .sharedqueries;A workspace still on warehouse definition 1.0 read a .sharedqueries folder as a schema. Under 2.0 (preview) that folder at the project root is the documented home of every shared query — not a stray, and deleting it on a 2.0 warehouse deletes real queriesUpgrade the workspace (Apply system updates in Source control; every warehouse in it at once) so it understands the folder. Only where the workspace must stay on 1.0: remove the folder from that branch, recovering the scripts from git. Keep hand-authored .sql out of *.Warehouse folders either way — see [[fabric-warehouse]] — Warehouse Authoring Rules
MSB4019, missing NuGet.Build.Tasks.Pack.targets, building a warehouse .sqlproj; or a Git commit/update failing on IDENTITY / CLUSTER BY syntaxStale Microsoft.Build.Sql SDK pin (0.1.x) in a repo committed before the warehouse moved to definition 2.0, itself preview (which pins 2.3.0-preview.1). Not a migration-window blip — it recurs on every path that builds from the repo with no warehouse to sync from: new workspace ← existing repo, branch-out, restoring a deleted warehouse, or syncing from git right after the upgradeWhere the warehouse exists and is healthy, commit workspace → git first (option A) — but it must already be on 2.0, or the commit writes 1.0 back and the next sync fails identically. Otherwise edit the .sqlproj SDK version to the current NuGet release and commit (option B). An export or diff never rewrites the file
Invalid folder path ("Connection failed. Make sure the Git folder exists…") connecting a workspace to a new branch, with no Create and sync offeredThe branch's only commit is empty (git commit --allow-empty), so its root is the empty tree (git ls-tree <branch> prints nothing) and Fabric finds no Git folder there. Not among the troubleshooting page's causes (observed once on GitHub, 2026-09-30; mechanism inferred from GitHub's git/trees/<branch> returning 404 on that commit)Start the branch with a commit holding one file at its root, then connect: a lone README.md worked. Not a file in a subfolder: a Git folder with subdirectories but no item folder can't be connected either (troubleshooting page). Never create a branch Fabric will connect to with --allow-empty. Unverified: whether the root takes / or a blank folder field
Git_HeadNotSynced ("Workspace not synced to the branch head") on every portal commit, and no Update all in the Source control paneThe connected branch's head is a merge commit (inferred: observed once on GitHub, Git folder /, 2026-09-30). A push that changes no item folder is not the cause: single-parent docs-only commits leave workspaceHead ≠ remoteCommitHash with changes empty and no Update all, yet the next portal commit lands on top (observed 2026-09-30 and 2026-10-01), and so did one after four single-parent commits with no net item change. Commits stay disabled until the workspace updates (troubleshooting page)POST …/git/updateFromGit with only workspaceHead and remoteCommitHash from git/status, then commit. Why that body cannot overwrite, the credentials it needs and how to poll it: [[fabric-rest-api]] — Git Integration APIs
Deployment pipeline reports success, but a table dropped in source is still present in the targetDropObjectsNotInSource = false is fixed for warehouse deploys, and a skipped drop-table doesn't fail the run — the target silently drifts from source controlDrop it by hand on the target, accept the drift, or designate a post-deployment script (preview) that runs on every deploy — Learn's uses are cleanup and recreating objects, not table drops specifically, so test it and keep it idempotent. Check Compare after any deploy that removed an object; the green tick doesn't cover drops

Runtime 2.0 environment republish (Aug 2026): the Python 3.13 upgrade in Fabric Runtime 2.0 breaks environment items carrying python and wheel libraries. The remedy is not idempotent-looking and not guessable: remove all libraries → publish → re-add all libraries → publish again. Republishing without emptying it first does not recreate the environment against the new Python. Nothing warns you before the switch, and Runtime 2.0 is planned to become the default for new workspaces and environment items in late September 2026, so this stops being opt-in. See [[fabric-mlv]] and [[fabric-ai-functions]] for the runtime-version prerequisites either side of it.

on endpoints created with the new opt-in metadata sync, target a single table with EXEC sys.sp_dw_refresh_ext_table '<schema.table>' and inspect last sync time / blocked state via sys.dm_db_external_tables_log_status. Full preview note (scope, enablement, limitations): [[fabric-spark]].


Best Practices Summary

MUST

  • Verify workspace has capacity before creating items (capacityId in workspace response)
  • Use parameterized notebooks and pipelines — no hardcoded workspace/item IDs
  • Use Delta Lake format for all Lakehouse tables
  • Include time filters in KQL queries
  • Label queries with OPTION (LABEL = ...) for tracking
  • Always specify database name in SQL connections (-d flag or Initial Catalog)
  • Use Entra ID auth everywhere — SQL auth not supported in Fabric

PREFER

  • Medallion architecture (Bronze/Silver/Gold) for data organization
  • REST APIs for programmatic management over portal clicks
  • Incremental processing over full refreshes
  • CTAS over CREATE TABLE + INSERT for large transforms
  • COPY INTO for external file ingestion
  • DELETE + INSERT over MERGE for production upserts
  • Distributed #temp tables (ROUND_ROBIN) over non-distributed
  • EXISTS over IN for large subqueries
  • UNION ALL over UNION when duplicates are acceptable
  • Integer keys over string keys for relationships

AVOID

  • Hardcoded workspace/item IDs — discover via REST API
  • Confusing .platform logicalId with runtime item ID — they are NOT interchangeable; runtime references need the portal/API ID. For a portal-created item the two are the same 16 bytes reversed, so you can derive one offline — deriving is fine, substituting still fails
  • SELECT * without LIMIT on large tables
  • Long-running transactions (increases conflict window)
  • Singleton INSERT...VALUES at scale (creates tiny Parquet files)
  • DROP TABLE IF EXISTS + CREATE TABLE to refresh (loses time-travel history) — use TRUNCATE + INSERT
  • IFERROR in DAX (performance degradation)
  • FOR XML (use FOR JSON instead)
  • Manual lineageTag or PBI_* annotations in TMDL
  • Unbounded streaming queries
  • MARS in connection strings

Reference

See also

  • fabric-auth skill — token audience table (for 401 diagnosis)
  • fabric-rest-api skill — logicalId vs runtime ID detail
  • fabric-warehouse skill — Warehouse-specific type and feature restrictions
  • fabric-database skill — what's different when it's SQL Database (most restrictions don't apply)
  • fabric-spark skill — notebook upload array-of-strings requirement
  • fabric-realtime-dashboard skill — RealTimeDashboard.json wiring and validation rules

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.