Skip to content
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

Fix: Repository error handling and JSON error handling #709

Merged

Conversation

LordHepipud
Copy link
Collaborator

@LordHepipud LordHepipud commented Apr 1, 2024

Fixes error handling for Icinga for Windows repositories by providing more details about occurring errors as well as properly checking the JSON-File for the repository and providing more details about JSON errors

Example:

PS> Update-Icinga;

[Error]: Failed to parse JSON object. Exception: Invalid object passed in, ':' or '}' expected. (907)
{
    "Info":  {
                 "Name":  "testing",
                 "LocalSource":  "C:\\icinga\\",
                 "RemoteSource":  "C:\\icinga\\",
                 "Created":  "2024/04/01 16:35:03",
                 "Updated":  "2024/04/01 14:37:45",
                 "RepoHash":  "07916547F4427F8D6F8893BF340C199EA3D484A92D810FE1D5C5B4E4D8D84884"
             },
    "Packages":  {
                     "agent":  [
                                   {
                                       "Hash":  "145B70227DCB8C19489B47B06B89E3BEA52657647238FFD871A07E68B06D5F70",
                                       "Location":  "agent/Icinga2-v2.11.10-x86_64.msi",
                                       "RelativePath":  true,
                                       "Version":  "2.11.10",
                                       "Snapshot":  false

                                         ^^^^^^^^^^^^^^^^^
[Error]: Failed to convert retreived content from repository "testing" with location "C:\icinga\" to JSON
[Error]: The remote host "https://icinga.example.com" send an exception response "900": "The remote name could not be resolved: 'icinga.example.com'"
[Notice]: Unable to fetch Icinga for Windows repository information for repository "linux test" from provided location. Trying different lookup by adding "ifw.repo.json" to the end of the remote path.
[Error]: The remote host "https://icinga.example.com/ifw.repo.json" send an exception response "900": "The remote name could not be resolved: 'icinga.example.com'"
[Error]: Unable to fetch data for repository "linux test" from any configured location
[Notice]: The installed version "1.13.0" of component "framework" is identical or lower than the new version "1.12.0". Use "-Force" to install anyway
[Notice]: The installed version "1.6.0" of component "mssql" is identical or lower than the new version "1.5.0". Use "-Force" to install anyway
[Notice]: No update package found for component "kickstart"
[Notice]: The installed version "1.3.0" of component "hyperv" is identical or lower than the new version "1.3.0". Use "-Force" to install anyway
[Notice]: The installed version "1.3.0" of component "inventory" is identical or lower than the new version "1.2.0". Use "-Force" to install anyway
[Notice]: The installed version "1.4.0" of component "cluster" is identical or lower than the new version "1.3.0". Use "-Force" to install anyway
[Notice]: The installed version "1.12.0" of component "plugins" is identical or lower than the new version "1.12.0". Use "-Force" to install anyway

@cla-bot cla-bot bot added the cla/signed label Apr 1, 2024
@LordHepipud LordHepipud self-assigned this Apr 1, 2024
@LordHepipud LordHepipud added the Bug There is an issue present label Apr 1, 2024
@LordHepipud LordHepipud added this to the v1.12.1 milestone Apr 1, 2024
@LordHepipud LordHepipud force-pushed the fix/icinga_for_windows_repository_error_handling branch from c5cf58b to 64c42bd Compare April 1, 2024 16:45
@LordHepipud LordHepipud force-pushed the fix/icinga_for_windows_repository_error_handling branch from 64c42bd to a2294b3 Compare April 9, 2024 16:02
@LordHepipud LordHepipud merged commit 2ad90a9 into master Apr 9, 2024
1 check passed
@LordHepipud LordHepipud deleted the fix/icinga_for_windows_repository_error_handling branch April 9, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug There is an issue present cla/signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant