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
50.3k stars 3.1k forks source link

[NixOS] Zed dosn't start #14443

Closed Shapur1234 closed 2 months ago

Shapur1234 commented 4 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I have installed the nixpkgs-unstable zed-editor package (version 0.141.3). When I run zed in the terminal, literally nothing happens. Zed doesn't launch, nothing is printed to stdout, it just exits. I couldn't find any logs.

Environment

I'm not sure what you want me to copypaste. I run nixos, X11 (i3 window manager), ASUS TUF Gaming A15 FA507XI (integrated GPU + 4070) vkcube is working

Edit

I found the log file (was looking for it in the macos location first)

2024-07-14T21:16:25+02:00 [INFO] ========== starting zed ==========
2024-07-14T21:16:26+02:00 [WARN] failed to load font 'SymbolsNFM'
2024-07-14T21:16:26+02:00 [WARN] failed to load font 'SymbolsNFM'
2024-07-14T21:16:26+02:00 [INFO] perform;
2024-07-14T21:16:26+02:00 [INFO] read_command;
2024-07-14T21:16:26+02:00 [INFO] read_command;
2024-07-14T21:16:26+02:00 [INFO] socket reader;
2024-07-14T21:16:26+02:00 [INFO] new;
2024-07-14T21:16:26+02:00 [INFO] Opening main db
2024-07-14T21:16:26+02:00 [INFO] Using git binary path: None
2024-07-14T21:16:26+02:00 [INFO] activate is not implemented on Linux, ignoring the call
2024-07-14T21:16:26+02:00 [INFO] Opening main db
2024-07-14T21:16:26+02:00 [INFO] perform;
2024-07-14T21:16:26+02:00 [INFO] read_command;
2024-07-14T21:16:26+02:00 [INFO] read_command;
2024-07-14T21:16:26+02:00 [INFO] socket reader;
2024-07-14T21:16:26+02:00 [ERROR] crates/client/src/client.rs:1657: DBus error service error org.freedesktop.zbus.Error: The name org.freedesktop.secrets was not provided by any .service files
2024-07-14T21:16:26+02:00 [INFO] set environment variables from shell:/run/current-system/sw/bin/fish, path:/run/wrappers/bin:/home/jirka/.nix-profile/bin:/nix/profile/bin:/home/jirka/.local/state/nix/profile/bin:/etc/profiles/per-user/jirka/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
2024-07-14T21:16:26+02:00 [ERROR] crates/zed/src/main.rs:973: Is a directory (os error 21)
2024-07-14T21:16:26+02:00 [INFO] rebuilt extension index in 1.288243ms
2024-07-14T21:16:29+02:00 [INFO] Node runtime install_if_needed
2024-07-14T21:16:48+02:00 [INFO] downloaded update. path:"/tmp/zed-auto-updatemtYGbO/zed-linux-x86_64.tar.gz"
2024-07-14T21:16:51+02:00 [INFO] starting language server. binary path: "/home/jirka/.local/share/zed/node/node-v18.15.0-linux-x64/bin/node", working directory: "/", args: ["/home/jirka/.local/share/zed/copilot/copilot-v0.5.0/dist/agent.js", "--stdio"]
2024-07-14T21:16:51+02:00 [INFO] Took 11.56µs to receive response to "initialize" id 0
2024-07-14T21:16:51+02:00 [ERROR] crates/lsp/src/lsp.rs:375: Broken pipe (os error 32)
2024-07-14T21:16:51+02:00 [ERROR] crates/lsp/src/lsp.rs:730: server shut down
2024-07-14T21:16:51+02:00 [ERROR] crates/lsp/src/lsp.rs:353: cannot read LSP message headers
flaviu-toader commented 4 months ago

I'm having a similar issue, using NixOS and sway (wayland), but only on my AMD-based laptop. On my nvidia-based one, everything works fine.

Also: zed shows up in my process list and hangs around there until I kill -15 it, but only when I launch from a terminal:

ps -ef | grep zed
fff      7890       1  0 19:59 ?        00:00:03 /nix/store/6xk0j54s5fcsf7ivxysy0nb58d6iw4ii-zed-0.141.3/libexec/zed-editor zed-cli:///tmp/.tmpz25WNo/socket

When I launch via desktop file (eg. using a launcher like fuzzel or rofi): there is no zed.log, no process running, nothing shown.

jansol commented 4 months ago

Just for funsies, can you try launching it with LD_DEBUG=libs and see if that contains any "fatal" errors? Also this is likely a nixpkgs-specific thing so should probably be reported there.

