{"record":{"id":"0a1142b881812731","repo":"Crosstalk-Solutions/project-nomad","slug":"service-params-name-not-found","errorCode":null,"errorMessage":"Service ${params.name} not found","messagePattern":"Service (.+?) not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"admin/app/controllers/system_controller.ts","lineNumber":559,"sourceCode":"            return response.status(403).send({ success: false, message: 'Only custom apps can be updated this way.' })\n        }\n\n        const result = await this.dockerService.recreateCustomAppContainer(payload.service_name, {\n            forcePull: true,\n        })\n        if (result.success) {\n            return response.send({ success: true, message: result.message })\n        }\n        return response.status(400).send({ success: false, message: result.message })\n    }\n\n    /** Return the last N lines of a service container's logs. */\n    async getServiceLogs({ params, request, response }: HttpContext) {\n        // Scope to managed services only — otherwise any sibling container's logs (admin app,\n        // database) would be readable by name on this unauthenticated API surface.\n        const service = await Service.query().where('service_name', params.name).first()\n        if (!service) {\n            return response.status(404).send({ success: false, message: `Service ${params.name} not found` })\n        }\n        const { tail } = await request.validateUsing(serviceLogsValidator)\n        const result = await this.dockerService.getContainerLogs(params.name, tail ?? 200)\n        if (!result.success) {\n            return response.status(404).send({ success: false, message: result.message })\n        }\n        return response.send({ success: true, logs: result.logs })\n    }\n\n    /** Return a one-shot CPU/memory usage snapshot for a running service container. */\n    async getServiceStats({ params, response }: HttpContext) {\n        // Scope to managed services only (see getServiceLogs).\n        const service = await Service.query().where('service_name', params.name).first()\n        if (!service) {\n            return response.status(404).send({ success: false, message: `Service ${params.name} not found` })\n        }\n        const result = await this.dockerService.getContainerStats(params.name)\n        if (!result.success) {","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/Crosstalk-Solutions/project-nomad/blob/0bd1c6f4f9888d577fe232de06ac144bb8337131/admin/app/controllers/system_controller.ts#L541-L577","documentation":"HTTP 404 from getServiceLogs when no Service row matches the service_name route param. The endpoint is scoped to managed services so arbitrary sibling containers (admin app, database) are not readable by name.","triggerScenarios":"GET /services/:name/logs where :name is not a row in the services table — typo'd name, unmanaged container name like the postgres container, or a service not yet registered.","commonSituations":"Guessing the docker container name instead of the registered service_name; querying logs of infrastructure containers; stale frontend cached name after a service was removed.","solutions":["List services via the services index endpoint and use the exact service_name","If the service should exist, re-run its installer/registration","Do not attempt to read infra containers (database, admin) through this route"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const services = await api.listServices()\nif (!services.some((s) => s.service_name === name)) return notFound()","typeGuard":null,"tryCatchPattern":"try { await getLogs(name) } catch (e: any) { if (e.status === 404) show('Unknown service') else throw e }","preventionTips":["Always source names from the services list","Never pass raw container names"],"tags":["http-404","service-lookup","container-logs"],"backgroundTag":"resource-not-found","analyzedSha":"0bd1c6f4f9888d577fe232de06ac144bb8337131","analyzedAt":"2026-08-27T05:34:15.424Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}