sigoden/dufs · error · anyhow::Error

{err}

Error message

{err}

What it means

In handle_zip_dir the zip archive is produced on a spawned task and streamed to the client via ReaderStream. This map_err wraps any I/O error emitted while reading from the zip writer pipe (e.g. the spawned zip task failed or the reader broke) into an anyhow error so the response body stream can carry it; the underlying cause was already logged as `Failed to zip {path}`.

Solutions

  1. Check server logs for the accompanying `Failed to zip <path>` message to find the root cause
  2. Retry the download; if it recurs, verify the directory and its contents are readable and not being modified concurrently
  3. Avoid zipping extremely large directories that may exceed timeouts
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at src/server.rs:695 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sigoden/dufs@fe7fd564f8 (2026-09-09). Data as JSON: /api/errors/2b2bed5f6f981e90. Report an issue: GitHub.

Appendix: source

Thrown at src/server.rs:695

                &mut writer,
                &path,
                access_paths,
                &hidden,
                compression,
                follow_symlinks,
                serve_path,
                running,
            )
            .await
            {
                error!("Failed to zip {}, {e}", path.display());
            }
        });
        let reader_stream = ReaderStream::with_capacity(reader, BUF_SIZE);
        let stream_body = StreamBody::new(
            reader_stream
                .map_ok(Frame::data)
                .map_err(|err| anyhow!("{err}")),
        );
        let boxed_body = stream_body.boxed();
        *res.body_mut() = boxed_body;
        Ok(())
    }

    async fn handle_render_index(
        &self,
        path: &Path,
        query_params: &HashMap<String, String>,
        headers: &HeaderMap<HeaderValue>,
        head_only: bool,
        user: Option<String>,
        access_paths: AccessPaths,
        res: &mut Response,
    ) -> Result<()> {
        let index_path = path.join(INDEX_NAME);
        if fs::metadata(&index_path)

View on GitHub (pinned to fe7fd564f8)