Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux install script fails with "unexpected end of file" error #14179

Closed
1 task done
krishnaraj opened this issue Jul 11, 2024 · 16 comments
Closed
1 task done

Linux install script fails with "unexpected end of file" error #14179

krishnaraj opened this issue Jul 11, 2024 · 16 comments
Labels
bug [core label] installer / updater Feedback for installation and update process linux

Comments

@krishnaraj
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Running the install script on Pop!_OS 22.04 fails with the below error

image

Environment

Pop!_OS 22.04

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
@krishnaraj krishnaraj added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Jul 11, 2024
@GlacierFox
Copy link

GlacierFox commented Jul 11, 2024

I'm getting something similar, although it actually seemed to (partially?) install for me. Every time I open a new terminal in Zed I get this:

image

(RHEL 9.4, KDE)

@r0kym
Copy link

r0kym commented Jul 11, 2024

Same issue here. A manual installation worked without issues

@JosephTLyons JosephTLyons added installer / updater Feedback for installation and update process linux and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 11, 2024
@steve-reilly24
Copy link

unable to reproduce on Fedora 40

@dmytrogajewski
Copy link

Have same issue bash: _module_raw: line 1: syntax error: unexpected end of file bash: error importing function definition for `_module_raw' bash: module: line 2: syntax error: unexpected end of file bash: error importing function definition for `module' /usr/bin/sh: module: line 2: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `module' /usr/bin/sh: _module_raw: line 1: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `_module_raw' /usr/bin/sh: module: line 2: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `module' /usr/bin/sh: _module_raw: line 1: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `_module_raw' /usr/bin/sh: module: line 2: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `module' /usr/bin/sh: _module_raw: line 1: syntax error: unexpected end of file /usr/bin/sh: error importing function definition for `_module_raw' bash: module: line 2: syntax error: unexpected end of file bash: error importing function definition for `module' bash: _module_raw: line 1: syntax error: unexpected end of file bash: error importing function definition for `_module_raw' bash: module: line 2: syntax error: unexpected end of file bash: error importing function definition for `module' bash: _module_raw: line 1: syntax error: unexpected end of file bash: error importing function definition for `_module_raw' bash: module: line 2: syntax error: unexpected end of file bash: error importing function definition for `module' bash: _module_raw: line 1: syntax error: unexpected end of file bash: error importing function definition for `_module_raw' bash: module: line 2: syntax error: unexpected end of file

@GlacierFox
Copy link

@dmytrogajewski Which distro are you using?

@dmytrogajewski
Copy link

@GlacierFox Fedora 40

@emakei
Copy link

emakei commented Sep 5, 2024

изображение
Rocky Linux 9

@emakei
Copy link

emakei commented Sep 5, 2024

изображение
Rocky Linux 9
Zed 0.151.1

@Jeff-SearchPilot
Copy link

I've think this is related to zed updating itself...

  • install zed using the install script
    • all ok, no errors when launching a terminal
  • let zed update itself
    • errors in the terminal
  • rerun install script and relaunch zed
    • all ok again

Also running Fedora 40, with zsh

@notpeter
Copy link
Member

@krishnaraj Can you see if you're still having this issue? We've made a number of improvements to script/linux around error handling and specific distribution support. If you run into trouble comment below and I'm happy to reopen.

For everyone else who is seeing errors in terminal when auto-updating on Linux, could you file a new issue rather than hijacking this one? The similarity of error ("unexpected end of file") makes them falsely similar when they are not. OP likely had an interrupted download of the release tarball while running the install script, while the issue y'all are seeing is likely caused by bash trying to read a file-offset from a file that has changed underneath while it was running the script.

@Jeff-SearchPilot
Copy link

I have opened #18614 for the issues related to updating zed. Anyone affected give it a 👍 for visibility

@krishnaraj
Copy link
Author

krishnaraj commented Oct 4, 2024

@krishnaraj Can you see if you're still having this issue? We've made a number of improvements to script/linux around error handling and specific distribution support. If you run into trouble comment below and I'm happy to reopen.

For everyone else who is seeing errors in terminal when auto-updating on Linux, could you file a new issue rather than hijacking this one? The similarity of error ("unexpected end of file") makes them falsely similar when they are not. OP likely had an interrupted download of the release tarball while running the install script, while the issue y'all are seeing is likely caused by bash trying to read a file-offset from a file that has changed underneath while it was running the script.

@notpeter Still facing this issue. I manually installed and have no issues with the updates though.

Extracting https://github.com/zed-industries/zed/releases/download/v0.155.2/zed-linux-x86_64.tar.gz using tar fails but works with 7z

tar version
tar (GNU tar) 1.34

@krishnaraj
Copy link
Author

krishnaraj commented Oct 4, 2024

It works if I change

curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" > "$temp/zed-linux-$arch.tar.gz"

to

curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" --output "$temp/zed-linux-$arch.tar.gz" in the install script

@notpeter
Copy link
Member

notpeter commented Oct 4, 2024

Extracting https://github.com/zed-industries/zed/releases/download/v0.155.2/zed-linux-x86_64.tar.gz using tar fails but works with 7z

That is extremely odd. Can you include a screenshot showing the error message you get where the script fails to extract with tar -xzf:

zed/script/install.sh

Lines 111 to 112 in beda1a9

tar -xzf "$temp/zed-linux-$arch.tar.gz" -C "$HOME/.local/"

I wonder if your output is being truncated. This script has a set -e at the top so I would assume curl/wget would cause the script to abort in this case and tar would never run.

It works if I change

curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" > "$temp/zed-linux-$arch.tar.gz" to curl "https://zed.dev/api/releases/$channel/latest/zed-linux-$arch.tar.gz" --output "$temp/zed-linux-$arch.tar.gz" in the install script

These two should be functionally equivalent. In the former curl is outputting to stdout and bash is redirecting that stream to a file, while in the latter curl is outputting directly to the file. The only time I would expect their behavior to differ would be if the download did not finish. (e.g. bash immediately truncates the output file and waits for stdin, but curl won't create/write to the file until it has content from the remote server to write).


  1. Do you have a .curlrc? If yes, can you paste it? It could be in the following places:
  • $HOME/.curlrc
  • $XDG_CONFIG_HOME/curl/curlrc or $HOME/.config/curl/curlrc
  • /etc/curlrc
  1. Do you have curl defined as an alias/function? which curl
  2. Do you have a tar configuration file present?
  • ~/.tar
  • /etc/tar.conf
  • /etc/tarrc
  • /etc/tar/tarrc
  1. Do you have tar defined as an alias/function? which tar
  2. Can run tar --show-defaults and paste your results? On Ubuntu 22 mine is:
--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/sbin/rmt --rsh-command=/usr/bin/rsh

@krishnaraj
Copy link
Author

krishnaraj commented Oct 5, 2024

  1. Yes, I do have .curlc with the following contents
    -w "\n"

  2. No alias defined for curl

  3. No configuration file and alias present for tar

  4. Results for tar --show-defaults

--format=gnu -f- -b20 --quoting-style=escape --rmt-command=/usr/sbin/rmt --rsh-command=/usr/bin/rsh

@krishnaraj
Copy link
Author

Ah! the .curlc was the issue, works fine if I remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] installer / updater Feedback for installation and update process linux
Projects
None yet
Development

No branches or pull requests

9 participants