hcengineering/platform · error

Sign service endpoint url is not configured

Error message

Sign service endpoint url is not configured

What it means

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.

Source

Thrown at plugins/sign/src/utils.ts:13

//
// Copyright © 2024 Hardcore Engineering Inc.
//

import { getMetadata } from '@hcengineering/platform'

import sign from './plugin'

export function getSignBaseURL (): string {
  const endpoint = getMetadata(sign.metadata.SignURL)

  if (endpoint === undefined || endpoint === '') {
    throw new Error('Sign service endpoint url is not configured')
  }

  return endpoint
}

export async function signPDF (file: string, token: string): Promise<string> {
  if (token === '') {
    return ''
  }

  const url: URL = new URL(`${getSignBaseURL()}/sign`)

  const request = {
    fileId: file
  }

  const response = await fetch(url, {
    method: 'POST',

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Add the sign service URL to the deployment/server configuration so sign.metadata.SignURL is injected into the client
  2. Check for typos/case mismatches in the config key providing SignURL
  3. Verify getMetadata is called after the client connection/metadata injection completes (not in module init code)
  4. In tests, set the metadata manually (e.g. metadata with SignURL) before exercising sign functions

Example fix

// before (server config)
// { plugins: {} }
// after
// { plugins: { sign: { url: 'https://sign.example.com' } } }
// or in a test:
setMetadata(sign.metadata.SignURL, 'https://sign.example.com')
Defensive patterns

Strategy: validation

Validate before calling

const endpoint = getMetadata(sign.metadata.SignURL)
if (endpoint === undefined || endpoint === '') {
  throw new Error('sign.metadata.SignURL must be configured before using the sign plugin')
}

Type guard

function hasSignUrl (metadata: MetadataProvider | undefined): metadata is MetadataProvider & { sign: { SignURL: string } } {
  return typeof getMetadata(sign.metadata.SignURL) === 'string' && getMetadata(sign.metadata.SignURL) !== ''
}

Try / catch

try {
  const url = getSignBaseURL()
  await signPDF(file, token)
} catch (err) {
  if (err instanceof Error && err.message.includes('Sign service endpoint')) {
    showConfigError('Signing service is not configured for this deployment')
    return
  }
  throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/5f96d711028ac420. Report an issue: GitHub.