diff --git a/src/apps.js b/src/apps.js index 91824483c..6ad34c518 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1397,9 +1397,8 @@ function repair(appId, data, auditSource, callback) { get(appId, function (error, app) { if (error) return callback(error); - if (app.installationState !== exports.ISTATE_ERROR) return new AppsError(AppsError.BAD_STATE, 'Only allowed in error state'); - const appError = app.error || {}; + const appError = app.error || {}; // repair can always be called const newState = appError.installationState ? appError.installationState : exports.ISTATE_PENDING_CONFIGURE; debug(`Repairing app with error: ${JSON.stringify(error)} and state: ${newState}`); @@ -1413,7 +1412,7 @@ function repair(appId, data, auditSource, callback) { if ('overwriteDns' in data) args.overwriteDns = data.overwriteDns; // create a new task instead of updating the old one, since it helps tracking - addTask(appId, newState, { args, values, requiredState: exports.ISTATE_ERROR }, function (error, result) { + addTask(appId, newState, { args, values, requiredState: null }, function (error, result) { if (error) return callback(error); eventlog.add(eventlog.ACTION_APP_REPAIR, auditSource, { taskId: result.taskId, app, newState });