{"record":{"id":"575af4404f9b1f39","repo":"JuliusBrussee/caveman","slug":"objectstore-read-q-w","errorCode":null,"errorMessage":"objectstore: read %q: %w","messagePattern":"objectstore: read %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/objectstore/objectstore.go","lineNumber":298,"sourceCode":"\treturn nil\n}\n\nfunc (m *minioStore) Get(ctx context.Context, key string) ([]byte, error) {\n\tobj, err := m.client.GetObject(ctx, m.bucket, key, minio.GetObjectOptions{})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"objectstore: get %q: %w\", key, err)\n\t}\n\tdefer obj.Close()\n\tmaxBytes := int64(env.Int(\"CAVE_OBJECTSTORE_MAX_READ_BYTES\", 64<<20))\n\tif maxBytes <= 0 {\n\t\tmaxBytes = 64 << 20\n\t}\n\tbody, err := io.ReadAll(io.LimitReader(obj, maxBytes+1))\n\tif err != nil {\n\t\tif minio.ToErrorResponse(err).Code == \"NoSuchKey\" {\n\t\t\treturn nil, ErrNotFound\n\t\t}\n\t\treturn nil, fmt.Errorf(\"objectstore: read %q: %w\", key, err)\n\t}\n\tif int64(len(body)) > maxBytes {\n\t\treturn nil, ErrTooLarge\n\t}\n\treturn body, nil\n}\n\nfunc (m *minioStore) Delete(ctx context.Context, key string) error {\n\tif err := m.client.RemoveObject(ctx, m.bucket, key, minio.RemoveObjectOptions{}); err != nil {\n\t\treturn fmt.Errorf(\"objectstore: delete %q: %w\", key, err)\n\t}\n\treturn nil\n}\n\nfunc (m *minioStore) DeleteAllVersions(ctx context.Context, key string) error {\n\treturn m.deleteVersions(ctx, key, true)\n}\n","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/objectstore/objectstore.go#L280-L316","documentation":"Error \"objectstore: read %q: %w\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/objectstore/objectstore.go:298 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the object read error 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-15T22:17:37.221Z"}