{"record":{"id":"24e50d6e3c31e383","repo":"Budibase/budibase","slug":"unable-to-access-minio-s3-check-environment-conf","errorCode":null,"errorMessage":"Unable to access MinIO/S3 - check environment config.","messagePattern":"Unable to access MinIO/S3 - check environment config\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/cli/src/backups/objectStore.ts","lineNumber":63,"sourceCode":"export async function exportObjects() {\n  const path = join(TEMP_DIR, MINIO_DIR)\n  fs.mkdirSync(path, { recursive: true })\n  let fullList: BackupObject[] = []\n  let errorCount = 0\n  for (let bucket of bucketList) {\n    const client = ObjectStore()\n    try {\n      await client.headBucket({\n        Bucket: bucket,\n      })\n    } catch (err) {\n      errorCount++\n      continue\n    }\n    fullList = fullList.concat(await listBucketObjects(client, bucket))\n  }\n  if (errorCount === bucketList.length) {\n    throw new Error(\"Unable to access MinIO/S3 - check environment config.\")\n  }\n  const bar = progressBar(fullList.length)\n  let count = 0\n  for (let object of fullList) {\n    const filename = object.Key\n    const data = await retrieve(object.bucket, filename)\n    const possiblePath = filename.split(\"/\")\n    const destination = join(path, object.bucket, ...possiblePath)\n    fs.mkdirSync(dirname(destination), { recursive: true })\n    if (data instanceof stream.Readable) {\n      await pipeline(data, fs.createWriteStream(destination))\n    } else {\n      fs.writeFileSync(destination, data)\n    }\n    bar.update(++count)\n  }\n  bar.stop()\n}","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/cli/src/backups/objectStore.ts#L45-L81","documentation":"exportObjects in the Budibase CLI backs up app data by listing objects in each MinIO/S3 bucket via the S3 client. It counts buckets whose list call failed; if every bucket failed to list, it concludes the object store is unreachable or misconfigured and throws this error so the backup aborts before downloading objects.","triggerScenarios":"Running `budi backups export` (exportBackup -> exportObjects) when MinIO/S3 is not running, MINIO/S3 env vars (URL, access key, secret key) are wrong, credentials don't match, the bucket list is non-empty but every listBucketObjects call errors, or network/DNS blocks the S3 endpoint.","commonSituations":"Self-hosting where the Docker MinIO container is stopped; switching from MinIO to AWS S3 (or vice versa) without updating env config; expired/rotated access keys; typo'd MINIO_URL port; firewalled/offline environment.","solutions":["Verify the MinIO/S3 service is running: `docker ps` for the minio container, or `curl` the S3 health endpoint","Check the object-store env vars (MINIO_URL/MINIO_ACCESS_KEY/MINIO_SECRET_KEY or AWS equivalents) in the CLI environment match the running store","Test credentials with an S3 client, e.g. `aws s3 ls s3://<bucket> --endpoint-url <url>`","Confirm network reachability/DNS to the endpoint from the machine running the CLI","Retain at least one reachable bucket or empty the bucket list if you intend to skip object data"],"exampleFix":"# before\nMINIO_URL=http://localhost:9002  # MinIO container not started\n# after\ndocker compose up -d minio  # then rerun export with correct MINIO_URL/keys","handlingStrategy":"retry","validationCode":"import { S3Client, HeadBucket } from \"@aws-sdk/client-s3\"\nasync function assertObjectStoreReachable(client: S3Client, buckets: string[]) {\n  for (const bucket of buckets) {\n    await client.send(new HeadBucket({ Bucket: bucket })) // throws if unreachable\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await exportBackup(config)\n} catch (err) {\n  if ((err as Error).message.includes(\"Unable to access MinIO/S3\")) {\n    console.error(\"Object store unreachable: check MinIO container and MINIO_* env vars\")\n    // optionally retry with backoff after checking the service\n  }\n  throw err\n}","preventionTips":["Health-check MinIO/S3 (`curl <MINIO_URL>/minio/health/live`) before running backups","Keep MINIO_URL/MINIO_ACCESS_KEY/MINIO_SECRET_KEY (or AWS keys) in sync with the running store","Run backups inside the same Docker network as the object store when self-hosting","Monitor bucket accessibility and rotate credentials before expiry"],"tags":["cli","backups","s3","minio","environment"],"backgroundTag":"object-store-unreachable","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}