Skip to content

Commit d8de6be

Browse files
Merge pull request #35 from JuliaCI/ib/debug_win_no_reboot
Debug no windows reboot issue
1 parent f15c1a1 commit d8de6be

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

hooks/environment.agent

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,21 @@ trap "cleanup_secrets" EXIT
7272
AGENT_PRIVATE_KEY_PATH="${SECRETS_MOUNT_POINT}/agent.key"
7373
AGENT_PUBLIC_KEY_PATH="${SECRETS_MOUNT_POINT}/agent.pub"
7474
if [[ ! -f "${AGENT_PRIVATE_KEY_PATH}" ]]; then
75-
die "Unable to open agent private key path '${AGENT_PRIVATE_KEY_PATH}'! Make sure your agent has this file deployed within it!"
75+
echo "Unable to open agent private key path '${AGENT_PRIVATE_KEY_PATH}'! Make sure your agent has this file deployed within it!"
76+
echo "NOTE: This is a known bug where this agent is old, caused by the agent not restarting after a previous job."
77+
echo "see https://github.com/JuliaCI/sandboxed-buildkite-agent/issues/42"
78+
echo "Showing debug information..."
79+
powershell.exe -Command "& {
80+
\$providers = @('nssm', 'User32');
81+
foreach (\$provider in \$providers) {
82+
Write-Host \"\`n ProviderName: \$provider\`n\";
83+
Get-WinEvent -LogName Application -FilterXPath \"*[System[Provider[@Name='\$provider']]]\" -MaxEvents 50 |
84+
Sort-Object TimeCreated |
85+
Select-Object TimeCreated, Id, LevelDisplayName, Message |
86+
Format-Table -AutoSize
87+
}
88+
}"
89+
exit 1
7690
else
7791
if ! openssl rsa -inform PEM -in "${AGENT_PRIVATE_KEY_PATH}" -noout 2>/dev/null; then
7892
die "Secret private key path '${AGENT_PRIVATE_KEY_PATH}' is not a valid private RSA key!"

0 commit comments

Comments
 (0)