{"record":{"id":"2ff1947516783ac8","repo":"Dokploy/dokploy","slug":"no-application-selected-make-sure-to-select-an-a","errorCode":null,"errorMessage":"No Application Selected:\n\nMake Sure to select an application to monitor.","messagePattern":"No Application Selected:\n\nMake Sure to select an application to monitor\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/dokploy/server/api/routers/user.ts","lineNumber":537,"sourceCode":"\t\t\twith: {\n\t\t\t\torganization: true,\n\t\t\t},\n\t\t});\n\t}),\n\n\tgetContainerMetrics: withPermission(\"monitoring\", \"read\")\n\t\t.input(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\ttoken: z.string(),\n\t\t\t\tappName: z.string(),\n\t\t\t\tdataPoints: z.string(),\n\t\t\t}),\n\t\t)\n\t\t.query(async ({ input }) => {\n\t\t\ttry {\n\t\t\t\tif (!input.appName) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\"No Application Selected:\",\n\t\t\t\t\t\t\t\"\",\n\t\t\t\t\t\t\t\"Make Sure to select an application to monitor.\",\n\t\t\t\t\t\t].join(\"\\n\"),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst url = new URL(`${input.url}/metrics/containers`);\n\t\t\t\turl.searchParams.append(\"limit\", input.dataPoints);\n\t\t\t\turl.searchParams.append(\"appName\", input.appName);\n\t\t\t\tconst response = await fetch(url.toString(), {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\tAuthorization: `Bearer ${input.token}`,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Error ${response.status}: ${response.statusText}. Please verify that the application \"${input.appName}\" is running and this service is included in the monitoring configuration.`,","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/apps/dokploy/server/api/routers/user.ts#L519-L555","documentation":"A plain Error (not a TRPCError) thrown by Dokploy's monitoring data-points query when input.appName is empty/falsy. The query forwards the app name to an external monitoring endpoint, so it refuses to run without a target. Because it lacks a TRPC code, the client receives it as an internal/unhandled error shape.","triggerScenarios":"Invoking the readMonitoringDataPoints (or similarly named) query with appName: '' or undefined, e.g. a dashboard chart rendering before the user selects an application.","commonSituations":"UI race where the monitoring panel mounts before app selection state hydrates; dropdown defaulting to an empty string; programmatic callers looping over projects with missing app names.","solutions":["Guard the caller: skip the query when appName is empty (enabled: !!appName in react-query)","Set a non-empty default app selection before rendering the monitoring panel","Make the input schema stricter (z.string().min(1)) so it fails validation with a clear BAD_REQUEST instead"],"exampleFix":"// before\nconst { data } = trpc.user.readMonitoringDataPoints.useQuery({ appName, token, ... });\n\n// after\nconst { data } = trpc.user.readMonitoringDataPoints.useQuery(\n  { appName, token, ... },\n  { enabled: Boolean(appName) },\n);","handlingStrategy":"validation","validationCode":"const { data } = trpc.user.readMonitoringDataPoints.useQuery(\n  { appName, token, dataPoints },\n  { enabled: Boolean(appName) },\n);","typeGuard":"const hasAppName = (i: { appName?: string }): i is { appName: string } =>\n  typeof i.appName === 'string' && i.appName.length > 0;","tryCatchPattern":null,"preventionTips":["Disable fetch/query until an app is selected","Default the select to the first available app","Tighten the zod input to z.string().min(1) so validation fails first"],"tags":["dokploy","trpc","monitoring","input-validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}