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

apt-get update often hangs #472

Closed
hut8 opened this issue Jun 3, 2016 · 23 comments
Closed

apt-get update often hangs #472

hut8 opened this issue Jun 3, 2016 · 23 comments

Comments

@hut8
Copy link

hut8 commented Jun 3, 2016

This is quite unfortunately not deterministic. If I run apt-get update or apt update 10 times in a row, 9 or 10 of the times it will hang at: 12% [Working]

strace gives:

select(7, [5 6], [], NULL, {0, 500000}) = 0 (Timeout)
gettimeofday({1464973191, 648055}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
12% [Working]) = 23[33m\r12% [Working]", 23

(repeatedly, forever).

After searching all of the issues in this project, I can't find one that matches this. Is this something others have encountered?

@aseering
Copy link
Contributor

aseering commented Jun 3, 2016

I've seen something like this a couple of times, but I was never sure whether it was due to a Windows bug, or flakiness with my Internet connection, or (at the time; I haven't installed packages recently) known bugs in the socket implementation that have since been fixed.

@zerocool4u2
Copy link

zerocool4u2 commented Jun 3, 2016

i test it with the same servers on the virtual machine at the same time, multiple times and just bashonwindows hangs. Most of the time i just ctrl + d and redo(on upgrade), and it will be more fast than wait for it

@zerocool4u2
Copy link

now i remember something and thinking about it, the issue seems to be that the internet speed its going down over time until reach cero, i have 700kbs speed and when i notice that the speed drop down to 100 or even 20kbs i just restart the upgrade and it goes back to 700, if there is some info i can provide let me know, regards

@sunilmut
Copy link
Member

sunilmut commented Jun 6, 2016

@hut8 - Thanks for reporting the issue. Which build are you seeing this on? I tried this on 14352 and I couldn't repro even a single hang.
@zerocool4u2 - How are you monitoring your network speed? And, from where i.e Windows or within WSL?

@zerocool4u2
Copy link

two machines, one with WSL and the other with virtualbox ubuntu 14.04 running on windows, both are with 700kbs limited through router and for the network speeds monitoring, not really, just the feedback from apt-get upgrade command line, pretty rustic, but if you have any suggestions i could do something more exhausting, regards

@russalex
Copy link
Contributor

russalex commented Jun 7, 2016

@zerocool4u2, what build are you running? We have seen some issues with this in the past but have addressed most of these. Also, any firewalls or additional networking components in the loop?

Also, can you give us an strace of the apt-get when it's slow? If you get it running 10x may be interesting to post one when running normally and one when slow. If you do not want to post the straces (they get long), feel free to email them to [email protected]. Include in the subject / message to forward to the WSL team. In the body of the email mention it is for russalex and that this is for issue #472.

@zerocool4u2
Copy link

@russalex so, i run it 20 times and... no "luck(?)", i couldn't get it to hang this time, a couple of things, currently i'm running 14352 and i believe the last time i saw this happening was on 14342(previous version, i think that was the number), other factor that could influence the hang was that the versions were just released, maybe overload of the servers? i don't really know how many people are using this, and the other things was that until the last version i was installing from scratch each version so i have a little more to work in each time, i could still send you the output files, let me know, but i don't see how they could be of any help, in any case i will be saving future outputs for a couple of new builds, hopefully this was already resolved 😄 and if i encountered this again i will write you here, thanks and regards!

@sunilmut
Copy link
Member

sunilmut commented Jun 7, 2016

@zerocool4u2 - Thanks. There were few socket related bugs that were fixed in 14352, which I could definitely see playing a role here. If you or anyone else can repro this on 14352(+), then we would definitely be interested hearing about it and getting the logs.

@hut8
Copy link
Author

hut8 commented Jun 7, 2016

