{"record":{"id":"516f2f892db1beb6","repo":"JuliusBrussee/caveman","slug":"generate-probe-w","errorCode":null,"errorMessage":"generate probe: %w","messagePattern":"generate probe: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/objectstore/objectstore.go","lineNumber":235,"sourceCode":"\t\tSecure: cfg.UseSSL,\n\t\tRegion: cfg.Region,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"objectstore: minio client: %w\", err)\n\t}\n\treturn &minioStore{client: client, bucket: cfg.Bucket}, nil\n}\n\n// Probe proves the operations production retention needs instead of accepting a\n// syntactically valid but unusable bucket configuration. The random probe body\n// contains no tenant data and every version is removed before success returns.\nfunc Probe(ctx context.Context, store Store) error {\n\tif store == nil {\n\t\treturn errors.New(\"store is nil\")\n\t}\n\tprobe := make([]byte, 32)\n\tif _, err := rand.Read(probe); err != nil {\n\t\treturn fmt.Errorf(\"generate probe: %w\", err)\n\t}\n\tkey := \"_cave_health/\" + base64.RawURLEncoding.EncodeToString(probe)\n\tif err := store.Put(ctx, key, probe, \"application/octet-stream\"); err != nil {\n\t\treturn err\n\t}\n\tcleaned := false\n\tdefer func() {\n\t\tif !cleaned {\n\t\t\t// Keep health checks within their caller deadline. A failed probe may\n\t\t\t// leave one random, tenant-free canary for lifecycle cleanup; readiness\n\t\t\t// must never hang on an unbounded background delete.\n\t\t\t_ = PurgeObject(ctx, store, key)\n\t\t}\n\t}()\n\tgot, err := store.Get(ctx, key)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/shared/platform/objectstore/objectstore.go#L217-L253","documentation":"Probe wraps crypto/rand.Read failures with 'generate probe:'. Probe generates 32 random bytes to build a unique health-probe object key; the library throws this only when the OS cryptographic random source fails, which is essentially an environment-level failure.","triggerScenarios":"Calling objectstore.Probe (directly or via FromEnv production mode) on a system where crypto/rand cannot read from its entropy source — e.g. broken /dev/urandom in a container, seccomp blocking getrandom(2), or a heavily degraded host.","commonSituations":"Minimal/locked-down containers missing /dev/urandom or blocking the getrandom syscall; unusual sandboxed CI runners; kernel/fips configuration issues.","solutions":["Fix the environment so crypto/rand works: restore /dev/urandom access or allow the getrandom syscall in seccomp/apparmor profiles.","Retry the call — the failure is often transient at the OS level only in degraded states.","If it persists, replace the sandbox image with a standard base image; this is not fixable from application code."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := objectstore.Probe(ctx, store); err != nil && strings.Contains(err.Error(), \"generate probe\") {\n    // OS entropy failure: retry once, then fail the deployment\n    time.Sleep(100 * time.Millisecond)\n    err = objectstore.Probe(ctx, store)\n}","preventionTips":["Use standard container base images where /dev/urandom and getrandom work.","Review seccomp/apparmor profiles for blocked getrandom syscalls.","Treat repeated occurrences as a host-level incident, not an app bug."],"tags":["crypto","entropy","environment"],"backgroundTag":"unexpected-response-shape","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}