Skip to content

FMAs with categories not available in older versions of Fleet fail to add #38254

@allenhouchins

Description

@allenhouchins

Fleet version: 4.78 and older

Web browser and operating system: Any


💥  Actual behavior

Recently we added two new software categories: Security and Utilities

If a Fleet-maintained app has one of these categories as its default category, it will fail to add on versions of Fleet prior to when these categories were introduced.

When categories are validated (error occurs)
The validation happens in AddFleetMaintainedApp() (lines 167-177 in ee/server/service/maintained_apps.go), which is called when:

  • A user clicks the "Add" button in the UI to add a maintained app to their team
  • The POST /api/latest/fleet/software/fleet_maintained_apps API endpoint is called

Summary:

  • Users can browse and view maintained apps without errors, even if they have "Security" or "Utilities" categories
  • The error only occurs when they try to add the app to their team
  • At that point, the code validates that all categories exist in the database, and if "Security" or "Utilities" don't exist, it returns: "some or all of the categories provided don't exist"
  • So the app will appear in the list and be viewable, but adding it will fail until those categories exist in the database.

🛠️ To fix

Allow the app to be added with no category if the default category doesn't exist.

🧑‍💻  Steps to reproduce

These steps:

  • Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  • Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
  1. Use an FMA that has a default category of Security or Utilities on a build of Fleet prior to 4.79.

🕯️ More info (optional)

I made this mess, I will attempt to clean it up.

This may continue to be an issue in the future if we determine additional categories need to be made so it is in our best interest to come up with a permanent fix like the one proposed in the To fix section above.

Metadata

Metadata

Labels

#g-softwareSoftware product group:releaseReady to write code. Scheduled in a release. See "Making changes" in handbook.P2Urgent: Supported workflow not functioning as intended, newly drafted feature with urgent Fleet needbugSomething isn't working as documented~assisting qaThis issue can be QA'd by anyone outside the QA team when capacity allows~released bugThis bug was found in a stable release.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions