{"record":{"id":"64d9e3092b060f63","repo":"benbjohnson/litestream","slug":"failed-to-put-object-s-w","errorCode":null,"errorMessage":"failed to put object %s: %w","messagePattern":"failed to put object (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nats/replica_client.go","lineNumber":419,"sourceCode":"\t// Extract timestamp from LTX header\n\thdr, _, err := ltx.PeekHeader(teeReader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"extract timestamp from LTX header: %w\", err)\n\t}\n\ttimestamp := time.UnixMilli(hdr.Timestamp).UTC()\n\n\t// Combine buffered data with rest of reader\n\trc := internal.NewReadCounter(io.MultiReader(&buf, r))\n\n\t// Store timestamp in NATS object headers for accurate timestamp retrieval\n\tobjectInfo, err := c.objectStore.Put(ctx, jetstream.ObjectMeta{\n\t\tName: objectPath,\n\t\tHeaders: map[string][]string{\n\t\t\tHeaderKeyTimestamp: {timestamp.Format(time.RFC3339Nano)},\n\t\t},\n\t}, rc)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to put object %s: %w\", objectPath, err)\n\t}\n\n\t// Record metrics\n\tinternal.OperationTotalCounterVec.WithLabelValues(ReplicaClientType, \"PUT\").Inc()\n\tinternal.OperationBytesCounterVec.WithLabelValues(ReplicaClientType, \"PUT\").Add(float64(objectInfo.Size))\n\n\treturn &ltx.FileInfo{\n\t\tLevel:     level,\n\t\tMinTXID:   minTXID,\n\t\tMaxTXID:   maxTXID,\n\t\tSize:      int64(objectInfo.Size),\n\t\tCreatedAt: timestamp,\n\t}, nil\n}\n\n// DeleteLTXFiles deletes one or more LTX files.\nfunc (c *ReplicaClient) DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error {\n\tif err := c.Init(ctx); err != nil {","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/nats/replica_client.go#L401-L437","documentation":"objectStore.Put failed while uploading an LTX file to the NATS object store. Causes include connection loss, authorization failure, JetStream resource limits (stream max bytes), or a name conflict with an existing object.","triggerScenarios":"Thrown at nats/replica_client.go:419 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check NATS server connectivity and credentials","Verify JetStream stream limits (max bytes/max objects) are not exhausted","Retry the sync; uploads are retried on subsequent cycles"],"exampleFix":null,"handlingStrategy":"retry","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"}