-
Notifications
You must be signed in to change notification settings - Fork 150
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
clink update fails with "Failed to unzip the latest release" #303
Comments
I get a response, so TLS1.2 works:
|
Can confirm. ✅ Works successfully on:
🛑 Does not work on:
When it fails, it fails like this: Clink v1.3.23.5d5aed
Copyright (c) 2012-2018 Martin Ridgers
Portions Copyright (c) 2020-2022 Christopher Antos
https://github.com/chrisant996/clink
C:\>clink update
Checking latest version...
Downloading latest release...
Expanding zip file...
Failed to unzip the latest release. |
Can you attempt Maybe on Win8.x Powershell doesn't support unzipping? Do you have Clink installed under Program Files? |
In my case, the 6188 start_logger 154 ---- 2022/06/17 20:20:23.751 -------------------------------------------------
6188 start_logger 160 Host process is 'cmd.exe' (pid 24968)
6188 start_logger 164 DLL path is 'C:\Program Files (x86)\clink'
6188 start_logger 178 Windows version 10.0.14393 (x64)
6188 start_logger 181 Clink version 1.3.23.5d5aed (x64)
6188 host_cmd::validate 304 Host is not interactive; cancelling inject.
17b0 =? 0 Clink updater: failed to unzip the latest release.
0508 history_db::compact 1494 History: 539 active, 167 deleted I'm running this from an already UAC-elevated command prompt. |
here is my log:
|
Can you try bypassing AutoRun and see if that makes a difference? e.g. |
Hopefully, I did understand correctly what you suggested. This is what I did: C:\>cmd /d "c:\Program Files (x86)\clink\clink" inject
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\>clink update
Checking latest version...
Expanding zip file...
Failed to unzip the latest release.
C:\> The content of the log file now looks like this: 23a8 start_logger 154 ---- 2022/06/17 20:30:33.443 -------------------------------------------------
23a8 start_logger 160 Host process is 'cmd.exe' (pid 9128)
23a8 start_logger 164 DLL path is 'C:\Program Files (x86)\clink'
23a8 start_logger 178 Windows version 10.0.14393 (x64)
23a8 start_logger 181 Clink version 1.3.23.5d5aed (x64)
23a8 host_cmd::validate 304 Host is not interactive; cancelling inject.
0834 =? 0 Clink updater: failed to unzip the latest release. |
Ok what does this command report? %systemroot%\system32\windowspowershell\v1.0\powershell.exe -Command $ProgressPreference='SilentlyContinue' ; Expand-Archive -Force -LiteralPath "%temp%\clink\updater\v1.3.24.zip" -DestinationPath "c:\program files (x86)\clink" ; echo $error.count |
This is the script and the result: C:\>%systemroot%\system32\windowspowershell\v1.0\powershell.exe -Command $ProgressPreference='SilentlyContinue' ; Expand-Archive -Force -LiteralPath "%temp%\clink\updater\v1.3.24.zip" -DestinationPath "c:\program files (x86)\clink" ; echo $error.count
x86 : The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:177
+ ... nk\updater\v1.3.24.zip -DestinationPath c:\program files (x86)\clink ...
+ ~~~
+ CategoryInfo : ObjectNotFound: (x86:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
1
C:\> Maybe the white space in the path to clink is the issue here? |
same for me, also CommandNotFoundException |
Ah. Cmd is stripping quotes. 😑 Must add another layer of quotes. |
But that's not the problem, unless your %TEMP% directory name contains spaces. Clink expands the zip file into So the command I should have asked you to run is actually this: %systemroot%\system32\windowspowershell\v1.0\powershell.exe -Command $ProgressPreference='SilentlyContinue' ; Expand-Archive -Force -LiteralPath "%temp%\clink\updater\v1.3.24.zip" -DestinationPath "%temp%\clink\updater\v1.3.24" ; echo $error.count |
OK, I ran the script: Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
Clink v1.3.23.5d5aed
Copyright (c) 2012-2018 Martin Ridgers
Portions Copyright (c) 2020-2022 Christopher Antos
https://github.com/chrisant996/clink
Clink v1.3.24 is available.
- To apply the update, run 'clink update'.
- To stop checking for updates, run 'clink set clink.autoupdate false'.
- To view the release notes, visit the Releases page:
https://github.com/chrisant996/clink/releases
C:\>%systemroot%\system32\windowspowershell\v1.0\powershell.exe -Command $ProgressPreference='Silentl
yContinue' ; Expand-Archive -Force -LiteralPath "%temp%\clink\updater\v1.3.24.zip" -DestinationPath "%temp%\clink\update
r\v1.3.24" ; echo $error.count
New-Object : Exception calling ".ctor" with "3" argument(s): "Central Directory corrupt."
At
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Archive\Microsoft.PowerShell.Archive.psm1:934
char:23
+ ... ipArchive = New-Object -TypeName System.IO.Compression.ZipArchive -Ar ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
1
C:\> |
my temp has no space:
but the zip in the folder has 0kb in size 🤔 |
Uh lol whoa. So maybe the unzip algorithm in the Win8.x Powershell has a flaw, or maybe a network error corrupted the .zip file during download? Can you upload the |
Oh, ok. So it somehow got interrupted or didn't download at all. What happens if you delete the zip file and try |
I already tried this and it always happens the same. zip is 0kb. What is the download command you use? I could run it and post any errors. |
under Windows 10 it works fine:
|
It seems that this is the Looks like it is using the |
my zip is 0kb, so download is somehow broken on 8.1 🤔 🤷♂️ |
on my Windows 10, where the update worked, I still see the update when I run |
I made the http call to check for latest release use TLS 1.2. /facepalm |
Fixed by f724b0a. |
ok, will test this in next update to .26. But updatecheck doesn't find the .25 version:
|
Last time that happened, it was a GitHub service issue, most likely with cache replication delays. |
I still see it. How long can this take? what about the |
today I still see the message that .24 is latest release:
|
@MagicAndre1981 Does your Win10 computer see v1.3.25? The fact that Clink is able to say "not older than latest release v1.3.24" means it successfully queried the github API for "get latest release", and github reported "v1.3.24" as the latest release. Here is the github API link: https://api.github.com/repos/chrisant996/clink/releases/latest. To see what github is reporting:
The fact that Clink is able to say "v1.3.24" shows that the API request succeeded, and reported "v1.3.24". If the github API reports an inaccurate version, there is nothing Clink could do to fix whatever problem the github web site is encountering. EDIT: Maybe something is caching web requests and return old cached results -- maybe your ISP, maybe a proxy between you and github, maybe your employer, maybe malware detection software, maybe something else. |
can you please post the powershell command you use to expand the zip? Maybe running it normally shows more details what is wrong. |
Now I've manually installed Maybe this fixed some download issues. Will try again when |
Please try this pre-release installer: clink_setup_0.0.1.zip It is the latest Clink, plus additional logging for updater failures, but its version number is artificially set to v0.0.1 so it will always want to update. If/when it fails, the log file should contain details about the command line that failed, and any error text that was output by the command. |
Crazy! This version works correctly on my Windows Server 2016! Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
Clink v0.0.1.7c097e
Copyright (c) 2012-2018 Martin Ridgers
Portions Copyright (c) 2020-2022 Christopher Antos
https://github.com/chrisant996/clink
Clink v1.3.26 is available.
- To apply the update, run 'clink update'.
- To stop checking for updates, run 'clink set clink.autoupdate false'.
- To view the release notes, visit the Releases page:
https://github.com/chrisant996/clink/releases
C:\>clink update
Checking latest version...
Expanding zip file...
Updating registry keys...
Updated Clink to v1.3.26.
C:\> The 7d98 start_logger 154 ---- 2022/06/23 19:41:30.374 -------------------------------------------------
7d98 start_logger 160 Host process is 'cmd.exe' (pid 32152)
7d98 start_logger 164 DLL path is 'C:\Program Files (x86)\clink'
7d98 start_logger 178 Windows version 10.0.14393 (x64)
7d98 start_logger 181 Clink version 1.3.26.eec90c (x64)
7d98 host_cmd::validate 304 Host is not interactive; cancelling inject.
532c =? 0 Clink updater: updated Clink to v1.3.26.
5910 history_db::compact 1494 History: 543 active, 181 deleted |
ok, this helped. Expand-Archive is not found as command:
Output of
Looks like I have to install the 5.1 Update first: Windows Management Framework 5.1 |
😑 I will look for a way to check the Powershell version and report an informative error message. 😑 |
it works: 🥰🥳
so yes, check for PS 5.1 on Win7, 8.1, Server 2008 R2, Server 2012 R2 systems to avoid this |
It means the changes that will show up in .27 fixed the issues you were encountering. Or another possibility is that antivirus protection is intermittently blocking operations. |
Thanks for all your efforts, @chrisant996, highly appreciated by me! I'm only using the built-in Windows Defender, no 3rd party snake oil. So I hope this does not interfer. |
@UweKeim @MagicAndre1981 can one of you try |
Phew. I expect the updater in v1.3.27 will finally work on Win8.x. But we'll have to wait until v1.3.28 to know for certain, of course. I also noticed that the PowerShell output in the log file showed up with the wrong encoding, so I added a Lua API for codepage/UTF8 conversion so that the log file can contain accurate output from the PowerShell commands. And the functions can be used for output from other programs in general -- in fact, for any programs whose output is in the current Active Code Page rather than UTF8. Lua scripts must explicitly use |
I did the update to .27, but now I see an error:
|
I think the Powershell version check is failing when the UI language is not English. That issue is tracked by #309. |
@MagicAndre1981 for closure:
I finally figured out what was happening, and fixed it. If there was a downloaded zip update file already, and the current Clink is already up to date with the latest release, then the "already up to date" message accidentally cited the downloaded zip update file version rather than the actual live version. The functionality was correct, but the "nothing to do" message cited the wrong version number. It's fixed in v1.3.32. |
|
Hi,
|
See the Try manually running the Powershell command that's listed in the log: what happens when you run it manually? |
If I run "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -Command $ProgressPreference='SilentlyContinue' ; Expand-Archive -Force -LiteralPath "C:\Users\piero\AppData\Local\Temp\clink\updater\v1.3.33.zip" -DestinationPath "C:\Users\piero\AppData\Local\Temp\clink\updater\v1.3.33" it gaves no output in console and simply do the job (I find the files regularly unzipped in the destination path which I previously removed) |
@captainkirkoff The Can you run the following command? Please do not strip the $error parts -- they are an important part of the command, especially for troubleshooting purposes. "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -Command $ProgressPreference='SilentlyContinue' ; Expand-Archive -Force -LiteralPath "C:\Users\piero\AppData\Local\Temp\clink\updater\v1.3.33.zip" -DestinationPath "C:\Users\piero\AppData\Local\Temp\clink\updater\v1.3.33" ; echo $error.count ; echo $error It will be useful to confirm what error has occurred, so that you can potentially fix the PowerShell configuration on that computer, and so that Clink can be more resilient to external errors that don't directly affect what Clink needs to accomplish. |
remove this 3rd party module "Jump.Location" and try again |
@captainkirkoff ah, excellent, thank you. Yes, there is indeed some configuration problem with PowerShell on that computer. Apparently an error occurs in a script that automatically runs during PowerShell startup. I have a change coming in Clink that will make it resilient to that kind of problem. (Unless the configuration problem affects only the Expand-Archive command, and not PowerShell startup.) |
Yes! And as @MagicAndre1981 suggests, removing that module everything goes fine. By the way, thank you for this wonderful piece of software. :-) |
Got this same problem right now in 2024. Quite odd considering that the last few Clink updates installed smoothly. |
Check whether your anti virus tool is interfering. Some people have reported that some anti virus tools are getting false positives. Also check the clink.log file to see if it lists any info about what failed. |
Indeed you are right, Windows Defender's Protection History shows that it was removing the Overactive Antivirus smh. Thanks for the help, Chris. |
I tried to update from .23 to .24 on Windows 8.1, but it fails:
The text was updated successfully, but these errors were encountered: