From cd89883dbbafc4fd4af98db067c2bbd877814a57 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 28 Feb 2026 01:02:22 +0100 Subject: [PATCH] apps: move to error state if a volume is unavailable --- src/docker.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/docker.js b/src/docker.js index 0734630b1..b42359eaf 100644 --- a/src/docker.js +++ b/src/docker.js @@ -186,6 +186,8 @@ async function getVolumeMounts(app) { for (const mount of app.mounts) { const volume = volumesById[mount.volumeId]; + const status = await volumes.getStatus(volume); + if (status.state !== 'active') throw new BoxError(BoxError.BAD_STATE, `Volume "${volume.name}" is not active. ${status.message}`); mounts.push({ Source: volume.hostPath, @@ -208,6 +210,11 @@ async function getAddonMounts(app) { for (const addon of Object.keys(addons)) { switch (addon) { case 'localstorage': { + if (app.storageVolumeId) { + const volume = await volumes.get(app.storageVolumeId); + const status = await volumes.getStatus(volume); + if (status.state !== 'active') throw new BoxError(BoxError.BAD_STATE, `Storage volume "${volume.name}" is not active. ${status.message}`); + } const storageDir = await apps.getStorageDir(app); mounts.push({ Target: '/app/data',