{"record":{"id":"7f335e24f9e5c845","repo":"JuliusBrussee/caveman","slug":"objectstore-minio-client-w","errorCode":null,"errorMessage":"objectstore: minio client: %w","messagePattern":"objectstore: minio client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/objectstore/objectstore.go","lineNumber":221,"sourceCode":"\t\traw = \"https://\" + raw\n\t}\n\tu, err := url.Parse(raw)\n\tif err != nil || u.Scheme != \"https\" || u.Hostname() == \"\" || u.User != nil || u.RawQuery != \"\" || u.Fragment != \"\" || (u.Path != \"\" && u.Path != \"/\") {\n\t\treturn errors.New(\"objectstore: production endpoint must be an HTTPS origin without credentials, path, query, or fragment\")\n\t}\n\treturn nil\n}\n\n// New constructs a MinIO/S3-backed Store. FromEnv adds a live production probe.\nfunc New(cfg Config) (Store, error) {\n\tendpoint := strings.TrimPrefix(strings.TrimPrefix(cfg.Endpoint, \"https://\"), \"http://\")\n\tclient, err := minio.New(endpoint, &minio.Options{\n\t\tCreds:  credentials.NewStaticV4(cfg.AccessKey, cfg.SecretKey, \"\"),\n\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","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/objectstore/objectstore.go#L203-L239","documentation":"Error \"objectstore: minio client: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/objectstore/objectstore.go:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the minio client configuration and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}