{"record":{"id":"7b2dcbaff0d40c15","repo":"portainer/portainer","slug":"stack-deployment-is-in-progress","errorCode":null,"errorMessage":"Stack deployment is in progress","messagePattern":"Stack deployment is in progress","errorType":"http","errorClass":"HandlerError","httpStatus":409,"severity":"error","filePath":"api/http/handler/stacks/stack_stop.go","lineNumber":102,"sourceCode":"\tif !access {\n\t\treturn httperror.Forbidden(\"Access denied to resource\", httperrors.ErrResourceAccessDenied)\n\t}\n\n\tcanManage, err := handler.userCanManageStacks(securityContext, endpoint)\n\tif err != nil {\n\t\treturn httperror.InternalServerError(\"Unable to verify user authorizations to validate stack deletion\", err)\n\t}\n\tif !canManage {\n\t\terrMsg := \"stack management is disabled for non-admin users\"\n\t\treturn httperror.Forbidden(errMsg, errors.New(errMsg))\n\t}\n\n\tif stack.Status == portainer.StackStatusInactive {\n\t\treturn httperror.BadRequest(\"Stack is already inactive\", errors.New(\"Stack is already inactive\"))\n\t}\n\n\tif stack.Status == portainer.StackStatusDeploying {\n\t\treturn httperror.Conflict(\"Stack deployment is in progress\", errors.New(\"stack deployment is in progress\"))\n\t}\n\n\tstopErr := handler.stopStack(r.Context(), securityContext.UserID, stack, endpoint)\n\tif stopErr != nil {\n\t\tif err := handler.DataStore.UpdateTx(func(tx dataservices.DataStoreTx) error {\n\t\t\tstackutils.UpdateStackStatusFromUndeploymentResult(stack, stopErr)\n\t\t\treturn tx.Stack().Update(stack.ID, stack)\n\t\t}); err != nil {\n\t\t\tlog.Warn().Err(err).Str(\"context\", \"StackStop\").Msg(\"Unable to update stack status after failed stop attempt\")\n\t\t}\n\n\t\treturn httperror.InternalServerError(\"Unable to stop stack\", stopErr)\n\t}\n\n\terr = handler.DataStore.UpdateTx(func(tx dataservices.DataStoreTx) error {\n\t\tstackutils.UpdateStackStatusFromUndeploymentResult(stack, nil)\n\t\tif err := tx.Stack().Update(stack.ID, stack); err != nil {\n\t\t\treturn httperror.InternalServerError(\"Unable to update stack status\", err)","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/http/handler/stacks/stack_stop.go#L84-L120","documentation":"Error \"Stack deployment is in progress\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/http/handler/stacks/stack_stop.go:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}