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

Feature Request: breakpoint-resume install #3849

Closed
yetangye opened this issue Feb 12, 2020 · 6 comments
Closed

Feature Request: breakpoint-resume install #3849

yetangye opened this issue Feb 12, 2020 · 6 comments

Comments

@yetangye
Copy link

When install big packages in a slow network environment, the download often breaks by slow network, when execute the install command the next time, scoop should resume the download from the breakpoint of last download.

The behavior now is not good, as scoop treate a download failed package as installed.
below is an example.

~ $ scoop install dotnet-sdk
Installing 'dotnet-sdk' (3.1.101) [64bit]
dotnet-sdk-3.1.101-win-x64.zip (153.3 MB) [>                                                                  ]   1%
操作已超时。(Timeout)
URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.101/dotnet-sdk-3.1.101-win-x64.zip is not valid
~ $ scoop install dotnet-sdk
ERROR It looks like a previous installation of dotnet-sdk failed.
Run 'scoop uninstall dotnet-sdk' before retrying the install.
WARN  'dotnet-sdk' () is already installed.
Use 'scoop update dotnet-sdk' to install a new version.
~ $ scoop update dotnet-sdk
dotnet-sdk:  (latest version)
Latest versions for all apps are installed! For more information try 'scoop status'
@wuya666
Copy link

wuya666 commented Feb 15, 2020

Yes, this is quite a nuisance as how it is handled right now. My current solution is use aria2, and if the download is interrupted, manually use aria2c to resume the download and then resume the install or update process.

for example, when I encounter an install/update failure with aria2 enabled with the following message:

ERROR Download failed! (Error 22) HTTP response header was bad or unexpected
ERROR https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
    referer=https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/
    dir=C:\Users\xxx\scoop\cache
    out=FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

I'll just do the following to resume the download of the installation file to the cache directory:

cd C:\Users\xxx\scoop\cache
aria2c https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip -o FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

With the installation file ready in the cache directory, you can then try force update over a broken installation with the -f switch, or just uninstall the broken installation first and try install again. As long as the downloaded installation file still exists in the cache directory, the installation will not try to download it again. Updating is not affected by this quirk and I can just run scoop update * after manually completing the broken installation file download to resume the full update process.

It's basically the only way for me to install/update large-sized applications with scoop with an unstable connection. I do think it needs some improvement for scoop to be able to auto-resume broken downloads, especially when aria2 is enabled.

Currently if the last aria2 download failed at 99%, and you don't do the installation file download manually, the scoop install/update command will complain that the cached download has bad hash and delete the whole thing, forcing you to download the whole thing from the start again, somehow defeating one of the major purpose of the aria2 features.

@shilangyu
Copy link

This is really annoying for people with slow connections.

image

I love waiting hours for a download just for a really small hiccup to cancel all of my progress. Reminds me of the old days when downloading files straight from the browser. Is there any way I can help with this? If resumable downloads can't be easily implemented with windows-native tools perhaps an external dependency can be pulled to enable this behavior?

@escape0707
Copy link

@shilangyu You definely need Aria2. And IIRC, scoop use Aria2 by first generate a file containing all the arguments and then pass that file to aria2's input-file parameter.

You should be able to find out the file by looking at the thrown exception and repeat the download command.

Once the download is finished, you can redo the installation.

@shilangyu
Copy link

shilangyu commented Mar 19, 2021

Thank you @escape0707. I understand I can solve it with a workaround but I wish scoop would support resumable downloads by natively.

@escape0707
Copy link

escape0707 commented Mar 20, 2021

Yeap, me too! But just in case you need a workaround right now for the Android Studio. 😉

I've experienced this kind of awkward, too. At that time I need to download a proxy software from GitHub but I can't get any speed downloading from GitHub without a proxy. What a pain in the ass.

@rashil2000
Copy link
Member

Have you checked if #3292 fixed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants