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

Update fails on Windows #4269

Open
KnapSac opened this issue Feb 15, 2025 · 5 comments · May be fixed by #4273
Open

Update fails on Windows #4269

KnapSac opened this issue Feb 15, 2025 · 5 comments · May be fixed by #4273
Labels
bug Something isn't working

Comments

@KnapSac
Copy link

KnapSac commented Feb 15, 2025

Describe the bug
I'm unable to update lazygit using the Check for update command.

To Reproduce
Steps to reproduce the behavior:

  1. Go to panel 1 Status
  2. Press u to trigger Check for update
  3. Press Enter when prompted to download and install the new version
  4. The update fails almost immediately with the following error:
    Update failed: tar: lazygit: Not found in archive
    tar: Error exit delayed from previous errors
    

Expected behavior
lazygit is updated to the latest version.

Version info:
I'm purposefully not on the latest version, because there needs to be a newer version to reproduce the bug.

lazygit: commit=c03b89227092b852d50015d289a7c6d8c69811c5, build date=2025-01-17T13:37:10Z, build source=binaryRelease, version=0.45.2, os=windows, arch=amd64, git version=2.47.0.windows.1
git: git version 2.47.0.windows.1

Additional context

Logs

Feb 15 10:07:26 |INFO| git worktree list --porcelain (22.9867ms)
Feb 15 10:07:26 |DEBU| RunCommand command="git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir"
Feb 15 10:07:26 |INFO| git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir (23.5029ms)
Feb 15 10:07:26 |INFO| postRefreshUpdate for worktrees took 0s
Feb 15 10:07:26 |INFO| postRefreshUpdate for localBranches took 0s
Feb 15 10:07:26 |INFO| Heap memory in use: 52.6 MB
Feb 15 10:07:26 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s --abbrev=40 -300 --no-show-signature -- (655.2964ms)
Feb 15 10:07:26 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:07:26 |INFO| postRefreshUpdate for commits took 0s
Feb 15 10:07:26 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:17:55 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (184.4656ms)
Feb 15 10:17:55 |INFO| postRefreshUpdate for submodules took 0s
Feb 15 10:17:55 |INFO| postRefreshUpdate for files took 0s
Feb 15 10:17:55 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s --abbrev=40 -300 --no-show-signature -- (624.3136ms)
Feb 15 10:17:55 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:17:55 |INFO| postRefreshUpdate for commits took 1.6039ms
Feb 15 10:17:55 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:17:55 |INFO| git -c log.showSignature=false log -g --abbrev=40 --format=%h%x00%ct%x00%gs%x00%p (693.1327ms)
Feb 15 10:17:55 |INFO| postRefreshUpdate for reflogCommits took 92.1604ms
Feb 15 10:17:55 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads"
Feb 15 10:17:55 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (81.7444ms)
Feb 15 10:17:55 |INFO| postRefreshUpdate for localBranches took 0s
Feb 15 10:17:55 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:18:01 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (201.0045ms)
Feb 15 10:18:01 |INFO| postRefreshUpdate for submodules took 0s
Feb 15 10:18:01 |INFO| postRefreshUpdate for files took 0s
Feb 15 10:18:01 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (85.3668ms)
Feb 15 10:18:01 |DEBU| RunCommand command="git worktree list --porcelain"
Feb 15 10:18:01 |INFO| git worktree list --porcelain (24.7517ms)
Feb 15 10:18:01 |DEBU| RunCommand command="git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir"
Feb 15 10:18:01 |INFO| git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir (22.6997ms)
Feb 15 10:18:01 |INFO| postRefreshUpdate for worktrees took 0s
Feb 15 10:18:01 |INFO| postRefreshUpdate for localBranches took 0s
Feb 15 10:18:02 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s --abbrev=40 -300 --no-show-signature -- (658.4816ms)
Feb 15 10:18:02 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:18:02 |INFO| postRefreshUpdate for commits took 0s
Feb 15 10:18:02 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:18:04 |INFO| Checking for an updated version
Feb 15 10:18:04 |INFO| Current version is v0.45.2
Feb 15 10:18:04 |INFO| New version is v0.46.0
Feb 15 10:18:04 |INFO| Url for latest release is https://github.com/jesseduffield/lazygit/releases/download/v0.46.0/lazygit_0.46.0_Windows_x86_64.zip
Feb 15 10:18:04 |INFO| Checking for resource at url https://github.com/jesseduffield/lazygit/releases/download/v0.46.0/lazygit_0.46.0_Windows_x86_64.zip
Feb 15 10:18:04 |INFO| Received status code 200
Feb 15 10:18:04 |INFO| Verified resource is available, ready to update
Feb 15 10:18:05 |INFO| Heap memory in use: 60.8 MB
Feb 15 10:18:05 |INFO| Url for latest release is https://github.com/jesseduffield/lazygit/releases/download/v0.46.0/lazygit_0.46.0_Windows_x86_64.zip
Feb 15 10:18:05 |INFO| Updating with url https://github.com/jesseduffield/lazygit/releases/download/v0.46.0/lazygit_0.46.0_Windows_x86_64.zip
Feb 15 10:18:05 |INFO| Download directory is C:\Users\cverhaar\AppData\Roaming\lazygit
Feb 15 10:18:05 |INFO| Temp path to tarball/zip file is C:\Users\cverhaar\AppData\Roaming\lazygit\temp_lazygit.zip
Feb 15 10:18:06 |INFO| git status --untracked-files=all --porcelain -z --find-renames=50% (194.497ms)
Feb 15 10:18:06 |INFO| postRefreshUpdate for submodules took 0s
Feb 15 10:18:06 |INFO| postRefreshUpdate for files took 0s
Feb 15 10:18:06 |INFO| git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads (87.6728ms)
Feb 15 10:18:06 |DEBU| RunCommand command="git worktree list --porcelain"
Feb 15 10:18:06 |INFO| git worktree list --porcelain (24.5004ms)
Feb 15 10:18:06 |DEBU| RunCommand command="git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir"
Feb 15 10:18:06 |INFO| git -C I:/MyRepo rev-parse --path-format=absolute --absolute-git-dir (23.2553ms)
Feb 15 10:18:06 |INFO| postRefreshUpdate for worktrees took 0s
Feb 15 10:18:06 |INFO| postRefreshUpdate for localBranches took 0s
Feb 15 10:18:07 |INFO| git log HEAD --topo-order --oneline --pretty=format:%H%x00%at%x00%aN%x00%ae%x00%D%x00%p%x00%m%x00%s --abbrev=40 -300 --no-show-signature -- (640.7065ms)
Feb 15 10:18:07 |DEBU| using cache for key rebase.updateRefs
Feb 15 10:18:07 |INFO| postRefreshUpdate for commits took 0s
Feb 15 10:18:07 |DEBU| using cache for key rebase.updateRefs

