{"record":{"id":"e3d2c47d0338bc42","repo":"Budibase/budibase","slug":"file-filename-not-found-cannot-update-servic","errorCode":null,"errorMessage":"File ${filename} not found, cannot update ${service} image.","messagePattern":"File (.+?) not found, cannot update (.+?) image\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/hosting/utils.ts","lineNumber":42,"sourceCode":"  try {\n    const { services } = getServices(filename)\n    const serviceKey = Object.keys(services).find(name =>\n      name.includes(service)\n    )\n    if (serviceKey) {\n      return services[serviceKey].image\n    } else {\n      return null\n    }\n  } catch (err) {\n    return null\n  }\n}\n\nexport function setServiceImage(service: string, image: string) {\n  const filename = composeFilename()\n  if (!fs.existsSync(filename)) {\n    throw new Error(\n      `File ${filename} not found, cannot update ${service} image.`\n    )\n  }\n  const current = getServiceImage(service)!\n  let contents = fs.readFileSync(filename, \"utf8\")\n  contents = contents.replace(`image: ${current}`, `image: ${image}`)\n  fs.writeFileSync(filename, contents)\n}\n\nexport async function downloadDockerCompose() {\n  try {\n    const files = [COMPOSE_URL, LITELLM_CONFIG_URL]\n    for (const fileUrl of files) {\n      await downloadFile(fileUrl, `./${hostingFilename(fileUrl)}`)\n    }\n  } catch (err) {\n    console.error(error(`Failed to retrieve required hosting files - ${err}`))\n  }","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/cli/src/hosting/utils.ts#L24-L60","documentation":"setServiceImage rewrites the `image:` line for a given service in the Budibase hosting docker-compose file. First it resolves the compose filename via composeFilename() and requires it to exist on disk; if the file is missing it throws this error naming the expected path and the service being updated. Called by the CLI's hosting `update` flow.","triggerScenarios":"Running `budi hosting update` (or otherwise calling setServiceImage) when the docker-compose file (composeFilename(), typically docker-compose.yaml in the hosting directory) has not been generated yet, was deleted, or the CLI is run from a directory where it doesn't exist.","commonSituations":"Running hosting update before ever running `budi hosting init`; deleting/moving docker-compose.yaml manually; running the CLI from the wrong working directory; compose file created under a different name than the CLI expects.","solutions":["Run `budi hosting init` first to generate the docker-compose file in the current directory","Check the path printed in the error and create/restore docker-compose.yaml there","cd into the directory that actually contains the compose file before running hosting commands","If migrating hosting setups, copy the original docker-compose.yaml to the expected location"],"exampleFix":"# before\n$ budi hosting update --image budibase/budibase:latest   # no compose file\n# after\n$ budi hosting init   # generates docker-compose.yaml\n$ budi hosting update --image budibase/budibase:latest","handlingStrategy":"validation","validationCode":"const fs = require(\"fs\")\nfunction assertComposeFile(dir = \".\") {\n  const p = dir + \"/docker-compose.yaml\"\n  if (!fs.existsSync(p)) {\n    throw new Error(\"Run `budi hosting init` first to generate docker-compose.yaml\")\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  setServiceImage(\"app\", \"budibase/budibase:latest\")\n} catch (err) {\n  if ((err as Error).message.includes(\"not found, cannot update\")) {\n    console.error(\"Compose file missing - run `budi hosting init` first\")\n  }\n  throw err\n}","preventionTips":["Always run `budi hosting init` before hosting update/upgrade commands","Run hosting commands from the directory containing docker-compose.yaml","Don't rename or move the generated compose file","Script checks: verify the compose file exists in CI/deploy pipelines before updates"],"tags":["cli","hosting","docker-compose","file-not-found"],"backgroundTag":"config-file-missing","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}