goharbor/harbor · error · Exception

Jaeger Colector Endpoint and Agent host both set, only can s

Error message

Jaeger Colector Endpoint and Agent host both set, only can set one

What it means

GetScanReport requires the mime type of the report to retrieve; it is baked into the report URL the client builds via spec.GetScanReport(scanRequestID, reportMIMEType). An empty reportMIMEType is rejected up front with 'missing report mime type' because the URL would be meaningless.

Source

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


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:
            raise Exception('Trace endpoint not set')
        if not self.url_path:

View on GitHub (pinned to 7b2fd08cc5)

Solutions

  1. Default the mime type to a known value (e.g. v1.MimeTypeGenericVulnerabilityReport) when the caller has none
  2. Derive the mime from the scanner registration's produces mime types, validated against the adapter's declared capabilities
  3. Reject the request at your API boundary when the mime parameter is missing

Example fix

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

// after
if mime == "" {
    mime = v1.MimeTypeGenericVulnerabilityReport
}
rep, err := c.GetScanReport(id, mime, "")
Defensive patterns

Strategy: validation

Validate before calling

if mime == "" {
    mime = v1.MimeTypeGenericVulnerabilityReport // or read from registration capabilities
}
return c.GetScanReport(id, mime, params)

Try / catch

rep, err := c.GetScanReport(id, mime, params)
if err != nil && strings.Contains(err.Error(), "missing report mime type") {
    return "", errors.New("no report mime type resolved for this scanner registration")
}

Prevention

When it happens

Trigger: Calling GetScanReport(id, "", urlParameter) — the mime type was sourced from a query parameter, a scanner registration record, or a capabilities list that turned out empty.

Common situations: Scanner registrations whose produces_mime_types list is empty; hand-built API integrations omitting the mime parameter; code ported from an older API that had a default mime.

Related errors


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