gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Cannot get out of the error page

Open shunichironomura opened this issue 1 month ago • 5 comments

Version

0.17.3

Operating System

macOS

Distribution Method

dmg (Mac OS - Apple Silicon)

Describe the issue

My GitButler application is stuck in the following state: Image

Doing eigher of the following did not bring me to another page:

  • Clicking "Go back" button
  • Relaunching the GitButler application

How to reproduce (Optional)

I think this is what I did:

  1. Open a local Git repository in GitButler (Project A)
  2. (Work on various projects inside GitButler)
  3. Remove Project B, which is different from Project A

After removing Project B, the GitButler app is stuck in the above screenshot.

I cannot test whether this procedure reproduces the same result, as the GitButler app is stuck.

I'm not entirely sure that I'm getting this error because of Project A, either.

Expected behavior (Optional)

"Go back" takes me to another project.

Relevant log output (Optional)


shunichironomura avatar Nov 02 '25 12:11 shunichironomura

Thanks a lot for reporting!

I think what would be very helpful is a video of the problem. When trying it myself, with just a single project that I removed, it runs into the same problem (it's either regressing regularly or wasn't fixed), but it's able to recover when pressing the button.

https://github.com/user-attachments/assets/556bc33d-92aa-468f-877e-2e3bdb27fe84

Thanks again!

Byron avatar Nov 03 '25 08:11 Byron

Since my GitButler app is stuck, unfortunately the only video I can provide is this, where pressing the "Go back" takes no effect:

https://github.com/user-attachments/assets/73327e88-fe5f-4957-b365-6b31e03c2df5

shunichironomura avatar Nov 04 '25 01:11 shunichironomura

Thanks a lot! It really is a pity :/.

Can you enter the development tools from the menu bar? There it should show more in the console.

Additionally, it can be launched from the terminal with /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri to see the logs.

Meanwhile, to unblock this, you can move or delete "~/Library/Application Support/com.gitbutler.app/projects.json" to start without a project, and rm -Rf ~/Library/Caches/com.gitbutler.app will remove all frontend state.

Byron avatar Nov 04 '25 04:11 Byron

Thank you for the workaround! Moving the projects.json and removing the cache worked.

I share the logs I collected before I applied the workaround.

Developer tools

Here is the console output in the development tools when I click the "Go back" button:

[Error] ipc->get_project: {"projectId":"29d45d3d-57b9-49e7-8059-09affba231b5"} – {code: "errors.unknown", message: "No such file or directory (os error 2)"}
	(anonymous function) (DADnsXpz.js:12:3182)
	(anonymous function) (2w1MmaGb.js:3:4255)
[Error] ipc->get_base_branch_data: {"projectId":"29d45d3d-57b9-49e7-8059-09affba231b5"} – {code: "errors.unknown", message: "No such file or directory (os error 2)"}
	(anonymous function) (DADnsXpz.js:12:3182)
	(anonymous function) (2w1MmaGb.js:3:4255)
[Error] ipc->operating_mode: {"projectId":"29d45d3d-57b9-49e7-8059-09affba231b5"} – {code: "errors.unknown", message: "No such file or directory (os error 2)"}
	(anonymous function) (DADnsXpz.js:12:3182)
	(anonymous function) (2w1MmaGb.js:3:4255)
[Error] ipc->changes_in_worktree: {"projectId":"29d45d3d-57b9-49e7-8059-09affba231b5"} – {code: "errors.unknown", message: "No such file or directory (os error 2)"}
	(anonymous function) (DADnsXpz.js:12:3182)
	(anonymous function) (2w1MmaGb.js:3:4255)

Screenshot:

Image

Launched from the terminal

Logs after the launch

