diff --git a/dashboard/src/components/AppRepairDialog.vue b/dashboard/src/components/AppRepairDialog.vue index 84a522c5e..de1d716fb 100644 --- a/dashboard/src/components/AppRepairDialog.vue +++ b/dashboard/src/components/AppRepairDialog.vue @@ -25,7 +25,7 @@ async function onSubmit() { busy.value = true; formError.value = ''; - const errorState = (appError.value && appError.value.installationState) || ISTATES.PENDING_CONFIGURE; + const errorState = (appError.value && appError.value.details?.installationState) || ISTATES.PENDING_CONFIGURE; const data = {}; let repairFunc; @@ -95,7 +95,7 @@ defineExpose({ fqdn.value = app.fqdn; appError.value = app.error || null; - const errorState = (app.error && app.error.installationState) || ISTATES.PENDING_CONFIGURE; + const errorState = (app.error && app.error.details?.installationState) || ISTATES.PENDING_CONFIGURE; if (errorState === ISTATES.PENDING_RESTORE || errorState === ISTATES.PENDING_IMPORT) { const [error, result] = await appsModel.backups(app.id); diff --git a/src/apps.js b/src/apps.js index c879a4fc2..3f56cc202 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1296,7 +1296,7 @@ async function addTask(appId, installationState, task, auditSource) { assert.strictEqual(typeof auditSource, 'object'); const { args, values } = task; - // TODO: match the SQL logic to match checkAppState. this means checking the error.installationState and installationState. Unfortunately, former is JSON right now + // TODO: match the SQL logic to match checkAppState. this means checking the error.details.installationState and installationState. Unfortunately, former is JSON right now const requiredState = null; // 'requiredState' in task ? task.requiredState : exports.ISTATE_INSTALLED; const scheduleNow = 'scheduleNow' in task ? task.scheduleNow : true; const requireNullTaskId = 'requireNullTaskId' in task ? task.requireNullTaskId : true; @@ -1320,7 +1320,7 @@ function checkAppState(app, state) { if (app.installationState === exports.ISTATE_ERROR) { // allow task to be called again if that was the errored task - if (app.error.installationState === state) return null; + if (app.error.details?.installationState === state) return null; // allow uninstall from any state if (state !== exports.ISTATE_PENDING_UNINSTALL && state !== exports.ISTATE_PENDING_RESTORE && state !== exports.ISTATE_PENDING_IMPORT) return new BoxError(BoxError.BAD_STATE, 'Not allowed in error state'); @@ -2246,7 +2246,7 @@ async function repair(app, data, auditSource) { assert.strictEqual(typeof auditSource, 'object'); const appId = app.id; - let errorState = (app.error && app.error.installationState) || exports.ISTATE_PENDING_CONFIGURE; + let errorState = (app.error && app.error.details?.installationState) || exports.ISTATE_PENDING_CONFIGURE; const task = { args: {},