zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.46k stars 2.06k forks source link

Zed unable to open GUI failed to retrieve next drawable #12551

Open harshul-s opened 1 month ago

harshul-s commented 1 month ago

Check for existing issues

6412

Describe the bug / provide steps to reproduce it

Attempt to launch zed on M1 Pro Mac will open with a window icon

image

However trying to view the window shows an empty outline

image

Attempting to launch the binary outputs:

./Zed
2024-06-01 14:37:12.446 Zed[6874:29027] CAMetalLayer ignoring invalid setDrawableSize width=0.000000 height=0.000000
2024-06-01 14:37:12.458 Zed[6874:29027] [CAMetalLayer nextDrawable] returning nil because allocation failed.
[2024-06-01T14:37:12+08:00 ERROR gpui::platform::mac::metal_renderer] failed to retrieve next drawable, drawable size: Size { 0 px (device) × 0 px (device) }

A reinstall hasn't worked, I attempted to delete the .config/Zed directory and this was also unsuccessful.

If this provides any context I had a very old version of Zed I tried to use the updater to update which then started the fail to launch prompting me to reinstall.

Environment

unable to access the command palette to perform this action

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

Zed.log

harshul-s commented 1 month ago

I managed to stop the error from happening by removing: ~/Library/Application Support/Zed and reinstalling.

Craytor commented 1 month ago

I can confirm that @harshul-s's solution also fixed Zed on my Mac as well. I was having the same issue as OP.

deadbaed commented 3 weeks ago

I had this bug as well after updating to the latest version, and I was able to reproduce:

2024-06-08T18:43:08+02:00 [INFO] ========== starting zed ==========
2024-06-08T18:43:08+02:00 [INFO] Opening main db
2024-06-08T18:43:08+02:00 [INFO] Using git binary path: Some("/Applications/Zed.app/Contents/MacOS/git")
2024-06-08T18:43:08+02:00 [INFO] extensions updated. loading 1, reloading 0, unloading 0
2024-06-08T18:43:08+02:00 [INFO] Opening main db
2024-06-08T18:43:08+02:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-06-08T18:43:09+02:00 [ERROR] failed to retrieve next drawable, drawable size: Size { 0 px (device) × 0 px (device) }
2024-06-08T18:43:09+02:00 [INFO] building git repository, `.git` path in the worktree: ".git"
2024-06-08T18:43:09+02:00 [ERROR] failed to retrieve next drawable, drawable size: Size { 0 px (device) × 0 px (device) }
2024-06-08T18:43:09+02:00 [INFO] Opening main db
2024-06-08T18:43:09+02:00 [ERROR] crates/assistant/src/assistant_panel.rs:154: No such file or directory (os error 2)
2024-06-08T18:43:09+02:00 [ERROR] crates/assistant/src/assistant_panel.rs:1424: credentials not found
2024-06-08T18:43:09+02:00 [ERROR] crates/assistant/src/assistant_panel.rs:154: No such file or directory (os error 2)
2024-06-08T18:43:09+02:00 [ERROR] crates/assistant/src/assistant_panel.rs:1424: credentials not found
2024-06-08T18:43:09+02:00 [INFO] Node runtime install_if_needed
2024-06-08T18:43:09+02:00 [INFO] starting language server. binary path: "/Users/phil/Library/Application Support/Zed/node/node-v18.15.0-darwin-arm64/bin/node", working directory: "/", args: ["/Users/phil/Library/Application Support/Zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]

But after quitting and reopening Zed 4/5 times, the bug stopped occurring and windows started to render correctly. weird.

mpfaff commented 3 weeks ago

I found that the issue was tied to a specific workspace. Deleting ~/Library/Application Support/Zed/db was enough to fix the issue for me.

matsimitsu commented 3 weeks ago

Happened for me today as well, and got it working again by removing ~/Library/Application Support/Zed/db as suggested by @mpfaff

tkgalk commented 2 weeks ago

Exactly the same issue and the fix is the same. Removing db helps, not ideal, but at least it's a well-tested workaround.