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
Copy file name to clipboardExpand all lines: doc/100-General/10-Changelog.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
17
17
*[#362](https://github.com/Icinga/icinga-powershell-framework/issues/362) Fixes repository component installation from file share locations
18
18
*[#363](https://github.com/Icinga/icinga-powershell-framework/issues/363) Fixes unneeded continue for JEA process lookup, in case no JEA pid is present
19
19
*[#365](https://github.com/Icinga/icinga-powershell-framework/issues/365) Fixes Icinga environment corruption on Icinga Agent installation failure
20
+
*[#366](https://github.com/Icinga/icinga-powershell-framework/issues/366) Fixes error handling with Icinga Director over IMC, by printing more detailed and user-friendly error messages
$ErrorMessage='Failed to fetch configuration for host over Self-Service API with key "{0}". This error mostly occurs in case the host object itself is not defined as "Icinga2 Agent" object inside the Icinga Director.';
52
+
break;
53
+
};
54
+
404 {
55
+
$ErrorMessage='Failed to fetch configuration for host over Self-Service API with key "{0}". Probably the assigned host/template key is not valid or your Icinga Director Url is invalid "{1}".';
56
+
break;
57
+
};
58
+
901 {
59
+
$ErrorMessage='Failed to fetch host/template configuration from Icinga Director Self-Service API because of SSL/TLS error. Please ensure the certificate is valid and use "Enable-IcingaUntrustedCertificateValidation" for self-signed certificates or install the certificate on this machine.';
60
+
break;
61
+
}
62
+
Default {
63
+
$ErrorMessage= ([string]::Format('Failed to fetch host/template configuration from Icinga Director Self-Service API because of unhandled exception: {0}',$response.StatusCode));
$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API. Please check that your Icinga Director Url "{1}" is valid and the provided API key "{0}" belongs to a Icinga host object.';
52
+
break;
53
+
};
54
+
500 {
55
+
$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API. Please check that your Icinga CA is running, you have configured a Ticketsalt and that your Icinga Director has enough permissions to communicate with the Icinga 2 API for generating tickets.';
56
+
break;
57
+
};
58
+
901 {
59
+
$ErrorMessage='Failed to fetch certificate ticket for this host over Self-Service API because of SSL/TLS error. Please ensure the certificate is valid and use "Enable-IcingaUntrustedCertificateValidation" for self-signed certificates or install the certificate on this machine.';
60
+
break;
61
+
}
62
+
Default {
63
+
$ErrorMessage= ([string]::Format('Failed to fetch certificate ticket from Icinga Director because of unhandled exception: {0}',$response.StatusCode));
Write-IcingaConsoleWarning'Failed to register host inside Icinga Director. The host is probably already registered.'
76
+
return$null;
77
+
};
78
+
404 {
79
+
$ErrorMessage='Failed to register host with the given API key "{0}" inside Icinga Director. Please ensure the template key you are using is correct and the template is set as "Icinga2 Agent" object. Non-Agent templates will not work over the Self-Service API.';
80
+
break;
81
+
};
82
+
901 {
83
+
$ErrorMessage='Failed to register host over Self-Service API inside Icinga Director because of SSL/TLS error. Please ensure the certificate is valid and use "Enable-IcingaUntrustedCertificateValidation" for self-signed certificates or install the certificate on this machine.';
84
+
break;
85
+
}
86
+
Default {
87
+
$ErrorMessage= ([string]::Format('Failed to register host inside Icinga Director because of unhandled exception: {0}',$response.StatusCode));
if ([string]::IsNullOrEmpty($SelfServiceAPIKey) -eq$FALSE) {
99
+
break;
100
+
} else {
101
+
$RegisterFailed=$TRUE;
102
+
}
97
103
} catch {
104
+
$RegisterFailed=$TRUE;
105
+
}
106
+
107
+
if ($RegisterFailed) {
98
108
$SelfServiceAPIKey= (Get-IcingaAgentInstallerAnswerInput-Prompt ([string]::Format('Failed to register host within Icinga Director. Full error: "{0}". Please re-enter your SelfService API Key. If this prompt continues ensure you are using an Agent template or drop your host key at "Hosts -> {1} -> Agent"',$_.Exception.Message, (Get-IcingaHostname@Arguments))) -Default 'v'-DefaultInput $SelfServiceAPIKey).answer;
Copy file name to clipboardExpand all lines: lib/core/installer/Start-IcingaForWindowsInstallation.psm1
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,18 @@ function Start-IcingaForWindowsInstallation()
4
4
[switch]$Automated
5
5
);
6
6
7
-
if ((Get-IcingaFrameworkDebugMode) -eq$FALSE) {
7
+
if ($global:Icinga.InstallWizard.DirectorInstallError-eq$FALSE-And(Get-IcingaFrameworkDebugMode) -eq$FALSE) {
8
8
Clear-Host;
9
9
}
10
10
11
11
Write-IcingaConsoleNotice'Starting Icinga for Windows installation';
12
12
13
+
if ($global:Icinga.InstallWizard.DirectorInstallError) {
14
+
Write-IcingaConsoleError'Failed to start Icinga for Windows installation, caused by an error while communicating with Icinga Director: {0}'-Objects $global:Icinga.InstallWizard.DirectorError;
Write-IcingaConsoleNotice'No local Api key was found and using your provided template key failed. Please ensure the host is not already registered and drop the set Self-Service key within the Icinga Director for this host.'
$global:Icinga.InstallWizard.LastError='Failed to fetch host configuration with the given Director Url and Self-Service key. Please ensure the template key is correct and in case a previous host key was used, that it matches the one configured within the Icinga Director. In case this form was loaded previously with a key, it might be that the host key is no longer valid and requires to be dropped. In addition please ensure that this host can connect to the Icinga Director and the SSL certificate is trusted. Otherwise run "Enable-IcingaUntrustedCertificateValidation" before starting the management console. Otherwise modify the "DirectorSelfServiceKey" configuration element above with the correct key and try again.';
78
+
$global:Icinga.InstallWizard.LastError='Failed to fetch host configuration with the given Director Url and Self-Service key. Please ensure the template key is correct and in case a previous host key was used, that it matches the one configured within the Icinga Director. In case this form was loaded previously with a key, it might be that the host key is no longer valid and requires to be dropped. In addition please ensure that this host can connect to the Icinga Director and the SSL certificate is trusted. Otherwise run "Enable-IcingaUntrustedCertificateValidation" before starting the management console. Otherwise modify the "DirectorSelfServiceKey" configuration element above with the correct key and try again.';
0 commit comments