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

SMB share freezes #3635

Closed
jyggen opened this issue May 5, 2014 · 14 comments
Closed

SMB share freezes #3635

jyggen opened this issue May 5, 2014 · 14 comments

Comments

@jyggen
Copy link
Contributor

jyggen commented May 5, 2014

Me and a co-worker are having an issue with shared folders using SMB. For some reason the SMB share seems to freeze everything on the server that tries to access it. This is not always the case, and a simple vagrant reload will fix the issue, but it reappears after a while again.

When this issue starts to appear, trying to cd into the share (in this case /var/www) will freeze the SSH session:
vagrant issue

Just writing /var/w and autocomplete with tab will do the same thing. According to my co-woker cd /var will freeze as well.

Nginx also stops working, the connection will eventually time out when trying to access any of the sites. If I try to reload nginx (sudo service nginx reload) I end up with an empty prompt similar to the one in the screenshot above. I've tried to remove every site that is located on the SMB share from the nginx config and (if I remember correctly) nginx started to work again.

This is the SMB config:

config.vm.synced_folder "www/", "/var/www", type: "smb"

Not really sure how to debug this further, so any advice is appreciated.

Edit: After writing this it appeared again. Maybe it's related to letting the box/share idle for a while?

@mitchellh
Copy link
Contributor

I doubt this is a Vagrant issue, but it is possible Vagrant could set some configs to avoid this sort of behavior. I recommend asking the mailing list first why this may be happening, and reopening an issue when we pinpoint where/how it is happening.

@danielboendergaard
Copy link

I have the same issue, did you find a solution @jyggen ?

@jyggen
Copy link
Contributor Author

jyggen commented May 28, 2014

@danielboendergaard Sadly not. I'm pretty sure it has to do with letting the box idle for a while (no share activity from the guest) but haven't found a way to really debug it since the commands I try to check the share/mount with will access it and thus freeze the machine.

@danielboendergaard
Copy link

I can confirm that this happens every time i let the box idle for 20-30 minutes.

@galmet
Copy link

galmet commented Jun 18, 2014

Hello,
I confirm that it happens to me and other developers that I work together when using SMB as well. I was thinking that it could be related to Ubuntu going into power saving mode or something like that. Any ideas please?

@danielboendergaard
Copy link

My temporary fix for this is adding a cronjob that writes to the share every five minutes.

*/5 * * * * touch /home/vagrant/code/random-file && rm /home/vagrant/code/random-file

@galmet
Copy link

galmet commented Jun 18, 2014

Thanks for sharing your fix @danielboendergaard

@galmet
Copy link

galmet commented Jun 18, 2014

Based on @danielboendergaard's response I did some googling and I wonder if the reason is because the smb session is timing out as indicated here : http://technet.microsoft.com/en-us/library/jj852253(v=ws.10).aspx

I will try to increase the value to see if it helps at all. (Strange that the resume wouldnt work though )

@galmet
Copy link

galmet commented Jun 19, 2014

Hi, I just wanted to follow up on this : I changed Amount of idle time required before suspending session and now it seems to work ok . For those of you who would like to do the same on Windows 7

gpedit.msc > Local Computer Policy > Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options >Microsoft network server: Amount of idle time required before suspending session

Hope it helps..

@mabasic
Copy link

mabasic commented Jul 5, 2014

I have tried setting the value to 0 and to 99999 but it did not work. After two hours of inactivity it still freezes.

Why doesn't vagrant handle the resume of smb connection?

Currently using smb is my only option because I need symbolic links to work because of node_modules and npm. Can this be resolved somehow?

@Warxcell
Copy link

Warxcell commented Dec 2, 2014

In my case vagrant freezes at "vagrant up". During Checking if box 'puphpet/ubuntu1404-x64' is up to date... If I switch back to default synced folders everything is ok.

@cbrunnkvist
Copy link

Ran into this issue now. Indeed it seems like the mount client-or-server end will timeout after a certain period: at that point, the cifs client will wait seemingly forever for a reply and then you get the same exact situation as with an nfs mount -o=hard waiting forever for a reply. Cron job...oh well, that is one workaround.
😨

@cbrunnkvist
Copy link

The server IP address being used for the mount is the main one on the first interface of the host, but I think it should be using the "closest" address i.e. 10.0.2.2 in the default case.

I realized this while looking at the "has not responded in 120 seconds" syslog message: of course it will not respond as the host main interface had received a new DHCP assignment (and how is the client/VM supposed to know about that)

@cbrunnkvist
Copy link

Changed it to

config.vm.network "private_network", ip: "192.168.50.4"
config.vm.synced_folder "./", "/vagrant", type: "smb", mount_options: ['ip=192.168.50.1'] #host side of that :private_network

but still have not been able to verify to a 100% that this actually alleviates the share-stops-working situation..

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants