{"record":{"id":"07ecb8fb622df6d1","repo":"Budibase/budibase","slug":"supplied-file-is-not-a-project-package","errorCode":null,"errorMessage":"Supplied file is not a Project package.","messagePattern":"Supplied file is not a Project package\\.","errorType":"validation","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/projects/backups/imports.ts","lineNumber":650,"sourceCode":"    }\n    case ResourceType.WORKSPACE_APP:\n      return docIds.generateWorkspaceAppID()\n    case ResourceType.SCREEN:\n      return generateScreenID()\n    default:\n      throw new HTTPError(\n        `Project import does not support resource type '${resourceType}'.`,\n        400\n      )\n  }\n}\n\nconst validateManifest = (manifest: ProjectPackageManifest) => {\n  if (!isRecord(manifest)) {\n    throw new HTTPError(\"Project package manifest is invalid.\", 400)\n  }\n  if (manifest.artifactType !== \"project\") {\n    throw new HTTPError(\"Supplied file is not a Project package.\", 400)\n  }\n  if (manifest.formatVersion !== PROJECT_EXPORT_FORMAT_VERSION) {\n    throw new HTTPError(\n      `Unsupported Project package format version '${manifest.formatVersion}'.`,\n      400\n    )\n  }\n  if (\n    !isRecord(manifest.sourceWorkspace) ||\n    typeof manifest.sourceWorkspace.id !== \"string\" ||\n    !isRecord(manifest.resourcesByType) ||\n    !Array.isArray(manifest.unsupportedContent)\n  ) {\n    throw new HTTPError(\"Project package manifest is invalid.\", 400)\n  }\n  for (const count of Object.values(manifest.resourcesByType)) {\n    if (!Number.isInteger(count) || Number(count) < 0) {\n      throw new HTTPError(\"Project package manifest is invalid.\", 400)","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/projects/backups/imports.ts#L632-L668","documentation":"After confirming the manifest is an object, the importer checks manifest.artifactType equals \"project\". This error is thrown when the uploaded package is a valid record but a different artifact type — e.g. an application backup or plugin package rather than a project package. It is a kind mismatch, not a corruption error.","triggerScenarios":"Uploading an app-level export (artifactType other than \"project\") through the project import endpoint; mixing up backup artifacts from different product areas.","commonSituations":"Users selecting an old app export from the import dialog; automation tooling posting the wrong artifact; artifacts exported before the project-package format was introduced.","solutions":["Export a project package (artifactType \"project\") from the workspace backup UI/API instead of using the app export.","Confirm the file's manifest artifactType before importing.","Use the correct import endpoint for the artifact type you actually have.","Re-export from the intended source workspace."],"exampleFix":"// before: wrong artifact\n{ \"artifactType\": \"app\" }\n// after\n{ \"artifactType\": \"project\", \"formatVersion\": 1 }","handlingStrategy":"validation","validationCode":"if (manifest.artifactType !== \"project\") throw new Error(`Wrong artifact type: ${manifest.artifactType}; expected \"project\"`)","typeGuard":"const isProjectPackage = (m: { artifactType?: string }): boolean => m.artifactType === \"project\"","tryCatchPattern":"try {\n  await importProjectPackage(file)\n} catch (err) {\n  if (err instanceof HTTPError && err.status === 400 && err.message.includes(\"not a Project package\")) {\n    // route user to the correct import flow for their artifact type\n  }\n  throw err\n}","preventionTips":["Use the project export (not app export) for project imports","Label exported artifacts clearly by type","Check artifactType in the manifest before calling the import API"],"tags":["import","manifest-validation","wrong-artifact-type","project-package"],"backgroundTag":"manifest-schema-validation-failed","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}