-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Invalid Vagrantfile path and error line number reported, error reporting inconsistent #11022
Comments
OK, thank you for the information @briancain. Good to hear the fix is on its way :) BTW similar issue (#6445) also has been reported and fixed about 4 years ago. |
…for windows Prior to this commit, vagrant was not grabbing all of the tokens on Windows for showing the full drive because the ruby api for it behaves differenly on windows compared to other platforms. This commit changes that by ensuring the letter drive is attached to the path when showing an exception.
…ions Prior to this commit, if there was a config error inside a provider block, Vagrant wouldn't grab the right backtrace token on windows since the api is different for ruby on Windows compared to all other platforms. This commit ensures that the proper line number is chosen so the error message is correct.
…ions Prior to this commit, if there was a config error inside a provider block, Vagrant wouldn't grab the right backtrace token on windows since the api is different for ruby on Windows compared to all other platforms. This commit ensures that the proper line number is chosen so the error message is correct.
* commit '9eac6ae62d6ad7acdd173fabe558ba75156245b6': Update CHANGELOG Update CHANGELOG Try to mock up docker version subprocess result in test Add vagrantfile mock to iso_env machine Add vagrantfile double for environment class Add allow for docker driver execute method Add machine config to machine double for rspec tests Remove virtualbox context from docker tests providers/docker: Fix usability check Remove platform require since it is no longer required in file Simplify line and path checks for exception handling in config loading Fixes hashicorp#11022: Ensure correct line is used for windows exceptions Fixes hashicorp#11022: Show proper path & letter drive on exceptions for windows
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Vagrant is reporting errors in
Vagrantfile
inconsistently and in some cases, theVagrantfile
path and the error line number are reported wrong.Vagrant version
2.2.5 (64-bit)
Host operating system
Windows 7 Ultimate 64-bit
Vagrantfile
I have tested 4 different contents of the
Vagrantfile
. All of them contain an error of using an undefined variable or a syntax error, each time in a different scope, each time producing different (and in 2 cases wrong)Vagrantfile
path and error line number report.Case 1
Case 2
Case 3
Case 4
Expected behavior
Both the
Vagrantfile
path and the error line number are properly reported and ideally in the same format.Actual behavior
Case 1
In this case, both the
Vagrantfile
path and the error line number are properly reported:Case 2
In this case, the error line number is reported right, but
Vagrantfile
path is not:Case 3
In this case, both the
Vagrantfile
path and the error line number seems to be wrong. The path looks like a code block specification where the error occurred and the error line number contains a brokenVagrantfile
path (the proper path would beD:/work/memsource/vagrant/Vagrantfile
as reported in the Case 1):Case 4
This time, both
Vagrantfile
path and the error line number are right, but together with the error message, they're reported differently:Steps to reproduce
vagrant status
in the same directoryThe text was updated successfully, but these errors were encountered: