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

minikube not added to PATH: installer uses setx.exe which runcates PATHs longer than 1024 chars #2587

Closed
mmckenz opened this issue Mar 3, 2018 · 12 comments · Fixed by #4362
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. os/windows packaging/windows Windows packaging issues priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. r/2019q2 Issue was last reviewed 2019q2

Comments

@mmckenz
Copy link

mmckenz commented Mar 3, 2018

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

Please provide the following details:

Environment:

Minikube version (use minikube version): v0.25.0

  • OS (e.g. from /etc/os-release): Windows 10 Enterprise
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyperv
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): minikube-v0.25.1.iso
  • Install tools: Windows Installer
  • Others:
    The above can be generated in one go with the following commands (can be copied and pasted directly into your terminal):
minikube version
echo "";
echo "OS:";
cat /etc/os-release
echo "";
echo "VM driver": 
grep DriverName ~/.minikube/machines/minikube/config.json
echo "";
echo "ISO version";
grep -i ISO ~/.minikube/machines/minikube/config.json

What happened: Installed minikube using the Windows Installer. The update_path.bat script used setx.exe to add minikube's installation path to my system PATH variable. My system PATH is over 1024 chars long so setx.exe destructively truncated it. I had to restore my system PATH from registry backups.

What you expected to happen: minikube is installed without destructively changing my system PATH.

How to reproduce it (as minimally and precisely as possible): Start with a system PATH environment variable > 1024 chars. Run the minikube Windows installer.

Output of minikube logs (if applicable): N/A

Anything else do we need to know: N/A

@r2d4 r2d4 added kind/bug Categorizes issue or PR as related to a bug. os/windows labels Mar 5, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 3, 2018
@mmckenz
Copy link
Author

mmckenz commented Jun 12, 2018

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 12, 2018
@stefanjarina
Copy link

Same happened to me:

Minikube version: 0.28.2

  • OS: Windows 10 Pro 1803 (OS build 17134.228)
  • VM Driver: Hyper-V

I use a PATH in windows that is rather modular, e.g.:

PATH = C:\Windows;C:\Windows\system32;%PATH_TOOLS_MS%;%PATH_TOOLS_HW;%PATH_TOOLS_CODE%
PATH_TOOLS_MS = C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64;
PATH_TOOLS_HW = C:\Program Files\Razer Chroma SDK\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Intel\iCLS Client\;
PATH_TOOLS_CODE = C:\Python37-32\Scripts\;C:\Python37-32\;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\PuTTY\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\erl9.2\bin;C:\Program Files (x86)\Elixir\bin;C:\Program Files\heroku\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files\Microsoft VS Code\bin;D:\Programy\ngrok;C:\vagrant\bin;C:\PostgreSQL\pg10\bin;E:\Programy\kotlin-compiler-1.2.61\kotlinc\bin;C:\Go\bin;C:\Program Files\MariaDB 10.3\bin;C:\kubernetes\minikube\bin;

etc. This is basically to avoid PATH longer than 4096 characters which is not working on Windows...

After running the minikube-installer.exe I spent some time debugging why my system is not working properly only to discover in huge shock that it efectivelly destroyed my PATH and it converted it to something like:

PATH = C:\Windows;C:\Windows\system32;C:\Python37-32\Scripts\;C:\Python37-32\;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\PuTTY\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\R

Didn't even add minikube installation into PATH.
It also removed the references to variables (%PATH_TOOLS_***%) as an addition to truncating part of my PATH, so it seems it first extends the PATH to it's full form, then truncate it (WHAT???)

If I wouldn't have PATH split into smaller variables, installer would wipe 3/4 of my PATH and I would have to play with registries to fix it...
Thankfully for me it only destroyed the variable references and thus I was able to reconstruct PATH easily...

@stefanjarina
Copy link

/remove-lifecycle stale

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 12, 2019
@tstromberg tstromberg changed the title Windows installer uses setx.exe to update PATH which destructively truncates PATHs longer than 1024 chars minikube not added to PATH: installer uses setx.exe which runcates PATHs longer than 1024 chars Jan 24, 2019
@tstromberg tstromberg added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. packaging/windows Windows packaging issues priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 24, 2019
@tstromberg
Copy link
Contributor

AFAIK, this is still an issue. I'd be happy to approve any PR's which fix the behavior though. Help wanted!

@tstromberg
Copy link
Contributor

tstromberg commented Jan 24, 2019

Some more context:

https://superuser.com/questions/387619/overcoming-the-1024-character-limit-with-setx

The file that needs to be modified within minikube is installers/windows/update_path.bat. It's unclear which approach is the most sane one, as they all seem to require an additional dependency.

@Vaskinn
Copy link

Vaskinn commented Jan 25, 2019

A good temporary fix, probably without introducing dependencies, would be to detect when the path will be to long, and not try to set it but instead show instructions on what to add manually to the path.
That will prevent the installer from destroying the system of people that have a long path.

@ssargent
Copy link

ssargent commented Apr 2, 2019

Is this still a thing? I know as of 0.35 it was, but was this fixed in 1.0.0? I didn't use the installer for that. Would it be possible to use powershell for this on windows? I'm not sure if that gets around the problem somehow, or if that falls under the category of additional dependencies. But I'm happy to look into it if that's possibly in play.

@tstromberg
Copy link
Contributor

@ssargent - Yes, this is still a thing that exists. Patches are very welcome for this issue. Let me know if I can help in any way.

@blueelvis
Copy link
Contributor

@tstromberg - I will pick this up. Instead of using a Batch file for Windows, cannot we incorporate a PowerShell file? PowerShell is installed on all systems by default from Windows 7+

Also, I couldn't find any documentation on the minimum requirement of Windows Operating System for Minikube (I believe it is Windows 8+ as per here. There is a line which says that).

Additionally, I couldn't find any documentation on how the installers are generated?

@tstromberg tstromberg added the r/2019q2 Issue was last reviewed 2019q2 label May 22, 2019
@tstromberg
Copy link
Contributor

@blueelvis - Thanks! My preference would be to continue to support Windows 7 and higher if possible.

https://github.com/kubernetes/minikube/tree/master/installers/windows contains the code used in the installer.

https://github.com/kubernetes/minikube/blob/master/Makefile#L288 shows the steps used to make the installer.

I very much look forward to your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. os/windows packaging/windows Windows packaging issues priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. r/2019q2 Issue was last reviewed 2019q2
Projects
None yet
9 participants