❯ /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri
2025-11-05T01:31:24.132868Z  INFO crates/gitbutler-tauri/src/main.rs:410: TERM is set - assuming the app is run from a terminal with suitable environment variables
2025-11-05T01:31:24.132901Z  INFO crates/gitbutler-tauri/src/main.rs:95: system git executable for fetch/push: "git"
2025-11-05T01:31:24.132905Z  INFO crates/gitbutler-tauri/src/main.rs:102: SHELL env: Some("/bin/zsh")
2025-11-05T01:31:24.133037Z  INFO crates/gitbutler-tauri/src/main.rs:129: starting app version=0.17.4 name=GitButler
2025-11-05T01:31:24.406339Z  INFO get_app_settings: crates/but-api/src/commands/settings.rs:16: close time.busy=88.2µs time.idle=42.8µs
2025-11-05T01:31:24.406359Z  INFO get_app_settings: crates/but-api/src/commands/settings.rs:16: close time.busy=59.5µs time.idle=27.3µs
2025-11-05T01:31:24.407104Z  INFO get_app_settings: crates/but-api/src/commands/settings.rs:16: close time.busy=65.6µs time.idle=12.2µs
2025-11-05T01:31:24.418198Z  INFO list_projects: crates/gitbutler-tauri/src/projects.rs:18: close time.busy=794µs time.idle=21.0µs
2025-11-05T01:31:24.441432Z ERROR get_base_branch_data: crates/but-api/src/commands/virtual_branches.rs:190: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.441452Z  INFO get_base_branch_data: crates/but-api/src/commands/virtual_branches.rs:190: close time.busy=188µs time.idle=10.0µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.441685Z  INFO secret_get_global: crates/but-api/src/commands/secret.rs:11: close time.busy=48.0µs time.idle=13.3µs handle="git-lab-token:29d45d3d-57b9-49e7-8059-09affba231b5"
2025-11-05T01:31:24.441881Z  INFO list_known_github_accounts: crates/gitbutler-tauri/src/github.rs:50: close time.busy=1.16ms time.idle=13.2µs
2025-11-05T01:31:24.442648Z ERROR operating_mode: crates/but-api/src/commands/modes.rs:17: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.442657Z  INFO operating_mode: crates/but-api/src/commands/modes.rs:17: close time.busy=94.5µs time.idle=5.25µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.444019Z ERROR get_project: crates/but-api/src/commands/projects.rs:27: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:31:24.444029Z  INFO get_app_settings: crates/but-api/src/commands/settings.rs:16: close time.busy=54.3µs time.idle=7.08µs
2025-11-05T01:31:24.444036Z  INFO get_project: crates/but-api/src/commands/projects.rs:27: close time.busy=158µs time.idle=8.08µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:31:24.444872Z ERROR changes_in_worktree: crates/but-api/src/commands/diff.rs:116: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.444885Z  INFO changes_in_worktree: crates/but-api/src/commands/diff.rs:116: close time.busy=99.2µs time.idle=7.79µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.446552Z  WARN set_project_active: crates/gitbutler-tauri/src/projects.rs:64: Project with ID 29d45d3d-57b9-49e7-8059-09affba231b5 not found, cannot set it active id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.446561Z  INFO set_project_active: crates/gitbutler-tauri/src/projects.rs:54: return=None id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.446566Z  INFO set_project_active: crates/gitbutler-tauri/src/projects.rs:54: close time.busy=102µs time.idle=5.58µs id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:31:24.470945Z ERROR get_project: crates/but-api/src/commands/projects.rs:27: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:31:24.470963Z  INFO get_project: crates/but-api/src/commands/projects.rs:27: close time.busy=151µs time.idle=11.8µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:31:24.498182Z  INFO get_user: crates/but-api/src/commands/users.rs:63: close time.busy=23.3ms time.idle=50.0µs
2025-11-05T01:31:24.502494Z  INFO update_telemetry_distinct_id: crates/gitbutler-tauri/src/settings.rs:37: close time.busy=76.9µs time.idle=8.62µs app_distinct_id=Some("user_13064")
2025-11-05T01:31:24.512745Z  INFO secret_set_global: crates/but-api/src/commands/secret.rs:19: close time.busy=10.9ms time.idle=16.8µs handle="TokenMemoryService-authToken" secret="<redacted>"
2025-11-05T01:31:24.915053Z  INFO get_gh_user:HTTP request: /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/reqwest-tracing-0.5.8/src/reqwest_otel_span_builder.rs:152: close time.busy=1.89ms time.idle=306ms account=OAuthUsername { username: "shunichironomura" } http.request.method=GET url.scheme=https server.address=api.github.com server.port=443 user_agent.original=gb-github-integration otel.kind="client" otel.name=GET http.response.status_code=200 http.response.status_code=200
2025-11-05T01:31:24.915290Z  INFO get_gh_user: crates/gitbutler-tauri/src/github.rs:42: close time.busy=138ms time.idle=306ms account=OAuthUsername { username: "shunichironomura" }

