{"record":{"id":"2aa98683064d1377","repo":"goharbor/harbor","slug":"jaeger-colector-endpoint-and-agent-host-both-set","errorCode":null,"errorMessage":"Jaeger Colector Endpoint and Agent host both set, only can set one","messagePattern":"Jaeger Colector Endpoint and Agent host both set, only can set one","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/models.py","lineNumber":155,"sourceCode":"\n\nclass JaegerExporter:\n    def __init__(self, config: dict):\n        if not config:\n            self.enabled = False\n            return\n        self.enabled = True\n        self.endpoint = config.get('endpoint')\n        self.username = config.get('username')\n        self.password = config.get('password')\n        self.agent_host = config.get('agent_host')\n        self.agent_port = config.get('agent_port')\n\n    def validate(self):\n        if not self.endpoint and not self.agent_host:\n            raise Exception('Jaeger Colector Endpoint or Agent host not set, must set one')\n        if self.endpoint and self.agent_host:\n            raise Exception('Jaeger Colector Endpoint and Agent host both set, only can set one')\n\n\nclass OtelExporter:\n    def __init__(self, config: dict):\n        if not config:\n            self.enabled = False\n            return\n        self.enabled = True\n        self.endpoint = config.get('endpoint')\n        self.url_path = config.get('url_path')\n        self.compression = config.get('compression') or False\n        self.insecure = config.get('insecure') or False\n        self.timeout = config.get('timeout') or '10'\n\n    def validate(self):\n        if not self.endpoint:\n            raise Exception('Trace endpoint not set')\n        if not self.url_path:","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/models.py#L137-L173","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Default the mime type to a known value (e.g. v1.MimeTypeGenericVulnerabilityReport) when the caller has none","Derive the mime from the scanner registration's produces mime types, validated against the adapter's declared capabilities","Reject the request at your API boundary when the mime parameter is missing"],"exampleFix":"// before\nrep, err := c.GetScanReport(id, mime, \"\") // mime may be \"\"\n\n// after\nif mime == \"\" {\n    mime = v1.MimeTypeGenericVulnerabilityReport\n}\nrep, err := c.GetScanReport(id, mime, \"\")","handlingStrategy":"validation","validationCode":"if mime == \"\" {\n    mime = v1.MimeTypeGenericVulnerabilityReport // or read from registration capabilities\n}\nreturn c.GetScanReport(id, mime, params)","typeGuard":null,"tryCatchPattern":"rep, err := c.GetScanReport(id, mime, params)\nif err != nil && strings.Contains(err.Error(), \"missing report mime type\") {\n    return \"\", errors.New(\"no report mime type resolved for this scanner registration\")\n}","preventionTips":["Derive the mime type from the registration's produces_mime_types, not from raw caller input","Default to the generic vulnerability report mime when nothing else is known","Validate the registration against adapter metadata at registration time"],"tags":["go","harbor","scan","rest-client","mime-type","validation"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}