{"record":{"id":"77856461252c2d6c","repo":"Budibase/budibase","slug":"only-component-plugins-are-supported-outside-of-se","errorCode":null,"errorMessage":"Only component plugins are supported outside of self-host","messagePattern":"Only component plugins are supported outside of self-host","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/api/controllers/plugin/index.ts","lineNumber":115,"sourceCode":"        const {\n          metadata: metadataUrl,\n          directory: directoryUrl,\n          cleanupDirectory: cleanupDirectoryUrl,\n        } = await urlUpload(url, name, headersObj)\n        metadata = metadataUrl\n        directory = directoryUrl\n        cleanupDirectory = cleanupDirectoryUrl\n        break\n      }\n      default:\n        ctx.throw(400, \"Invalid source\")\n    }\n\n    pluginCore.validate(metadata.schema)\n\n    // Only allow components in cloud\n    if (!env.SELF_HOSTED && metadata.schema?.type !== PluginType.COMPONENT) {\n      throw new Error(\n        \"Only component plugins are supported outside of self-host\"\n      )\n    }\n\n    if (\n      metadata.schema?.metadata?.svelteMajor !== 5 &&\n      metadata.schema?.type === PluginType.COMPONENT\n    ) {\n      throw new Error(\"Only Svelte 5 plugins are supported on this branch\")\n    }\n\n    let origin\n    if (source === PluginSource.GITHUB) {\n      const { repo, url: canonical } = sdk.plugins.parseGithubRepo(url)\n      if (repo && canonical) {\n        origin = { source: \"github\" as const, repo, url: canonical }\n      }\n    }","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/plugin/index.ts#L97-L133","documentation":"In Budibase cloud (non-self-hosted) deployments, only component-type plugins may be installed; datasource and other plugin types are restricted to self-hosted installations. The plugin's schema.json type is validated against env.SELF_HOSTED before installation proceeds.","triggerScenarios":"POSTing a plugin with source NPM/GITHUB whose schema.json declares type other than component (e.g. datasource) while env.SELF_HOSTED is falsy — i.e. on Budibase Cloud or any deployment not explicitly set to self-host.","commonSituations":"Installing a datasource plugin in a cloud tenant; running a dev instance without SELF_HOSTED=true in .env while testing datasource plugins; migration from self-host to cloud where the plugin type is no longer allowed.","solutions":["Use a component plugin in cloud deployments","Run self-hosted (set SELF_HOSTED=true) if you need datasource plugins","Verify the plugin's schema.json type field is what you intended","Contact Budibase about datasource plugin availability on cloud"],"exampleFix":"// .env (self-host dev)\n// before\n// SELF_HOSTED=\n// after\nSELF_HOSTED=true","handlingStrategy":"validation","validationCode":"const schema = JSON.parse(await fs.readFile('schema.json', 'utf8'))\nif (!env.SELF_HOSTED && schema.type !== 'component') {\n  throw new Error('Datasource plugins require a self-hosted deployment')\n}","typeGuard":null,"tryCatchPattern":"try {\n  await installPlugin({ source: 'NPM', url })\n} catch (err) {\n  if (err.message === 'Only component plugins are supported outside of self-host') {\n    console.error('Switch to a self-hosted install or use a component plugin')\n  }\n}","preventionTips":["Check your deployment type (SELF_HOSTED env) before choosing plugin types","On cloud, only package component plugins","Confirm schema.json type field matches intent (component vs datasource)","Set SELF_HOSTED=true in dev .env when testing datasource plugins"],"tags":["plugin","environment","policy"],"backgroundTag":"plugin-type-not-permitted","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}