{"record":{"id":"5f96d711028ac420","repo":"hcengineering/platform","slug":"sign-service-endpoint-url-is-not-configured","errorCode":null,"errorMessage":"Sign service endpoint url is not configured","messagePattern":"Sign service endpoint url is not configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/sign/src/utils.ts","lineNumber":13,"sourceCode":"//\n// Copyright © 2024 Hardcore Engineering Inc.\n//\n\nimport { getMetadata } from '@hcengineering/platform'\n\nimport sign from './plugin'\n\nexport function getSignBaseURL (): string {\n  const endpoint = getMetadata(sign.metadata.SignURL)\n\n  if (endpoint === undefined || endpoint === '') {\n    throw new Error('Sign service endpoint url is not configured')\n  }\n\n  return endpoint\n}\n\nexport async function signPDF (file: string, token: string): Promise<string> {\n  if (token === '') {\n    return ''\n  }\n\n  const url: URL = new URL(`${getSignBaseURL()}/sign`)\n\n  const request = {\n    fileId: file\n  }\n\n  const response = await fetch(url, {\n    method: 'POST',","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/plugins/sign/src/utils.ts#L1-L31","documentation":"getSignBaseURL reads the e-sign service endpoint from client metadata (sign.metadata.SignURL). If the metadata value is undefined or an empty string, the library cannot know where the signing service lives and throws this error instead of making a request to an invalid URL.","triggerScenarios":"Calling signPDF (or anything resolving a sign URL via getSignBaseURL) in a deployment where the SignURL metadata was never configured — e.g. the server config lacks the sign service entry, or getMetadata is invoked before metadata is injected into the client.","commonSituations":"Self-hosted deployments without the external signing service configured; misconfigured/renamed config key so metadata injection silently skips it; calling sign utilities from unit tests with no metadata setup.","solutions":["Add the sign service URL to the deployment/server configuration so sign.metadata.SignURL is injected into the client","Check for typos/case mismatches in the config key providing SignURL","Verify getMetadata is called after the client connection/metadata injection completes (not in module init code)","In tests, set the metadata manually (e.g. metadata with SignURL) before exercising sign functions"],"exampleFix":"// before (server config)\n// { plugins: {} }\n// after\n// { plugins: { sign: { url: 'https://sign.example.com' } } }\n// or in a test:\nsetMetadata(sign.metadata.SignURL, 'https://sign.example.com')","handlingStrategy":"validation","validationCode":"const endpoint = getMetadata(sign.metadata.SignURL)\nif (endpoint === undefined || endpoint === '') {\n  throw new Error('sign.metadata.SignURL must be configured before using the sign plugin')\n}","typeGuard":"function hasSignUrl (metadata: MetadataProvider | undefined): metadata is MetadataProvider & { sign: { SignURL: string } } {\n  return typeof getMetadata(sign.metadata.SignURL) === 'string' && getMetadata(sign.metadata.SignURL) !== ''\n}","tryCatchPattern":"try {\n  const url = getSignBaseURL()\n  await signPDF(file, token)\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Sign service endpoint')) {\n    showConfigError('Signing service is not configured for this deployment')\n    return\n  }\n  throw err\n}","preventionTips":["Add the sign service URL to deployment config checklists and startup validation","Fail fast at app startup if required metadata (SignURL) is absent","Never call signPDF from code paths that can run without full metadata injection (tests, offline mode)"],"tags":["configuration","missing-metadata","sign-service"],"backgroundTag":"missing-env-var","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}