{"record":{"id":"cb19d84da5f5eced","repo":"langgenius/dify","slug":"usage-missing-arg-cb19d8","errorCode":"usage_missing_arg","errorMessage":"--host is required (no TTY)","messagePattern":"--host is required \\(no TTY\\)","errorType":"error_code","errorClass":"BaseError","httpStatus":null,"severity":"error","filePath":"cli/src/commands/auth/login/login.ts","lineNumber":108,"sourceCode":"\n  await storeBundle.store.write(display, email, success.token)\n\n  const reg = await Registry.load()\n  reg.token_storage = storeBundle.mode\n  reg.activate(display, email, ctx)\n  applyScheme(reg, display, host)\n  reg.setInsecureTls(display, insecure)\n  await reg.save()\n\n  renderLoggedIn(opts.io.out, cs, host, success)\n  return reg\n}\n\nasync function resolveLoginHost(opts: LoginOptions, insecure: boolean): Promise<string> {\n  const raw = opts.host?.trim() ?? ''\n  if (raw !== '') return resolveHost({ raw, insecure })\n  if (!opts.io.isErrTTY) {\n    throw new BaseError({\n      code: ErrorCode.UsageMissingArg,\n      message: '--host is required (no TTY)',\n      hint: \"pass the host explicitly, e.g. 'difyctl auth login --host cloud.dify.ai'\",\n    })\n  }\n  return promptHost(opts.io, insecure)\n}\n\nfunction makeHostParser(insecure: boolean): (raw: string) => ParseResult<string> {\n  return (raw: string) => {\n    try {\n      return { ok: true, value: resolveHost({ raw, insecure }) }\n    } catch (err) {\n      if (isBaseError(err)) {\n        const msg = err.hint !== undefined ? `${err.message} — ${err.hint}` : err.message\n        return { ok: false, error: msg }\n      }\n      return { ok: false, error: String(err) }","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/cli/src/commands/auth/login/login.ts#L90-L126","documentation":"Raised by PipelineTemplateDetailApi.get (GET /rag/pipeline/templates/{template_id}) when RagPipelineService.get_pipeline_template_detail returns None. The detail lookup is delegated to an upstream service (built-in template registry or customized-template store) keyed by template_id and req_data.type. A None result means the template_id is unknown for the requested type. Maps to HTTP 404.","triggerScenarios":"GET /console/api/rag/pipeline/templates/{template_id}?type=built-in where template_id is not in the upstream built-in catalog; or ?type=customized where the tenant has no customized template with that id; upstream template service temporarily returned empty due to a fetch failure parsed as None.","commonSituations":"Template was removed upstream in a newer Dify version; client cached a template_id from a previous version; customized template was deleted by another tenant member; network/upstream blip returned an empty body that the service coerced to None.","solutions":["List templates first via GET /rag/pipeline/templates?type={type} and use an id returned by that call.","Retry once after a short delay to rule out a transient upstream empty response.","If the template was deleted upstream, pick a current built-in template or restore the customized template."],"exampleFix":"// before\nconst detail = await get(`/rag/pipeline/templates/${id}?type=built-in`);\n// after\nconst list = await get(`/rag/pipeline/templates?type=built-in`).then(r => r.json());\nconst id = list.pipeline_templates[0].id;  // use a known-good id\nconst detail = await get(`/rag/pipeline/templates/${id}?type=built-in`);","handlingStrategy":"validation","validationCode":"async function templateExists(client, templateId: string, type: 'built-in' | 'customized'): Promise<boolean> {\n  const r = await client.get(`/console/api/rag/pipeline/templates?type=${type}`);\n  const list = await r.json();\n  return Array.isArray(list.pipeline_templates) && list.pipeline_templates.some(t => t.id === templateId);\n}","typeGuard":"function isKnownTemplateId(id: string, known: Set<string>): boolean { return known.has(id); }","tryCatchPattern":"try {\n  return await client.get(`/rag/pipeline/templates/${templateId}?type=${type}`);\n} catch (e) {\n  if (e.response?.status === 404) {\n    await refreshTemplateList(type);  // could also be a transient upstream empty\n    return null;\n  }\n  throw e;\n}","preventionTips":["Resolve template_id from the list endpoint at runtime rather than hardcoding.","Treat a 404 as 'pick another template'; do not retry the same id indefinitely.","If upstream reliability is a concern, retry once after a short delay to rule out a transient empty response."],"tags":["rag-pipeline","template","not-found","upstream","rest-api","console"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}