{"record":{"id":"1bea126794e6125d","repo":"portainer/portainer","slug":"version-header-is-missing","errorCode":null,"errorMessage":"Version Header is missing","messagePattern":"Version Header is missing","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/agent/version.go","lineNumber":62,"sourceCode":"\t}\n\n\tresp, err := httpCli.Do(req)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\n\t_, _ = io.Copy(io.Discard, resp.Body)\n\tif err := resp.Body.Close(); err != nil {\n\t\tlog.Warn().Err(err).Msg(\"failed to close response body\")\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\treturn 0, \"\", fmt.Errorf(\"Failed request with status %d\", resp.StatusCode)\n\t}\n\n\tversion := resp.Header.Get(portainer.PortainerAgentHeader)\n\tif version == \"\" {\n\t\treturn 0, \"\", errors.New(\"Version Header is missing\")\n\t}\n\n\tagentPlatformHeader := resp.Header.Get(portainer.HTTPResponseAgentPlatform)\n\tif agentPlatformHeader == \"\" {\n\t\treturn 0, \"\", errors.New(\"Agent Platform Header is missing\")\n\t}\n\n\tagentPlatformNumber, err := strconv.Atoi(agentPlatformHeader)\n\tif err != nil {\n\t\treturn 0, \"\", err\n\t}\n\n\tif agentPlatformNumber == 0 {\n\t\treturn 0, \"\", errors.New(\"Agent platform is invalid\")\n\t}\n\n\treturn portainer.AgentPlatform(agentPlatformNumber), version, nil\n}","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/agent/version.go#L44-L80","documentation":"Error \"Version Header is missing\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/agent/version.go:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}