@KnapSac KnapSac added the bug Something isn't working label Feb 15, 2025
@ChrisMcD1
Copy link
Contributor

I am also able to reproduce, although downloading the zip, I see the lazygit file inside of it. Curious.

Image

@ChrisMcD1
Copy link
Contributor

Confirmed the file gets downloaded to the lazygit configuration folder, as it should

Image.

Problem might to be that the file is actually called lazygit.exe, and the installer is looking for lazygit?

tar -tvf C:\Users\camcd\AppData\Local\lazygit\temp_lazygit.zip
-rw-r--r--  0 0      0        1071 Feb 14 23:51 LICENSE
-rw-r--r--  0 0      0       31524 Feb 14 23:51 README.md
-rwxr-xr-x  0 0      0    19645952 Feb 14 23:54 lazygit.exe

@ChrisMcD1
Copy link
Contributor

Although I see the same file names on many previous releases. I've never used the windows auto-update feature before, has it historically worked for you @KnapSac ?

@KnapSac
Copy link
Author

KnapSac commented Feb 15, 2025

No, I have never had this feature working.

It's interesting that the error mentions tar, which might indicate that the code expects a tarball instead of a zip archive.

@KnapSac
Copy link
Author

KnapSac commented Feb 15, 2025

Just took a quick look at the code and I found the bug, I'll open a PR.

KnapSac added a commit to KnapSac/lazygit that referenced this issue Feb 15, 2025
@KnapSac KnapSac linked a pull request Feb 15, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants