{"record":{"id":"5bc9fe8720a0b35a","repo":"mastra-ai/mastra","slug":"unsupported-artifact-file-type-artifactpath","errorCode":null,"errorMessage":"Unsupported artifact file type: ${artifactPath}","messagePattern":"Unsupported artifact file type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/experiment/ExperimentBundler.ts","lineNumber":286,"sourceCode":"        });\n      } else if (stats.isSymbolicLink()) {\n        const target = await readlink(fullPath);\n        if (isAbsolute(target)) {\n          throw new Error(`Experiment worker artifacts cannot contain absolute symlinks: ${artifactPath}`);\n        }\n        const resolvedTarget = resolve(dirname(fullPath), target);\n        const artifactTarget = relative(root, resolvedTarget);\n        if (artifactTarget === '..' || artifactTarget.startsWith(`..${sep}`) || isAbsolute(artifactTarget)) {\n          throw new Error(`Experiment worker artifacts cannot contain escaping symlinks: ${artifactPath}`);\n        }\n        files.push({\n          path: artifactPath,\n          type: 'symlink',\n          target,\n          sha256: createHash('sha256').update(target).digest('hex'),\n        });\n      } else {\n        throw new Error(`Unsupported artifact file type: ${artifactPath}`);\n      }\n    }\n  };\n  await visit(root);\n  return files;\n}\n","sourceCodeStart":268,"sourceCodeEnd":293,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/cli/src/commands/experiment/ExperimentBundler.ts#L268-L293","documentation":"The artifact collector only understands regular files, directories, and symbolic links (per lstat). Any other filesystem entry — FIFOs, sockets, device files — found in the bundler output directory cannot be represented in the artifact manifest, so the build throws with the entry's path. This guards manifest integrity: the digest list must fully describe the artifact.","triggerScenarios":"collectFileDigests walks the output directory and lstat() returns a type that is neither file, directory, nor symlink (e.g. a named pipe or socket created in the output dir).","commonSituations":"A dev server or tool that creates a Unix socket/FIFO inside the project or output directory; a previous crashed process leaving a pipe in the build dir; misconfigured outputDir pointing at a directory containing runtime IPC files.","solutions":["Delete the special file listed in the message (e.g. `rm mypipe` / remove the .sock file) and rebuild.","Find what creates it (a dev server, watcher, or script) and redirect it to /tmp or another directory.","Ensure outputDir points to a dedicated build directory (default .mastra/experiment-worker) that nothing else writes runtime files into.","Clean the output directory fully before rebuilding."],"exampleFix":"// before\n# output dir contains a fifo created by a local dev server\n$ rm .mastra/experiment-worker/myfifo\n// after\n# configure the dev server socket path outside the output dir, e.g. /tmp/app.sock, then rebuild","handlingStrategy":"validation","validationCode":"import { lstat, readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nasync function assertOnlyRegularFiles(dir: string) {\n  for (const e of await readdir(dir, { withFileTypes: true })) {\n    const p = join(dir, e.name);\n    if (e.isDirectory()) await assertOnlyRegularFiles(p);\n    else {\n      const st = await lstat(p);\n      if (!st.isFile() && !st.isSymbolicLink()) throw new Error(`special file in build output: ${p}`);\n    }\n  }\n}","typeGuard":"null","tryCatchPattern":"try {\n  await buildExperimentWorker({ outputDir });\n} catch (e) {\n  if (String(e?.message).includes('Unsupported artifact file type')) {\n    console.error('Remove the FIFO/socket/device file listed and redirect whatever creates it');\n  } else throw e;\n}","preventionTips":["Point dev-server sockets/pipes outside the build output directory","Use a dedicated output directory nothing else writes into","Clean the output dir before builds","Find and fix crashed processes leaving IPC files behind"],"tags":["build","filesystem","artifact-integrity"],"backgroundTag":"unsupported-file-type","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}