Skip to content

GitUI was close due to an unexpected panic (file: "src/watcher.rs") #2900

Open

Description

@Zeor-Xain

Using gitui --watcher causes "GitUI was closed due to an unexpected panic" when a directory belongs to another user.
This happens exclusively when a directory has a different owner. The error does NOT occur with files owned by another user.

Steps to reproduce:

  1. mkdir projectX && cd projectX
  2. Create a directory with a different owner using one of these options:
  • Option A:
    sudo install -m 700 -o 65654 -g 65654 -d mydir
  • Option B (the real-world case):
    podman run --rm -v "$(pwd):/workdir" alpine:latest /bin/sh -c 'mkdir /workdir/test && chown 1000:1000 /workdir/test && chmod 700 /workdir/test'
  1. Start gitui with the watcher and logs: RUST_BACKTRACE=1 RUST_LOG=debug gitui --watcher 2>/tmp/gitui.log

Expected behavior

GitUI should open normally.

Logs

❯ cat -pp /tmp/gitui.log 

GitUI was closed due to an unexpected panic.
Please file an issue on https://github.com/gitui-org/gitui/issues with the following info:

panicked at src/watcher.rs:79:10:
Watch error: Error { kind: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" }), paths: ["/home/user/gitui-test/mydir"] }

trace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>

Error: receiving on an empty and disconnected channel

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>

Context:

  • OS/Distro + Version: Ubuntu 24.04 LTS
  • GitUI Version: gitui 0.28.1

Additional context

Activity

  1. tk1475 commented on Sep 25, 2026

    @tk1475

    The panic comes from src/watcher.rs L76-79 on master, where the recursive watch() call is wrapped in .expect("Watch error"). When notify hits a subdirectory it can't read, it returns PermissionDenied and gitui aborts. #1688 reported the same thing in 2023 and was closed after it couldn't be reproduced from source, but the expect is still there. The watcher is only used with --watcher, and by default gitui uses the 5s tick updater (Updater::Ticker in main.rs). So running without --watcher is a workaround for now. A fix could log the watch error and fall back to the tick updater instead of panicking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions