The dreaded "Uh-oh! Could not update hosts file" in macOS 15.4 beta

What issue or error are you experiencing?

I am getting the dreaded “Uh-oh! Could not update hosts file” message.

The thing is, it was all working fine until yesterday. I have rosetta installed. I have some *NIX chops, so I’m able to make my way around on the command line, just for information

So, here’s where this is possibly (probably?) just an edge case:

I have a beta operating system installed, one that is due out either this or next month, Sequoia 15.4. I am imagining (duh?) this could be causing my issue, but I just wanted to get some feedback if possible. It just seems a little strange to me that this would be the issue if all it is trying to do is update the /etc/hosts file which it was able to do without a problem up until now. I also realize this may be a completely naive statement. :grin: I updated to the beta within the last week, and i do not believe I tried to create another site until yesterday (fairly sure).

Any thoughts about this are appreciated, if only to tell me I get what I deserve for installing a beta (normally I wouldn’t, but the update to Apple Mail was at the heart of my reasoning). I realize the easy answer is the beta, but I’m trying to get a slightly more nuanced answer, if possible, as to why something that seems as simple as that would be impacted by the beta.

I uninstalled and reinstalled Local by wiping out all the files in ~/Library/Application/Support/Local (I actually saved it on my desktop) and started fresh. I don’t really care about any of the sites I created as they were only for practice, but I saved the old Local folder from my home directory just in case. I have uploaded the new log from today and the old log which still remained in the ~/Library/Logs.

Also, I’m wondering if there’s a workaround, such as manually editing the /etc/hosts file. Please let me know and thanks.

Thank you,

Michael


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

Every time I try to create a site, I get this error. It is trying to get me to switch the the http://localost:, which I could do, but I’m hopeful there’s an answer or workaround.


System Details

  • Local Version:

  • 9.2.2

  • Operating System (OS) and OS version:

  • M2 Pro, 16GB RAM, 1TB HD

Sequoia 15.4 (beta)

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

local-lightning-verbose.log (36.1 KB)


local-lightning-verbose.log (1.0 MB)


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

There is one more alert I got while trying to create a site. Local doesn’t seem to have the admin privileges to write to the /etc/hosts file. I’m not sure if everyone else was getting this message when encountering this problem, but I thought I’d include a screenshot.

Thanks for this report, @michl!

It does seems specific to macOS 15.4 — we had an earlier report here:

Workarounds so far are the ones you mention: switch router mode to localhost in Local’s preferences, or update your /etc/hosts manually.

We have a ticket to look into this but don’t have a technical explanation without further research yet. (Local should open an auth dialog box after the “host redirection” message you mentioned to ask for your password to write to /etc/hosts. That prompt applet is provided by a dependency and isn’t launching under macOS 15.4 beta, which is what we plan to investigate.)

1 Like

Ok, so I’m not crazy. Thank you! I probably need to change the default URLs in the database to make this work properly after manually editing the hosts file, correct?

Quick update: After updating the /etc/hosts file with the appropriate entries and changing the URL in the database, I’m getting to the site just fine. I’m still getting a message about local being unable to modify the /etc/hosts file, not sure why. Perhaps local just likes to have permission to modify that file in general? Anyway, the workaround is currently working. Looking forward to a fix for the issue, whenever that happens.

1 Like

Thanks for the update, @michl — glad you’re able to work around this for now.

We’ll reply or offer an update if needed when we’ve looked into this issue with macOS 15.4.

2 Likes

Thanks, much appreciated!

1 Like

I think the issue is solved in Sequoia 15.4 Beta 2. Just updated to it. Tested creating a new site in Local and no error and hosts files gets updated. No more work around or changing /Preferences/Advanced/Router Mode to localhost, you can keep the default Site domain option.

3 Likes

Yay! I’m backing up and about to update. Great news. Thanks for reporting that.

Happy to report it worked for me too. Thanks for the tip. I think the key for me is probably to stay away from developer betas and stick to the public ones, but I really wanted that Mail categorization functionality. It really helps me get through my email more effectively. I was using Outlook for its “Focused” inbox but I found it lacking in so many other ways I was dying to ditch it. Anyway, thanks!

1 Like

Thank you for following up here @michl and @KeithOx! Glad things are working normally again :green_heart:

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.