Open megascus opened 4 months ago
Hmmmmm.... this is weird. Multiple sections are created:
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
# Added by CRC
# End of CRC section
@megascus Has the file been modified before with notepad? Perhaps the codepage got changed, as the findCrcSection
code seems to fail.
@gbraad Yes. I made changes in a text editor. At that time, I added 127.0.0.1 localhost".
Also, I just tried with a blank hosts file(0byte) and the result was the same.(same hosts, same error)
I checked the character encoding with the text editor and it appears that the result's hosts file does not contain any characters other than UTF-8.
does not contain any characters other than UTF-8.
Hmmm... snce you're on a non-ASCII/English version of Windows I might think the file got wrongly interpreted, as this has been observed before with GB2312 as codepage.
What if the file gets recreated (no file)? If still the same, we can completely exclude this.
I tried with no hosts file.
In that case, the error was: Error running post start: host file not writable, try running with elevated privileges
Also, additional information, as of March I have successfully installed. (The version of OpenShift Local was 4.14.2, although the version of CRC is unknown.)
Error running post start: host file not writable, try running with elevated privileges
Interesting... kinda like expected, but also unfortunate we can not resolve this ;-)
Also, additional information, as of March I have successfully installed.
So this has worked before?????!??? hmmmmm...
Did you install any other software, like antivirus since then?
The error comes from a process called win32-admin-helper
that is part of CRC to allow a regular user to write to this file.
We haven't changed anything recently in this process, so asking @anjannath if he has some clues.
I remembered that I installed PowerToys. It has the ability to change the hosts file. I don't have time today so I will uninstall and try it later.
Interesting... it could be that this tool keeps a lock on the file and reorders (will have to test), but in that case I think other tools would also be affected.
https://github.com/microsoft/PowerToys/tree/main/src/modules/Hosts/Hosts
Did the tool run during the time you were using CRC?
I am not a huge fan of bloat, and PowerToys have always been this since Windows 9x. The newer tools felt no different... and even more so it seems:
It feels a lot more is kept on in the background, and might cause issues. We will have a look at this, as this might be the case. However, a simple "Disable" for the Hosts File Editor on your end would be a simpel test too that would not need Uninstall.
I have successfully installed it.
I uninstalled PowerToys and rebooted. And then I could install it.
Thank you for your cooperation. It seems difficult to determine the cause, but as information sharing.
hosts file is as following (from 0 byte). https://gist.github.com/megascus/f8573c754e6a37901d38248f1916d06f
(It did not work well with just DISABLED. Thanks.)
https://github.com/microsoft/PowerToys/tree/main/src/modules/Hosts/Hosts
Did the tool run during the time you were using CRC?
No, it didn't. However, PowerToys seems to change the permissions on the hosts file. When I uninstalled PowerToys, it asked for UAC when changing the hosts file, otherwise UAC was not required.
I am satisfied because my immediate problem has been solved. Please close this ticket if necessary.
General information
crc setup
before starting it (Yes/No)? -> YesCRC version
CRC status
CRC config
Host Operating System
Steps to reproduce
Expected
OpenShift Local could start.
Actual
OpenShift Local could not start. And, "crc start" deleted existing section, like "127.0.0.1 localhost" Error message: Error running post start: can't add CRC section, check hosts file
Logs
Before gather the logs try following if that fix your issue
Please consider posting the output of
crc start --log-level debug
on http://gist.github.com/ and post the link in the issue. https://gist.github.com/megascus/b0caac285a5b0854a0118ed62a94e82ehosts: https://gist.github.com/megascus/9916cf196a61638a89a321fe42632aaa