{"record":{"id":"7ccdf9373b56fb35","repo":"weaviate/weaviate","slug":"write-w","errorCode":null,"errorMessage":"write : %w","messagePattern":"write : %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/backup-filesystem/backup.go","lineNumber":200,"sourceCode":"\tif err != nil {\n\t\treturn -1, err\n\t}\n\tsourcePath, err := m.getObjectPath(ctx, basePath, backupID, key)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"source path %s/%s: %w\", backupID, key, err)\n\t}\n\n\t// open file\n\tf, err := os.Open(sourcePath)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"open file %q: %w\", sourcePath, err)\n\t}\n\tdefer f.Close()\n\n\t// copy file\n\tread, err := io.Copy(w, f)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"write : %w\", err)\n\t}\n\n\tif metric, err := monitoring.GetMetrics().BackupRestoreDataTransferred.\n\t\tGetMetricWithLabelValues(m.Name(), \"class\"); err == nil {\n\t\tmetric.Add(float64(read))\n\t}\n\treturn read, err\n}\n\nfunc (m *Module) SourceDataPath() string {\n\treturn m.dataPath\n}\n\nfunc (m *Module) initBackupBackend(ctx context.Context, backupsPath string) error {\n\tif backupsPath == \"\" {\n\t\treturn fmt.Errorf(\"empty backup path provided\")\n\t}\n\tbackupsPath = filepath.Clean(backupsPath)","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/backup-filesystem/backup.go#L182-L218","documentation":"Read() streams the backup file into the io.WriteCloser w via io.Copy. This error (note the cosmetic double space in 'write :') wraps any failure while writing to the consumer side — i.e. the restore pipeline's writer (the node receiving the object data), not the local file. The reader side was fine; the destination rejected or failed the data.","triggerScenarios":"Read() where the receiving write end of the restore stream returns an error: destination shard write failure, broken pipe because the consuming node/connection died, or context cancellation causing the writer to fail mid-copy.","commonSituations":"Restore target node crashed or restarted mid-transfer; network interruption between nodes during distributed restore; destination disk full on the restoring node; gRPC stream deadline exceeded.","solutions":["Inspect the wrapped cause: 'broken pipe'/'connection reset' points to the consumer node or network — check the restoring node's logs and health.","Check disk space on the restoring node (destination, not the backup source).","Increase operation timeouts if the wrapped error is a deadline/context cancellation.","Retry the restore after stabilizing the destination node; the backup source file is unaffected."],"exampleFix":"// before\n# destination node runs out of disk during restore\n// after\n$ df -h /var/lib/weaviate   # on the RESTORING node\n# free space / expand PVC, then retry restore","handlingStrategy":"retry","validationCode":"// check destination node health and free space before restoring on the target\nresp, err := http.Get(destNode + \"/v1/nodes\")\nif err != nil || resp.StatusCode != 200 {\n    return fmt.Errorf(\"destination node unhealthy before restore\")\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"broken pipe\") || strings.Contains(err.Error(), \"connection reset\") {\n        // consumer dropped: wait for node recovery, then retry the restore\n        time.Sleep(30 * time.Second)\n        return retryRestore(backupID)\n    }\n    return err\n}","preventionTips":["Ensure ample free disk on the restoring node before starting restores.","Keep destination nodes healthy and stable during restore operations.","Set generous stream/deadline timeouts for large restores.","Retry idempotently: the source backup file is never modified by restore."],"tags":["io","streaming","restore","network","backup"],"backgroundTag":"broken-pipe","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}