Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Rebooting PC causes Nitro sites to become inaccessible #180

Closed
DouglasKGlover opened this issue Jun 30, 2020 · 9 comments
Closed

Rebooting PC causes Nitro sites to become inaccessible #180

DouglasKGlover opened this issue Jun 30, 2020 · 9 comments
Assignees

Comments

@DouglasKGlover
Copy link

I may be missing something, but I have been trying to get Nitro up and running for local dev. Every time I get it going it's smooth and works fine, ignoring a few issues that I was able to find solutions for online relatively quickly. But when I restart or shutdown my computer and then later come back to continue working on it, the sites become inaccessible, with a generic "This site can't be reached" message from the browser.

Looking at "Nitro info" it looks like the IP has changed so I've tried updating that on my Craft CMS config files and local hosts file (Windows machine), but to no avail.

Any help at all would be greatly appreciated as this has been pretty solid to work with... until I reboot my computer.

@jasonmccallister
Copy link
Contributor

@DouglasKGlover you need to disable internet sharing, this seems to be a known thing with the way multipass using the Windows hypervisor.

There is a tutorial on troubleshooting the windows networking here: https://multipass.run/docs/troubleshooting-networking-on-windows

I need to confirm, but it appears to resolve itself if you disable internet sharing on Windows.

@DouglasKGlover
Copy link
Author

@jasonmccallister I've done all of the steps provided on the tutorial you shared, as well as manually disabled Internet Sharing via Services and set it to disabled on startup. Unfortunately I am still unable to access my site for local dev. :(

@jasonmccallister
Copy link
Contributor

@DouglasKGlover did you reboot the host machine to apply those changes?

@jasonmccallister jasonmccallister self-assigned this Jul 1, 2020
@DouglasKGlover
Copy link
Author

I did, yes. I'll note that the following from a user (goraxan) on Discord worked for me:

@doug same here (in Windows). IP changes every time I reboot. So what I do is: nitro stop; nitro start; nitro info (change .env database DSN with the new IP); nitro apply (this changes the hosts file with the new IP)

Is there any way to prevent the machine from acquiring a new IP on Windows reboot? Not sure if this would be a Nitro or a Multipass thing, but seems directly tied to the Nitro machine itself as far as I can tell.

@jasonmccallister
Copy link
Contributor

@DouglasKGlover there is a hidden command called nitro hosts that will read the IP address of the machine and clean the hosts file. It will not touch the hosts.iscl file though.

This issue is somewhat related to multipass but the real issue is the network manager on windows hypervisors. I worked through this with someone else on windows, I will check if they are still having the issue after disabling internet sharing.

@delixyr
Copy link

delixyr commented Jul 15, 2020

@jasonmccallister The issue still persists. Guess the issue is with Windows hyper-v default switch or corrupted hosts.ics file.
As we had discussed I had followed this article too
Troubleshooting Canonical's Multipass on Windows 10 Pro

This has been addressed here as well

@jasonmccallister
Copy link
Contributor

@delixyr this is a Windows related issue and the next release will resolve this.

@jasonmccallister jasonmccallister added this to the next milestone Dec 14, 2020
@jasonmccallister
Copy link
Contributor

@delixyr by next release, I really mean't v2 where we replaced Multipass with Docker. Here are the instructions for upgrading, Windows 10 is still a WIP... but mostly for WSL2 and Docker setup.. https://craftcms.com/docs/nitro/2.x/

@jasonmccallister jasonmccallister removed this from the v2 milestone Feb 5, 2021
@jasonmccallister
Copy link
Contributor

We just released Nitro 2 where we switched from Multipass to Docker and added a ton of new features. Please see the announcement for more details.

This issue was specific to Multipass so we are going to close this out. Please see the documentation on upgrading from Nitro 1.

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

3 participants