goharbor/harbor · error · Exception

Jaeger Colector Endpoint or Agent host not set, must set one

Error message

Jaeger Colector Endpoint or Agent host not set, must set one

What it means

GetScanReport on the v1 adapter client fetches the report of a previously submitted scan. The first argument must be the scan request ID returned in ScanResponse.ID by SubmitScan; an empty ID is rejected before the request URL is even built, since there is no scan to address.

Source

Thrown at make/photon/prepare/models.py:153

        if not port_number_valid(self.port):
            raise Exception('Port number in metrics is not valid')


class JaegerExporter:
    def __init__(self, config: dict):
        if not config:
            self.enabled = False
            return
        self.enabled = True
        self.endpoint = config.get('endpoint')
        self.username = config.get('username')
        self.password = config.get('password')
        self.agent_host = config.get('agent_host')
        self.agent_port = config.get('agent_port')

    def validate(self):
        if not self.endpoint and not self.agent_host:
            raise Exception('Jaeger Colector Endpoint or Agent host not set, must set one')
        if self.endpoint and self.agent_host:
            raise Exception('Jaeger Colector Endpoint and Agent host both set, only can set one')


class OtelExporter:
    def __init__(self, config: dict):
        if not config:
            self.enabled = False
            return
        self.enabled = True
        self.endpoint = config.get('endpoint')
        self.url_path = config.get('url_path')
        self.compression = config.get('compression') or False
        self.insecure = config.get('insecure') or False
        self.timeout = config.get('timeout') or '10'

    def validate(self):
        if not self.endpoint:

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Validate resp.ID immediately after SubmitScan returns and fail fast if empty
  2. Thread the ID explicitly through your polling/timeout code
  3. Confirm with the adapter's docs or a curl call that the submit response contains a string id field

Example fix

// before
rep, err := c.GetScanReport(id, mime, "") // id may be ""

// after
if id == "" {
    return "", errors.New("no scan request ID from SubmitScan response")
}
rep, err := c.GetScanReport(id, mime, "")
Defensive patterns

Strategy: validation

Validate before calling

resp, err := c.SubmitScan(req)
if err != nil {
    return nil, err
}
if resp == nil || resp.ID == "" {
    return nil, errors.New("adapter returned no scan request ID")
}

Try / catch

rep, err := c.GetScanReport(id, mime, params)
if err != nil && strings.Contains(err.Error(), "empty scan request ID") {
    return "", errors.New("lost the scan ID from SubmitScan; cannot poll")
}

Prevention

When it happens

Trigger: Passing "" as scanRequestID — e.g. the ID from the submit response was not propagated into the polling phase, or the adapter's submit response JSON lacked an id field so resp.ID stayed empty.

Common situations: Adapters that return 202 with an empty or misnamed id field; job code that loses the ID between the submit and poll steps; retry wrappers that re-create state from scratch without the ID.

Related errors


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/1a6a2c27d60ce943. Report an issue: GitHub.