Skip to content

Add failing MaintainedApp name to sql error message #37896

@TsekNet

Description

@TsekNet

Problem

#37670 changed docker/darwin to docker-desktop/darwin and broke our CI.

The error MaintainedApp was not found in the datastore is not useful, as it does not identify which app was not found in the datastore, leaving the Fleet admin to try and find what changed recently.

[+] syncing XX policies
[+] syncing XX queries
[+] applying MDM profiles for team XX
[+] applying XX software packages for team XX
Error: applying software installers for team "XX": Resource Not Found: MaintainedApp was not found in the datastore

Potential solutions

Update

func (e *NotFoundError) Error() string {
if e.ID != 0 {
return fmt.Sprintf("%s %d was not found in the datastore", e.ResourceType, e.ID)
}
if e.Name != "" {
return fmt.Sprintf("%s %s was not found in the datastore", e.ResourceType, e.Name)
}
if e.Message != "" {
return fmt.Sprintf("%s %s was not found in the datastore", e.ResourceType, e.Message)
}
return fmt.Sprintf("%s was not found in the datastore", e.ResourceType)
}
to include the name of the app that was not found, not just say MaintainedApp.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    #g-softwareSoftware product group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions