{"record":{"id":"5cb612d85fa02071","repo":"Budibase/budibase","slug":"app-export-does-not-appear-to-be-valid-no-db-fil","errorCode":null,"errorMessage":"App export does not appear to be valid - no DB file found.","messagePattern":"App export does not appear to be valid - no DB file found\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/server/src/sdk/workspace/backups/imports.ts","lineNumber":283,"sourceCode":"    template.file && (await fsp.lstat(template.file.path)).isDirectory()\n  let tmpPath: string | undefined = undefined\n  if (template.file && (isTar || isDirectory)) {\n    tmpPath = isTar ? await untarFile(template.file) : template.file.path\n    if (isTar && template.file.password) {\n      await decryptFiles(tmpPath, template.file.password)\n    }\n    const contents = await fsp.readdir(tmpPath)\n    const stillEncrypted = !!contents.find(name => name.endsWith(\".enc\"))\n    if (stillEncrypted) {\n      throw new Error(\"Files are encrypted but no password has been supplied.\")\n    }\n    const isPlugin = !!contents.find(name => name === \"plugin.min.js\")\n    if (isPlugin) {\n      throw new Error(\"Supplied file is a plugin - cannot import as app.\")\n    }\n    const isInvalid = !contents.find(name => name === DB_EXPORT_FILE)\n    if (isInvalid) {\n      throw new Error(\n        \"App export does not appear to be valid - no DB file found.\"\n      )\n    }\n    // have to handle object import\n    if (importOpts.importObjStoreContents) {\n      const promises = []\n      const excludedFiles = [GLOBAL_DB_EXPORT_FILE, DB_EXPORT_FILE]\n\n      for (let filename of contents) {\n        const path = join(tmpPath, filename)\n        if (excludedFiles.includes(filename)) {\n          continue\n        }\n        filename = join(objectStoreProdAppId, filename)\n        if ((await fsp.lstat(path)).isDirectory()) {\n          promises.push(\n            objectStore.uploadDirectory(ObjectStoreBuckets.APPS, path, filename)\n          )","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/backups/imports.ts#L265-L301","documentation":"importApp validates the extracted package contains DB_EXPORT_FILE (the database dump, e.g. db/dump.txt). If absent the archive is not a valid app export and the import aborts with this message, preventing creation of a broken app without database contents.","triggerScenarios":"importApp called with an archive that lacks the expected DB export file — e.g. a zipped folder of assets, an object-store-only export, an archive from an incompatible/older format, or a truncated upload that lost the db directory.","commonSituations":"Hand-crafted or third-party archives renamed to .tar.gz and imported; exports from very old Budibase versions with a different layout; uploads truncated in transit so files are missing after extraction; importing a workspace backup file through the app import endpoint.","solutions":["Re-export the app from the source environment using the standard export feature and import that archive","Verify the archive contains the DB dump path (db/dump.txt) with `tar -tzf export.tar.gz`","Re-upload the file if the transfer was truncated/corrupted and confirm sizes match","Check Budibase version compatibility between exporting and importing environments"],"exampleFix":"// before\ntar -czf bundle.tar.gz assets/   // no db dump inside\n// after\nbudibase export --output export.tar.gz  // contains db/dump.txt","handlingStrategy":"validation","validationCode":"const listing = execSync(`tar -tzf ${archivePath}`).toString()\nif (!listing.includes(\"dump.txt\")) {\n  throw new Error(\"Archive lacks the app DB export\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importApp(template)\n} catch (err: any) {\n  if (err.message.includes(\"no DB file found\")) {\n    // obtain a fresh valid export\n  } else {\n    throw err\n  }\n}","preventionTips":["Verify export archives contain db/dump.txt before import","Use the official export feature only","Check upload integrity via checksums to prevent truncation"],"tags":["import","invalid-export","validation"],"backgroundTag":"invalid-archive-format","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}