{"record":{"id":"548201e1ac3b515d","repo":"benbjohnson/litestream","slug":"s3-bucket-name-is-required","errorCode":null,"errorMessage":"s3: bucket name is required","messagePattern":"s3: bucket name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"s3/replica_client.go","lineNumber":362,"sourceCode":"}\n\n// Type returns \"s3\" as the client type.\nfunc (c *ReplicaClient) Type() string {\n\treturn ReplicaClientType\n}\n\n// Init initializes the connection to S3. No-op if already initialized.\nfunc (c *ReplicaClient) Init(ctx context.Context) (err error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\n\tif c.s3 != nil {\n\t\treturn nil\n\t}\n\n\t// Validate required configuration\n\tif c.Bucket == \"\" {\n\t\treturn fmt.Errorf(\"s3: bucket name is required\")\n\t}\n\n\t// Validate SSE configuration\n\tif err := c.validateSSEConfig(); err != nil {\n\t\treturn err\n\t}\n\n\t// Look up region if not specified and no endpoint is used.\n\t// Endpoints are typically used for non-S3 object stores and do not\n\t// necessarily require a region.\n\tregion := c.Region\n\tif region == \"\" {\n\t\tif c.Endpoint == \"\" {\n\t\t\tif region, err = c.findBucketRegion(ctx, c.Bucket); err != nil {\n\t\t\t\treturn fmt.Errorf(\"s3: cannot lookup bucket region: %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tregion = DefaultRegion // default for non-S3 object stores","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/s3/replica_client.go#L344-L380","documentation":"Configuration validation in the S3 replica client's Init: the client was initialized without a Bucket set. Fires on first use of a client built programmatically (not via URL/config parsing) when the Bucket field was never assigned, making any S3 operation impossible.","triggerScenarios":"Thrown at s3/replica_client.go:362 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the bucket in the replica config or URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}