Troubleshooting Windows
Troubleshoot issues in Windows PE installations, such as failed installations, failed upgrades, problems applying manifests, and other issues.
If you are experiencing failures when installing or upgrading agents, refer to Installation fails and Upgrade fails.
If manifests are failing to be applied, or are being applied incorrectly, refer to Errors when applying a manifest or doing a Puppet agent run.
For other issues, refer to the Error messages reference. You might need to enable temporary Logging and debugging.
Installation fails
Check for these issues if Puppet agent installation fails on a Windows node.
The installation package isn't accessible
.msi
or .exe
package must be a file on either:- A local filesystem
- A network mapped drive
- A UNC path
RI-based installation sources aren't supported, but you can achieve a similar result by defining a file whose source is the primary server, and then defining a package whose source is the local file.
Installation wasn't attempted with admin privileges
Installing thePuppet agent requires elevated privileges, such as being logged in as the Administrator or running commands in an Administrator command prompt or PowerShell window.
- Agent installation fails when trying to perform an unattended installation from the command line.
- You get a norestart message.
- The installation logs indicate that installation is forbidden by system policy.
Upgrade fails
The Puppet agent .msi
package overwrites existing entries in the puppet.conf
file. If you upgrade
or reinstall the agent with a different primary server hostname, Puppet applies the new value in
$confdir\puppet.conf
file.
When you upgrade a Windows agent, you must use the same primary server hostname that you specified when you originally installed the agent.
For information on configuring puppet.conf
and which
settings are preserved during upgrades, refer to MSI properties.
Errors when applying a manifest or doing a Puppet agent run
If your manifests aren't applied, or are applied incorrectly, on Windows nodes, check for these issues.
Path or file separators are incorrect
For Windows nodes, path separators must use a
semi-colon (;
).
File separators must use forward slashes or backslashes, depending on the attribute. In most resource attributes, the Puppet language accepts either forward slashes or backslashes as the file separator. However, some attributes absolutely require forward slashes, and some attributes absolutely require backslashes.
"
). When single-quoted ('
), escaping is
optional. For example, these are all valid file
resources:file { 'c:\path\to\file.txt': }
file { 'c:\\path\\to\\file.txt': }
file { "c:\\path\\to\\file.txt": }
However file { "c:\path\to\file.txt": }
is an invalid
path, because \p
, \t
, and \f
are
interpreted as escape sequences.
- Learn about Files and paths in the Puppet language on Windows in the Puppet documentation.
- Learn about Windows modifications when Using example commands that you find in the PE documentation.
Cases are inconsistent
Several resources are case-insensitive on Windows, like files, users, groups. However, these resources can be case sensitive in Puppet.
ALEX
and alex
are the same
user:file { 'c:\foo\bar':
ensure => directory,
owner => 'ALEX'
}
user { 'alex':
ensure => present
}
...
err: /Stage[main]//File[c:\foo\bar]: Could not evaluate: Could not find user ALEX
Shell built-ins are not executed
Puppet doesn't support a shell provider on Windows, so executing shell built-ins directly fails.
cmd.exe
to wrap the
built-in:exec { 'cmd.exe /c echo foo':
path => 'c:\windows\system32;c:\windows'
}
PowerShell scripts are not executed
By default, PowerShell enforces a restricted execution policy that prevents executing scripts.
exec { 'test':
command => 'powershell.exe -executionpolicy remotesigned -file C:\test.ps1',
path => $::path
}
Services are referenced by display names instead of short names
Windows services support a short name and a display name, but Puppet uses only short names.
Verify that your Puppet manifests use the short names,
such as wuauserv
instead of Automatic Updates
.
Error messages
These are some error messages you might encounter when using Puppet on Windows nodes.
- Forge connection or SSL certificate errors
- Errors include Could not connect via HTTPS to https://forge.puppet.com,
Unable to verify the SSL certificate,
The certificate may not be signed by a valid CA
, and The CA bundle included with OpenSSL may not be valid or up to date. - Service 'Puppet Agent' (
puppet
) failed to start. Verify that you have sufficient privileges to start system services. - This error occurs when installing Puppet on a UAC system from a non-elevated account. Although the installer displays the UAC prompt to install Puppet, it does not elevate privileges when trying to start the service.
- Cannot run on Microsoft Windows without the <GEM_NAME> gem.
- This error occurs if you attempt to run Windows without required gems.
- /Stage[main]//Scheduled_task[task_system]: Could not evaluate: The operation completed successfully.
- This error occurs when the task scheduler gem has a version earlier than 0.2.1.
- /Stage[main]//Exec[C:/tmp/<FILE_NAME>.exe]/returns: change from notrun to 0 failed: CreateProcess() failed: Access is denied.
- This error occurs when a request for an executable on a remote primary server can't be executed.
- getaddrinfo: The storage control blocks were destroyed.
- This error occurs when the agent can't resolve a DNS name into an IP address or if the agent has an incorrect reverse DNS entry.
- Could not request certificate: The certificate retrieved from the primary does not match the agent's private key.
- This error can occur if the agent is running in two different security contexts or if the agent's SSL directory is deleted after it retrieves a certificate from the primary server.
- Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed. This is often because the time is out of sync on the server or client.
- This error occurs when time on the Windows agents isn't synchronized.
- Could not parse for environment production: Syntax error at
'=';
expected'}'
- This error occurs if you run
puppet apply -e
from the command line, and the supplied command is surrounded with single quotes ('
). The single quotes causecmd.exe
to interpret any rocket hash (=>
) in the command as a redirect.
Logging and debugging
The Windows Event Log can be helpful when troubleshooting issues with Windows nodes.
--debug
and --trace
messages to the Windows Event Log, run this command to
stop and restart the Puppet service:
c:\>sc stop puppet && sc start puppet --debug --trace