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',