Shapur1234 commented 4 months ago
      8759: find library=libgcc_s.so.1 [0]; searching
      8759:  search path=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v4:/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v3:/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v2:/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib       (system search path)
      8759:   trying file=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v4/libgcc_s.so.1
      8759:   trying file=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v3/libgcc_s.so.1
      8759:   trying file=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/glibc-hwcaps/x86-64-v2/libgcc_s.so.1
      8759:   trying file=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libgcc_s.so.1
      8759:  search path=/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v4:/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v3:/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v2:/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib       (RUNPATH from file zed)
      8759:   trying file=/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v4/libgcc_s.so.1
      8759:   trying file=/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v3/libgcc_s.so.1
      8759:   trying file=/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/glibc-hwcaps/x86-64-v2/libgcc_s.so.1
      8759:   trying file=/nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/libgcc_s.so.1
      8759: 
      8759: find library=libc.so.6 [0]; searching
      8759:  search path=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib      (system search path)
      8759:   trying file=/nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6
      8759: 
      8759: 
      8759: calling init: /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/ld-linux-x86-64.so.2
      8759: 
      8759: 
      8759: calling init: /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6
      8759: 
      8759: 
      8759: calling init: /nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/libgcc_s.so.1
      8759: 
      8759: 
      8759: initialize program: zed
      8759: 
      8759: 
      8759: transferring control: zed
      8759: 
      8759: 
      8759: calling fini:  [0]
      8759: 
      8759: 
      8759: calling fini: /nix/store/c6r62m84hywf4i6qq1h28f13zv38yqyp-gcc-13.3.0-lib/lib/libgcc_s.so.1 [0]
      8759: 
      8759: 
      8759: calling fini: /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/libc.so.6 [0]
      8759: 
      8759: 
      8759: calling fini: /nix/store/m71p7f0nymb19yn1dascklyya2i96jfw-glibc-2.39-52/lib/ld-linux-x86-64.so.2 [0]
      8759: 
jansol commented 4 months ago

That looks like it's just from the CLI helper, not the main zed-editor binary?

aohan237 commented 4 months ago

manjaro kde6 with wayland don start ,either.

just a start icon, then everything disappear

kualta commented 4 months ago

same exact issue as the op, nixos + gnome (wayland)

dasanibroto commented 4 months ago

I was having the same issue with zed on nix + hyprland, until I randomly opened a file with zed from thunar file manager. From then since, zed has opened immediately.

jansol commented 4 months ago

Regarding this line:

crates/client/src/client.rs:1657: DBus error service error org.freedesktop.zbus.Error: The name org.freedesktop.secrets was not provided by any .service files

Do you happen to have programs.dconf.enable = true;? I'm using Plasma6 but I have dconf enabled since not having it would break some GNOME-oriented applications. And recently I saw someone say that KDE does not implement the secrets dbus api...

XaydBayeck commented 4 months ago

I met the same thing.

But I see the server is starting in directory '/'. So, I try to give a path to zed. And it works.

~
❯ zed Github/zedwks/

When I reopen zed, it starts up with the same directory.

Shapur1234 commented 4 months ago

I met the same thing.

But I see the server is starting in directory '/'. So, I try to give a path to zed. And it works.

~
❯ zed Github/zedwks/

When I reopen zed, it starts up with the same directory.

This "fixed" the issue for me, interesting

jansol commented 4 months ago

But I see the server is starting in directory '/'. So, I try to give a path to zed. And it works.

Is this when you try launching it from the .desktop launcher? That definitely definitely sounds like a scenario that zed should handle better then.

thomas725 commented 3 months ago

@XaydBayeck & @Shapur1234 Can you please describe your workaround a bit clearer? I'm on Manjaro KDE Plasam6 Wayland and can't get Zed to show up.

Trying to force wayland usage results in panic:

$ WAYLAND_DISPLAY=1 zeditor --new --foreground
thread 'main' panicked at crates/gpui/src/platform/linux/wayland/client.rs:391:49:
called `Result::unwrap()` on an `Err` value: NoCompositor
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Starting it without setting WAYLAND_DISPLAY just hangs forever without displaying any window. It only prints the probably unrelated error:

[2024-08-05T23:23:42+02:00 ERROR fs] No such file or directory (os error 2) about ["/home/user/.config/github-copilot"]

If I add a path argument I get a second line:

error opening [PathWithPosition { path: "/path/I/specified", row: None, column: None }]: NoSupportedDeviceFound

Setting LD_DEBUG=libs prints:

/usr/lib/zed/zed-editor: error: symbol lookup error: undefined symbol: __unw_add_dynamic_fde (fatal)

Shapur1234 commented 3 months ago

My workaround is zed ./ (Don't just open zed, but open some directory in zed.) But I don't think you are havong the same issue as me. :(

jansol commented 3 months ago

Trying to force wayland usage results in panic:

WAYLAND_DISPLAY=1 is almost certainly wrong, which explains why it errors out with "No Compositor". On my Ubuntu system WAYLAND_DISPLAY is set to wayland-0. Check env | grep WAYLAND to see what it really is. (although if it's set in your environment there obviously is no point in setting it again just for zed)

You probably meant to force zed to run WITHOUT wayland,which is achieved by UNsetting that variable: WAYLAND_DISPLAY= (just an empty space between the = and the next part of the command)

thomas725 commented 3 months ago

thanks for explaining about that WAYLAND_DISPLAY variable. You were right and unsetting it does make zed show up! Though using wayland support would be nice too, but one step at a time I guess.

notpeter commented 2 months ago

@Shapur1234 Going through old issues -- sounds like you found a workaround (running zed ./ instead of zed). Curious whether it's still failing to launch if you just run zed?

It sounded like there might be an issue which is "fixed" after opening a directory as a workspace once. If this is the case, I wonder whether the issue reappears if you remove your zed workspace db from ~/.local/share/zed/db/0-stable and restart with zed?

kualta commented 2 months ago

@notpeter yes the issue for me was fixed by opening zed with a directory argument once as well.

removing the workspace db does not make the issue reappear, zed is still opening for me (without arguments) even after that.

notpeter commented 2 months ago

That's great to hear! Likely there was something serialized from an old version of Zed in the workspace DB which caused the new version to choke. Thanks for following up!

phonkd commented 2 months ago

I was having the same issue with zed on nix + hyprland, until I randomly opened a file with zed from thunar file manager. From then since, zed has opened immediately.

No way this worked for me lmao