{"record":{"id":"9939e27f378bd591","repo":"netbirdio/netbird","slug":"read-signature-file-w","errorCode":null,"errorMessage":"read signature file: %w","messagePattern":"read signature file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/signer/artifactsign.go","lineNumber":182,"sourceCode":"\tif err != nil {\n\t\treturn fmt.Errorf(\"read public key file: %w\", err)\n\t}\n\n\tpublicKey, err := reposign.ParseArtifactPubKey(pubKeyPEM)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse artifact public key: %w\", err)\n\t}\n\n\t// Read artifact data\n\tartifactData, err := os.ReadFile(artifactFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read artifact file: %w\", err)\n\t}\n\n\t// Read signature\n\tsigBytes, err := os.ReadFile(signatureFile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read signature file: %w\", err)\n\t}\n\n\tsignature, err := reposign.ParseSignature(sigBytes)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse signature: %w\", err)\n\t}\n\n\t// Validate artifact\n\tif err := reposign.ValidateArtifact([]reposign.PublicKey{publicKey}, artifactData, *signature); err != nil {\n\t\treturn fmt.Errorf(\"artifact verification failed: %w\", err)\n\t}\n\n\tcmd.Println(\"✅ Artifact signature is valid\")\n\tcmd.Printf(\"Artifact: %s\\n\", artifactFile)\n\tcmd.Printf(\"Signed by key: %s\\n\", signature.KeyID)\n\tcmd.Printf(\"Signature timestamp: %s\\n\", signature.Timestamp.Format(\"2006-01-02 15:04:05 MST\"))\n\treturn nil\n}","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/signer/artifactsign.go#L164-L200","documentation":"os.ReadFile on the --signature-file path failed during verify-artifact. The expected file is the JSON signature bundle written by sign-artifact as <artifact>.sig next to the artifact. Missing file, permission denied, or a directory produces this error.","triggerScenarios":"The .sig was not downloaded/published alongside the artifact; wrong filename (e.g. .asc or .sig.txt); relative path resolved from wrong cwd.","commonSituations":"Release upload step skipped the .sig file; verifier points at a directory listing rather than the file; trailing whitespace in the flag value.","solutions":["ls the expected <artifact>.sig and pass its exact path","Regenerate the pair with sign-artifact if the .sig was lost, or re-download it from the release store","Check read permission on the .sig file"],"exampleFix":"// before\nreturn fmt.Errorf(\"read signature file: %w\", err)\n\n// after\nreturn fmt.Errorf(\"read signature file %s: %w\", signatureFile, err)","handlingStrategy":"validation","validationCode":"if _, err := os.Stat(signatureFile); err != nil {\n    log.Fatalf(\"signature %s not readable: %v\", signatureFile, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fetch the artifact and its .sig as an atomic pair","Fail downloads on non-200 so an error page is never saved as .sig"],"tags":["go","cli","filesystem","release-signing"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}