You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS Version: Windows 10 Pro version 1909 build 18363.1016
VSCode Version: 1.48.2 (user setup)
Puppet Extension Version: 0.28.0
PDK Version: 1.18.1
What You Are Seeing?
When editing files in repos with spaces in the path, the laguage server fails with the following error in Puppet output:
#<Thread:0x000000000682e578@c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:38 run> terminated with exception (report_on_exception is true):
c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/manifest/validation_provider.rb:48:in `chdir': Invalid argument @ dir_chdir - 'd:\Dropbox\Projects\Systems\puppet control' (Errno::EINVAL)
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/manifest/validation_provider.rb:48:in `validate'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:100:in `validate'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:137:in `block in worker'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:116:in `loop'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:116:in `worker'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:40:in `block in enqueue'
This causes linting to fail, so no code problems are shown for the workspace in Puppet files, while they are shown for other types of file.
Additionally, hovering over Puppet code whether there are spaces in the path or not, gives the following error in Log (Extension Host):
[2020-09-10 15:58:46.541] [exthost] [error] TypeError: Cannot read property 'kind' of null
at asHoverContent (c:\Users\Iain\.vscode\extensions\puppet.puppet-vscode-0.28.0\node_modules\vscode-languageclient\lib\protocolConverter.js:101:27)
at asHover (c:\Users\Iain\.vscode\extensions\puppet.puppet-vscode-0.28.0\node_modules\vscode-languageclient\lib\protocolConverter.js:134:31)
I think this may be a diversion from the main issue, though, as these hover errors are shown whether the language server fails or not.
What is Expected?
The language server should cope with spaces in the path to the files.
How Did You Get This To Happen? (Steps to Reproduce)
Tried with multiple repos, and a new module from PDK:
pdk new module test_module
Right-click in test_module folder, Open with Code.
Create file manifests/init.pp with the content class test_module {} - Problems shows 1 warning, "class not documented".
Close VS Code.
Rename the folder from test_module to test module, Open with Code again.
Open init.pp - no problems are shown. Ctrl-Shift-U and switch to Puppet - shows the EINVAL error.
I verified this with test paths:
D:\Dropbox\Projects\Systems\puppet control = error, linting fails to show problems
D:\Dropbox\Projects\Systems\puppet-control = no error, linting shows problems when they are written
D:\Test = no error, linting shows problems when they are written
D:\Puppet control = error, linting fails to show problems
D:\Puppet-control = no error, linting shows problems when they are written
D:\test module = error, linting fails to show problems
D:\test_module = no error, linting shows problems when they are written
C:\test module = error, linting fails to show problems
C:\test_module = no error, linting shows problems when they are written
I've uninstalled VS Code, and reinstalled it for my user, and uninstalled puppet-vscode (and deleted the puppet-vscode folder from extensions) then reinstalled that. No change.
Output Log
Puppet Output pane:
DEBUG: 2020-09-10T15:05:55.491Z Installation type has changed from auto to pdk
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkNewModule command
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkValidate command
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkTestUnit command
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkNewClass command
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkNewTask command
DEBUG: 2020-09-10T15:05:55.493Z Registered extension.pdkNewDefinedType command
DEBUG: 2020-09-10T15:05:55.494Z Found a valid Puppet installation at C:\Program Files\Puppet Labs\DevelopmentKit\puppet
DEBUG: 2020-09-10T15:05:55.494Z Setting status bar to Initializing
DEBUG: 2020-09-10T15:05:55.495Z Configuring language client options
DEBUG: 2020-09-10T15:05:55.495Z Creating server options
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable DEVKIT_BASEDIR=C:\Program Files\Puppet Labs\DevelopmentKit
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable GEM_HOME=C:\Program Files\Puppet Labs\DevelopmentKit\share\cache\ruby\2.5.0
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable GEM_PATH=C:\Program Files\Puppet Labs\DevelopmentKit\private\ruby\2.5.8\lib\ruby\gems\2.5.0;C:\Program Files\Puppet Labs\DevelopmentKit\share\cache\ruby\2.5.0;C:\Program Files\Puppet Labs\DevelopmentKit\private\puppet\ruby\2.5.0
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable RUBY_DIR=C:\Program Files\Puppet Labs\DevelopmentKit\private\ruby\2.5.8
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable RUBYLIB=C:/Program Files/Puppet Labs/DevelopmentKit/lib;
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable PATH=C:\Program Files\Puppet Labs\DevelopmentKit\bin;C:\Program Files\Puppet Labs\DevelopmentKit\private\ruby\2.5.8\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\php\7.4;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\Vagrant\bin;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\Iain\AppData\Local\Microsoft\WindowsApps;C:\Users\Iain\AppData\Roaming\Composer\vendor\bin;C:\Users\Iain\AppData\Roaming\npm;C:\Users\Iain\AppData\Local\Programs\Microsoft VS Code\bin
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Using environment variable RUBYOPT=rubygems
DEBUG: 2020-09-10T15:05:55.496Z [getRubyEnvFromPDK] Editor Services will invoke with: C:\Program Files\Puppet Labs\DevelopmentKit\private\ruby\2.5.8\bin\ruby c:\Users\Iain\.vscode\extensions\puppet.puppet-vscode-0.28.0\vendor\languageserver\puppet-languageserver --stdio --timeout=10 --local-workspace='d:\test module' --debug=D:\Puppet-log.txt
DEBUG: 2020-09-10T15:05:55.496Z Creating language client
DEBUG: 2020-09-10T15:05:55.501Z Setting status bar to Initialization Complete
DEBUG: 2020-09-10T15:05:55.501Z Configuring Local::stdio connection handler
DEBUG: 2020-09-10T15:05:55.501Z Setting status bar to Starting languageserver
DEBUG: 2020-09-10T15:05:55.502Z Registered Format Document provider
DEBUG: 2020-09-10T15:05:55.503Z Registered command for node graph event handler
DEBUG: 2020-09-10T15:05:55.503Z Registered onDidSaveTextDocument for node graph event handler
DEBUG: 2020-09-10T15:05:55.503Z Registered DebugAdapterDescriptorFactory for Puppet
DEBUG: 2020-09-10T15:05:55.503Z Registered DebugConfigurationProvider for Puppet
DEBUG: 2020-09-10T15:05:56.494Z pdk shell started, pid: 49892
DEBUG: 2020-09-10T15:06:32.592Z Setting status bar to Loading Puppet
#<Thread:0x0000000006ae07a8@c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:38 run> terminated with exception (report_on_exception is true):
c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/manifest/validation_provider.rb:48:in `chdir': Invalid argument @ dir_chdir - 'd:\test module' (Errno::EINVAL)
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/manifest/validation_provider.rb:48:in `validate'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:100:in `validate'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:137:in `block in worker'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:116:in `loop'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:116:in `worker'
from c:/Users/Iain/.vscode/extensions/puppet.puppet-vscode-0.28.0/vendor/languageserver/lib/puppet-languageserver/validation_queue.rb:40:in `block in enqueue'
DEBUG: 2020-09-10T15:06:34.700Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:35.349Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:36.229Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:36.847Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:37.735Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:38.852Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:39.777Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:40.865Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:41.756Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:42.859Z Setting status bar to 6.17.0
DEBUG: 2020-09-10T15:06:43.914Z Setting status bar to 6.17.0
Thank you for the detailed report @iainhallam! I agree that the language server should be able to handle spaces in paths, so we will investigate where in the manifest validator that is breaking.
In general I advise to not use spaces in Puppet module folder names or Puppet control repos going forward. Its against style guidelines for Puppet modules and is invalid when publishing to the forge, and I believe its against conventions with control repos. It will cause problems with other tooling than the VS Code extension, so it's best to adjust when you can rather than later.
Agree with the spaces in names thing, I was trying to reduce the issue to the barest minimum to reproduce it. I don't put spaces in names inside the control repo anywhere, or in my modules, but I do think that it's likely that people check out their repo, as I do, on a variety of machines where the path outside the control repo might have spaces in. That's what originally triggered my finding the issue here.
What Versions are you running?
OS Version: Windows 10 Pro version 1909 build 18363.1016
VSCode Version: 1.48.2 (user setup)
Puppet Extension Version: 0.28.0
PDK Version: 1.18.1
What You Are Seeing?
When editing files in repos with spaces in the path, the laguage server fails with the following error in Puppet output:
This causes linting to fail, so no code problems are shown for the workspace in Puppet files, while they are shown for other types of file.
Additionally, hovering over Puppet code whether there are spaces in the path or not, gives the following error in Log (Extension Host):
I think this may be a diversion from the main issue, though, as these hover errors are shown whether the language server fails or not.
What is Expected?
The language server should cope with spaces in the path to the files.
How Did You Get This To Happen? (Steps to Reproduce)
Tried with multiple repos, and a new module from PDK:
pdk new module test_module
test_module
folder, Open with Code.manifests/init.pp
with the contentclass test_module {}
- Problems shows 1 warning, "class not documented".test_module
totest module
, Open with Code again.init.pp
- no problems are shown. Ctrl-Shift-U and switch to Puppet - shows the EINVAL error.I verified this with test paths:
D:\Dropbox\Projects\Systems\puppet control
= error, linting fails to show problemsD:\Dropbox\Projects\Systems\puppet-control
= no error, linting shows problems when they are writtenD:\Test
= no error, linting shows problems when they are writtenD:\Puppet control
= error, linting fails to show problemsD:\Puppet-control
= no error, linting shows problems when they are writtenD:\test module
= error, linting fails to show problemsD:\test_module
= no error, linting shows problems when they are writtenC:\test module
= error, linting fails to show problemsC:\test_module
= no error, linting shows problems when they are writtenI've uninstalled VS Code, and reinstalled it for my user, and uninstalled puppet-vscode (and deleted the puppet-vscode folder from extensions) then reinstalled that. No change.
Output Log
Puppet Output pane:
Debug log:
The text was updated successfully, but these errors were encountered: