{"record":{"id":"1a6a2c27d60ce943","repo":"goharbor/harbor","slug":"jaeger-colector-endpoint-or-agent-host-not-set-mu","errorCode":null,"errorMessage":"Jaeger Colector Endpoint or Agent host not set, must set one","messagePattern":"Jaeger Colector Endpoint or Agent host not set, must set one","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"make/photon/prepare/models.py","lineNumber":153,"sourceCode":"        if not port_number_valid(self.port):\n            raise Exception('Port number in metrics is not valid')\n\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:","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/make/photon/prepare/models.py#L135-L171","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Validate resp.ID immediately after SubmitScan returns and fail fast if empty","Thread the ID explicitly through your polling/timeout code","Confirm with the adapter's docs or a curl call that the submit response contains a string id field"],"exampleFix":"// before\nrep, err := c.GetScanReport(id, mime, \"\") // id may be \"\"\n\n// after\nif id == \"\" {\n    return \"\", errors.New(\"no scan request ID from SubmitScan response\")\n}\nrep, err := c.GetScanReport(id, mime, \"\")","handlingStrategy":"validation","validationCode":"resp, err := c.SubmitScan(req)\nif err != nil {\n    return nil, err\n}\nif resp == nil || resp.ID == \"\" {\n    return nil, errors.New(\"adapter returned no scan request ID\")\n}","typeGuard":null,"tryCatchPattern":"rep, err := c.GetScanReport(id, mime, params)\nif err != nil && strings.Contains(err.Error(), \"empty scan request ID\") {\n    return \"\", errors.New(\"lost the scan ID from SubmitScan; cannot poll\")\n}","preventionTips":["Persist the submit response's ID before any polling loop starts","Validate ScanResponse.ID immediately after submission","Verify adapter submit responses contain a string id field during integration testing"],"tags":["go","harbor","scan","rest-client","validation"],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}