{"record":{"id":"1b9d09415a6cf5b2","repo":"hashicorp/nomad","slug":"invalid-publish-time-w","errorCode":null,"errorMessage":"invalid publish_time: %w","messagePattern":"invalid publish_time: %w","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"command/agent/keyring_endpoint.go","lineNumber":186,"sourceCode":"\n\targs := structs.KeyringRotateRootKeyRequest{}\n\ts.parseWriteRequest(req, &args.WriteRequest)\n\n\tquery := req.URL.Query()\n\tswitch query.Get(\"algo\") {\n\tcase string(structs.EncryptionAlgorithmAES256GCM):\n\t\targs.Algorithm = structs.EncryptionAlgorithmAES256GCM\n\t}\n\n\tif _, ok := query[\"full\"]; ok {\n\t\targs.Full = true\n\t}\n\n\tptRaw := query.Get(\"publish_time\")\n\tif ptRaw != \"\" {\n\t\tpublishTime, err := strconv.ParseInt(ptRaw, 10, 64)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid publish_time: %w\", err)\n\t\t}\n\t\targs.PublishTime = publishTime\n\t}\n\n\tvar out structs.KeyringRotateRootKeyResponse\n\tif err := s.agent.RPC(\"Keyring.Rotate\", &args, &out); err != nil {\n\t\treturn nil, err\n\t}\n\tsetIndex(resp, out.Index)\n\treturn out, nil\n}\n\nfunc (s *HTTPServer) keyringDeleteRequest(resp http.ResponseWriter, req *http.Request, keyID string, force bool) (any, error) {\n\n\targs := structs.KeyringDeleteRootKeyRequest{KeyID: keyID, Force: force}\n\ts.parseWriteRequest(req, &args.WriteRequest)\n\n\tvar out structs.KeyringDeleteRootKeyResponse","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/keyring_endpoint.go#L168-L204","documentation":"Fired by the keyring rotate root-key HTTP endpoint when the publish_time query parameter cannot be parsed as a 64-bit integer with strconv.ParseInt; the raw string is passed through with %w so the strconv error is preserved.","triggerScenarios":"Thrown at command/agent/keyring_endpoint.go:186 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send publish_time as a valid base-10 signed 64-bit integer (Unix timestamp) in the query string","Omit the publish_time parameter entirely if not needed","Check the client is not sending a float, empty string with units, or out-of-range value"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}