I actually had this issue since the first build I tried months ago, and it hasn't changed. I have 14352 now. The only strace logs are what I put above, but it's repeated many, many times and probably never completes (I've let it run for 10 minutes, and I can regularly get 32Mbps downloads).

@hut8
Copy link
Author

hut8 commented Jun 8, 2016

Just some more information -- I am puzzled as to why this only happens with apt-get update and not ever apt-get install <anything>. It's definitely consistently happening with update, and never with install. No clue as to why.

@benhillis
Copy link
Member

benhillis commented Jul 5, 2016

The most recent Windows Insider fast ring build has a fix that should resolve the apt-get hangs you were seeing. Could you please try out build 14376 or later and reopen if you're still seeing issues?

@UndarkAido
Copy link

The issue has definitely not been fixed.

@aseering
Copy link
Contributor

@Aidoboy -- thanks for posting! @sunilmut stated above that this was fixed in r 14352, and that if anyone still sees the issue, they would like to see the logs. Could you please confirm that your Windows version is new enough to contain the fix? (Run ver at a Windows Command Prompt.) And if so, post relevant details from your logs?

@aseering
Copy link
Contributor

aseering commented Oct 18, 2017

I'll add -- I use apt-get quite frequently. Before the fix, it regularly hung. After the fix, I have seen hangs, but they are much less frequent, and I have been able to conclude that every hang was due not to WSL, but rather to me using a flaky network. Fixing the flaky network fixed apt.

For example, very weak wireless signal; when I moved closer to the router, apt became reliable again. Or, network with a proxy server; when I configured the proxy server within WSL, it started working reliably. Or, network with IPv6 misconfigured -- apt will use IPv6 if available by default; I was once on a network that advertised IPv6 support and that would route traffic to some public IPv6 servers but mysteriously dropped all connections to others; ultimately I had to disable IPv6 entirely on that network, that fixed apt as well as several other Linux and Windows programs.

@UndarkAido
Copy link

I dual-boot Ubuntu 16.04 and Windows 10, (Fall Creator's Update, see below,) and this issue only happens in the Linux Subsystem.

C:\Users\Aidan>ver

Microsoft Windows [Version 10.0.16299.19]

I just timed it, it hung at the following for 1 and 3/4 minutes with the addresses periodically shifting.

aidan@viselik:~$ sudo apt-get update && sudo apt-get upgrade
[sudo] password for aidan:
0% [Connecting to archive.ubuntu.com (2001:67c:1560:8001::14)] [Connecting to security.ubuntu.com (2001:67c:1562::16)]

@aseering
Copy link
Contributor

Thanks for the update. Hm... I see apt is using IPv6 in WSL. Is it also using IPv6 in Ubuntu? Also, is IPv6 configured equivalently in both environments?; does a site like http://ipv6-test.com/ report the same results for both?

Also -- does this happen 100% of the time? Or are there times when apt is able to download some or all content without hanging?

@UndarkAido
Copy link

It happens 100% of the time. Both environments are set to defaults. My University doesn't seem to support ipv6, although I don't have the spare time right now to test it on Ubuntu, I have a lot of homework from aforementioned University. I may be able to check this weekend.

@aseering
Copy link
Contributor

Hm -- well, Windows seems to think that your machine has received a routeable IPv6 address.

Good luck with all your homework! If you get a chance at some point, I would suggest trying to sort out what's up with Windows and IPv6 and your network. (Maybe you're getting a Teredo or 6to4 tunneled address but your university is blocking its traffic?) See whether it's really an apt/WSL issue, or something broader.

@aseering
Copy link
Contributor

(If more-specific instructions would be helpful, let me know. I'd suggest starting by going to the website above.)

@nutcasev15
Copy link

nutcasev15 commented Jun 6, 2018

@aseering
Nice to bring this thread back to life an year after it was deserted.

I have posted in #2477 but its quite clear the issue I have is this one. It refuses to download, the speed is irrelevant. I'm finding it very difficult to get by on a VM as WSL has become basically useless to me as I need to frequently update packages as I compile kernels & Android which requires the latest stuff like libc to have the best possible compile product.

I am on 17134 April Update, you can take a look at the logs in #2477 & the attached one here. I also took a look on the site you mentioned. I have no ipv6 reachability, ISP does not support it. All the issues I have are on ipv4 as my commont on 2477 states.

I had to uninstall because I managed to screw up DRVFS mounting because of another issue with random files disappearing & reappearing ( #2712 ).

I feel fixing this or really any apt related issues should be a priority since it is the first command any developer runs after installing any distro.

Thank You

apt.txt

@wtdcode
Copy link

wtdcode commented Jul 18, 2018

@aseering I have disabled ipv6 protocol in Windows and both ipconfig and ifconfig indicates that there is no ipv6 address for my network, but the problem is still not solved.

Futhermore, I switch another source instead of default kali source, the apt still hangs from time to time.

@elabdi
Copy link

elabdi commented May 27, 2022

i know its late but i solved it by whitelisting or deactivating my antivirus i use which is Avast premium and it works now.

@ghuser
Copy link

ghuser commented Oct 11, 2023

Being part of some wsl-specific group on Symantec was causing the issue. The end-effect of it was outbound access to plain http from wsl was not allowed. No more info on this because the sys-admin took care of it, but that was in brief the explanation.

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