{"record":{"id":"ca8868dac79f8d58","repo":"fish2018/pansou","slug":"anubis-s","errorCode":null,"errorMessage":"不支持的 Anubis 验证算法: %s","messagePattern":"不支持的 Anubis 验证算法: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/miosou/miosou.go","lineNumber":268,"sourceCode":"\t\tID         string `json:\"id\"`\n\t\tRandomData string `json:\"randomData\"`\n\t} `json:\"challenge\"`\n}\n\nfunc parseAnubisChallenge(body []byte) (anubisChallengeDocument, bool, error) {\n\tmatch := anubisChallengePattern.FindSubmatch(body)\n\tif len(match) != 2 {\n\t\treturn anubisChallengeDocument{}, false, nil\n\t}\n\tvar challenge anubisChallengeDocument\n\tif err := json.Unmarshal([]byte(html.UnescapeString(string(match[1]))), &challenge); err != nil {\n\t\treturn anubisChallengeDocument{}, true, fmt.Errorf(\"解析 Anubis 验证题目失败: %w\", err)\n\t}\n\tif challenge.Challenge.ID == \"\" || challenge.Challenge.RandomData == \"\" || challenge.Rules.Difficulty < 1 || challenge.Rules.Difficulty > 7 {\n\t\treturn anubisChallengeDocument{}, true, fmt.Errorf(\"Anubis 验证题目无效\")\n\t}\n\tif challenge.Rules.Algorithm != \"fast\" && challenge.Rules.Algorithm != \"slow\" {\n\t\treturn anubisChallengeDocument{}, true, fmt.Errorf(\"不支持的 Anubis 验证算法: %s\", challenge.Rules.Algorithm)\n\t}\n\treturn challenge, true, nil\n}\n\nfunc solveAnubisChallenge(ctx context.Context, randomData string, difficulty int) (string, uint64, error) {\n\tprefix := []byte(randomData)\n\tbuffer := make([]byte, len(prefix), len(prefix)+20)\n\tcopy(buffer, prefix)\n\tfor nonce := uint64(0); ; nonce++ {\n\t\tif nonce&4095 == 0 {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn \"\", 0, fmt.Errorf(\"计算 Anubis 工作量证明失败: %w\", ctx.Err())\n\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t\tcandidate := strconv.AppendUint(buffer[:len(prefix)], nonce, 10)\n\t\thash := sha256.Sum256(candidate)","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/fish2018/pansou/blob/beaa56133755a548ebc51b090b3816e2ae044aa6/plugin/miosou/miosou.go#L250-L286","documentation":"Anubis challenges can use 'fast' or 'slow' hashing algorithms; this plugin implements only SHA-256 proof-of-work. If Rules.Algorithm is anything else, parseAnubisChallenge returns this error (miosou.go:268) because the solver cannot compute a valid proof.","triggerScenarios":"The gate page's challenge JSON carries an algorithm value other than \"fast\"/\"slow\" (e.g. a future Anubis release introducing a new algorithm like argon2 or cuckoo filter mode).","commonSituations":"The upstream Anubis project adds a new proof algorithm; a customized Anubis deployment configured with an unsupported algorithm; a typo'd/corrupt algorithm field from a mangled page.","solutions":["Upgrade the plugin (or Anubis on the server side) so both ends support the same algorithm set.","If you control the server, reconfigure Anubis to use the \"fast\" algorithm.","Extend solveAnubisChallenge to implement the new algorithm and relax the check in parseAnubisChallenge.","Pin the server to an Anubis version compatible with this client."],"exampleFix":"// before\nif challenge.Rules.Algorithm != \"fast\" && challenge.Rules.Algorithm != \"slow\" {\n    return anubisChallengeDocument{}, true, fmt.Errorf(\"不支持的 Anubis 验证算法: %s\", challenge.Rules.Algorithm)\n}\n// after\nif challenge.Rules.Algorithm != \"fast\" && challenge.Rules.Algorithm != \"slow\" {\n    return anubisChallengeDocument{}, true, fmt.Errorf(\"不支持的 Anubis 验证算法: %s (请升级客户端或服务端)\", challenge.Rules.Algorithm)\n}","handlingStrategy":"validation","validationCode":"var probe struct {\n    Rules struct {\n        Algorithm string `json:\"algorithm\"`\n    } `json:\"rules\"`\n}\nif err := json.Unmarshal([]byte(html.UnescapeString(blob)), &probe); err == nil {\n    if probe.Rules.Algorithm != \"fast\" && probe.Rules.Algorithm != \"slow\" {\n        return fmt.Errorf(\"unsupported Anubis algorithm: %s\", probe.Rules.Algorithm)\n    }\n}","typeGuard":"func supportedAlgorithm(algo string) bool {\n    return algo == \"fast\" || algo == \"slow\"\n}","tryCatchPattern":"challenge, found, err := parseAnubisChallenge(body)\nif err != nil {\n    if strings.Contains(err.Error(), \"不支持的 Anubis 验证算法\") {\n        // version mismatch: upgrade client or reconfigure server, don't blind-retry\n    }\n    return err\n}","preventionTips":["Pin the server's Anubis version to one compatible with this client","Reconfigure Anubis to the 'fast' algorithm if you control it","Fail fast instead of retrying on unsupported algorithms","Track upstream Anubis releases for new algorithms"],"tags":["anubis","unsupported-operation","proof-of-work","version-mismatch"],"backgroundTag":"unsupported-operation","analyzedSha":"beaa56133755a548ebc51b090b3816e2ae044aa6","analyzedAt":"2026-09-07T00:31:18.025Z","contentChangedAt":"2026-09-07T00:31:18.025Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}