{"record":{"id":"499e4c3b90ce14c1","repo":"gotify/server","slug":"app-with-id-d-doesn-t-exists","errorCode":null,"errorMessage":"app with id %d doesn't exists","messagePattern":"app with id (.+?) doesn't exists","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"api/application.go","lineNumber":207,"sourceCode":"func (a *ApplicationAPI) DeleteApplication(ctx *gin.Context) {\n\twithID(ctx, \"id\", func(id uint) {\n\t\tapp, err := a.DB.GetApplicationByID(id)\n\t\tif success := successOrAbort(ctx, 500, err); !success {\n\t\t\treturn\n\t\t}\n\t\tif app != nil && app.UserID == auth.GetUserID(ctx) {\n\t\t\tif app.Internal {\n\t\t\t\tctx.AbortWithError(400, errors.New(\"cannot delete internal application\"))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif success := successOrAbort(ctx, 500, a.DB.DeleteApplicationByID(id)); !success {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif app.Image != \"\" {\n\t\t\t\tos.Remove(a.ImageDir + app.Image)\n\t\t\t}\n\t\t} else {\n\t\t\tctx.AbortWithError(404, fmt.Errorf(\"app with id %d doesn't exists\", id))\n\t\t}\n\t})\n}\n\n// UpdateApplication updates an application info by its id.\n// swagger:operation PUT /application/{id} application updateApplication\n//\n// Update an application.\n//\n//\t---\n//\tconsumes: [application/json]\n//\tproduces: [application/json]\n//\tsecurity: [clientTokenAuthorizationHeader: [], clientTokenHeader: [], clientTokenQuery: [], basicAuth: []]\n//\tparameters:\n//\t- name: body\n//\t  in: body\n//\t  description: the application to update\n//\t  required: true","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/gotify/server/blob/14bfc256276775c425f988d621dccfe705de18ac/api/application.go#L189-L225","documentation":"DeleteApplication in api/application.go aborts with 404 when the application id from the URL either does not exist or belongs to a different user than the authenticated one (app == nil or app.UserID != auth.GetUserID(ctx)); the formatted message includes the requested id. Ownership is deliberately hidden behind 404 so callers cannot probe other users' applications.","triggerScenarios":"Thrown at api/application.go:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the application id in the request URL belongs to the authenticated user","List the user's applications first and delete by an id from that list","Do not retry with the same id expecting success — a 404 here is final for that user"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"14bfc256276775c425f988d621dccfe705de18ac","analyzedAt":"2026-09-05T12:52:36.781Z","contentChangedAt":"2026-09-05T12:52:36.781Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}