Logs after clicking the "Go back" button

2025-11-05T01:33:21.575824Z ERROR get_project: crates/but-api/src/commands/projects.rs:27: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:33:21.575855Z  INFO get_project: crates/but-api/src/commands/projects.rs:27: close time.busy=302µs time.idle=24.9µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5 no_validation=None
2025-11-05T01:33:21.576889Z ERROR get_base_branch_data: crates/but-api/src/commands/virtual_branches.rs:190: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.576912Z  INFO get_base_branch_data: crates/but-api/src/commands/virtual_branches.rs:190: close time.busy=231µs time.idle=17.8µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.578767Z ERROR operating_mode: crates/but-api/src/commands/modes.rs:17: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.578789Z  INFO operating_mode: crates/but-api/src/commands/modes.rs:17: close time.busy=149µs time.idle=14.2µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.581307Z  INFO secret_get_global: crates/but-api/src/commands/secret.rs:11: close time.busy=3.99ms time.idle=14.8µs handle="git-lab-token:29d45d3d-57b9-49e7-8059-09affba231b5"
2025-11-05T01:33:21.583380Z  INFO get_user: crates/but-api/src/commands/users.rs:63: close time.busy=2.83ms time.idle=17.4µs
2025-11-05T01:33:21.583839Z  INFO get_app_settings: crates/but-api/src/commands/settings.rs:16: close time.busy=133µs time.idle=18.9µs
2025-11-05T01:33:21.585165Z ERROR changes_in_worktree: crates/but-api/src/commands/diff.rs:116: error=Error(BUG: worktree is supposed to be valid here for migration

Caused by:
    0: "/Users/nomura/tmp/branching-branches" does not appear to be a git repository
    1: Could not retrieve metadata of "/Users/nomura/tmp/branching-branches"
    2: No such file or directory (os error 2)) project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.585180Z  INFO changes_in_worktree: crates/but-api/src/commands/diff.rs:116: close time.busy=156µs time.idle=9.38µs project_id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.586391Z  WARN set_project_active: crates/gitbutler-tauri/src/projects.rs:64: Project with ID 29d45d3d-57b9-49e7-8059-09affba231b5 not found, cannot set it active id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.586411Z  INFO set_project_active: crates/gitbutler-tauri/src/projects.rs:54: return=None id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.586422Z  INFO set_project_active: crates/gitbutler-tauri/src/projects.rs:54: close time.busy=184µs time.idle=14.5µs id=29d45d3d-57b9-49e7-8059-09affba231b5
2025-11-05T01:33:21.596037Z  INFO update_telemetry_distinct_id: crates/gitbutler-tauri/src/settings.rs:37: close time.busy=77.2µs time.idle=10.4µs app_distinct_id=Some("user_13064")
2025-11-05T01:33:21.608356Z  INFO secret_set_global: crates/but-api/src/commands/secret.rs:19: close time.busy=12.5ms time.idle=28.5µs handle="TokenMemoryService-authToken" secret="<redacted>"

shunichironomura avatar Nov 05 '25 01:11 shunichironomura

Thanks so much for the logs, it's much appreciated. I am also glad that you are back on track now.

Now is probably a good time to call @estib-vega for help, it's new that the application can't recover, and I didn't manage to reproduce this either.

Byron avatar Nov 05 '25 04:11 Byron