{"record":{"id":"7d93338cca08a824","repo":"Budibase/budibase","slug":"project-package-manifest-is-invalid","errorCode":null,"errorMessage":"Project package manifest is invalid.","messagePattern":"Project package manifest is invalid\\.","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/projects/backups/imports.ts","lineNumber":647,"sourceCode":"        )\n      }\n      return generateRowActionsID(tableId)\n    }\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  }","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/projects/backups/imports.ts#L629-L665","documentation":"validateManifest is the first gate for an imported project package: the manifest JSON must be a record (object). If the parsed project.json manifest is not an object (null, array, string, number), this 400 error is thrown before any content check. It means the package's manifest structure is fundamentally unreadable.","triggerScenarios":"Uploading a file whose manifest is not a JSON object — e.g. an empty file, a plain string, an array, or a file that is not a Budibase project package at all (wrong file selected).","commonSituations":"Uploading the wrong file (a zip of source code, an app export instead of a project package); a corrupted/truncated download; an export produced by incompatible tooling.","solutions":["Re-upload the correct .tar.gz project package exported from Budibase.","Re-download the export — the file may be truncated or corrupted.","Inspect the manifest inside the archive and confirm it is a JSON object with artifactType \"project\".","Verify the export came from a compatible Budibase version."],"exampleFix":"// before: manifest.json containing\n[\"not\",\"an\",\"object\"]\n// after\n{ \"artifactType\": \"project\", \"formatVersion\": 1, \"resourcesByType\": {}, \"unsupportedContent\": [] }","handlingStrategy":"type-guard","validationCode":"let manifest: unknown\ntry { manifest = JSON.parse(manifestRaw) } catch { throw new Error(\"Manifest is not valid JSON\") }\nif (manifest === null || typeof manifest !== \"object\" || Array.isArray(manifest)) throw new Error(\"Manifest must be an object\")","typeGuard":"const isManifestObject = (m: unknown): m is Record<string, unknown> =>\n  typeof m === \"object\" && m !== null && !Array.isArray(m)","tryCatchPattern":"try {\n  await importProjectPackage(file)\n} catch (err) {\n  if (err instanceof HTTPError && err.status === 400 && err.message === \"Project package manifest is invalid.\") {\n    // verify the uploaded file is a Budibase project package\n  }\n  throw err\n}","preventionTips":["Verify the file is the .tar.gz exported by Budibase before upload","Check archive contains a JSON-object manifest","Re-download corrupted transfers"],"tags":["import","manifest-validation","malformed-package","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"}