Viewer trial file listing returns 500 when a trial contains a dangling symlink

Open Beginner friendly
#4,429 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lx6800 is already working on this.

Since Nov 25, 2026.

  • #4478 by @lx6800 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api, backend

Research direction

Open src/harbor/viewer/server.py and read both directory-scanning paths, first around line 2565 and then around line 2735, noting where the stat call follows a symlink. Reproduce by placing a dangling symlink in a trial directory and requesting the files endpoint, then find every caller of the size field to decide whether to zero it or skip the entry entirely. Check the related #3296 for a shared approach, and run the viewer server tests once the listing returns 200 with the dead link present.

Written by the indexing model from the issue text.

Description

GET /api/jobs/{job}/trials/{trial}/files returns a 500 when a trial directory contains a symlink whose target doesn't exist on the host. The Verifier tab requests this listing, so it never finishes loading. Other tabs that depend on the listing are affected the same way.

Every Claude Code trial hits this. The adapter sets CLAUDE_CONFIG_DIR to /logs/agent/sessions, and Claude Code keeps a debug-log pointer there as an absolute symlink.

The stat call here follows the symlink and throws a FileNotFoundError which we don't catch. There's another scan_dir implementation here that looks susceptible too.

I haven't traced where this size information is used yet to tell if it would be fine to just zero these out or if the file should be skipped altogether. #3296 seems related in another part of the code. A shared approach could probably benefit both.

Happy to PR a proposed fix if you'd like. Loving the tool so far.

Dominant language
Python
Stars
5.6k
Forks
1.9k
Avg merge
1d 17h
Merged PRs (30d)
156

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from harbor-framework/harbor

All issues in harbor-framework/harbor

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.