GitOps: Relative path fails when adding custom setup profile to unassigned.yml
Fleet versions
- Discovered: v4.85.0
- Reproduced: v4.85.O
💥 Actual behavior
When adding a custom DEP profile to unassigned.yml, the GitOps action fails with the following error:
Error: applying fleet config: open ../lib/macos/enrollment-profiles/automatic-enrollment.dep.json: no such file or directory
Confirmed that the file path is correct, this is the structure of the relevant portions of the repo:
lib
| default.yml
| macos
| enrollment-profiles
| automatic-enrollment.dep.json
fleets
| unassigned.yml
| workstations.yml
default.yml
unassigned.yaml:
name: Unassigned
policies:
queries:
agent_options:
path: ../lib/agent-options.yml
controls:
setup_experience:
apple_setup_assistant: ../lib/macos/enrollment-profiles/automatic-enrollment.dep.json
software:
workstations.yml:
name: Workstations
policies:
queries:
agent_options:
path: ../lib/agent-options.yml
controls:
setup_experience:
apple_setup_assistant: ../lib/macos/enrollment-profiles/automatic-enrollment.dep.json
team_settings:
secrets:
- secret: "$FLEET_WORKSTATIONS_ENROLL_SECRET"
software:
When controls.setup_experience.apple_setup_assistant is removed from unassigned.yml, the GitOps action completes successfully and the profile is applied to the Workstations team.
Updating the path defined in unassigned.yml to be relative to the root directory also succeeds, and the profile is applied to Unassigned as well as to Workstations:
name: Unassigned
policies:
queries:
agent_options:
path: ../lib/agent-options.yml
controls:
setup_experience:
apple_setup_assistant: ./lib/macos/enrollment-profiles/automatic-enrollment.dep.json
software:
🛠️ Expected behavior
All relative paths defined in usassigned.yml should resolve from the fleets folder(or otherwise, the folder the file is actually in) rather than from the root of the repository.
🧑💻 Steps to reproduce
These steps:
- [ x] 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.
- Create a GitOps setup using the details listed above
- Run the GitOps action
🕯️ More info (optional)
N/A
I've tested and confirmed that this same behavior is also impacting path references to organization logos (specifically reproduced the behavior on org_logo_path_dark_mode and org_logo_path_light_mode).
Customer thread: https://fleetdm.slack.com/archives/C09QZ73USMB/p1780438500101809?thread_ts=1780322205.782759&cid=C09QZ73USMB
Reproduction (4.85.1)
- Relative
controls.setup_experience.apple_setup_assistant: ../lib/...inunassigned.ymlfails with the exact reported error:Error: applying fleet config: open ../lib/macos/enrollment-profiles/automatic-enrollment.dep.json: no such file or directory - The documented workaround (
./lib/...) succeeds, and removing the key succeeds
Verified fix - relative paths resolve from the authoring file
-
../lib/...inunassigned.ymlresolves from the file's own directory (fleets/) and applies cleanly, as the issue requested -
Confirmed it re-anchors rather than suppresses: pointing at a genuinely missing file still fails, and the error path is now resolved under the no-team file's dir (
.../gitops/lib/...), not the repo root -
Deprecated
no-team.ymlname resolves correctly. -
- Applying
org_settingsrelative to the nested file successful (pulled in viapath:). Tested EULA upload:mdm.end_user_license_agreement: ./eula.pdf.
- Applying
-
macos_setuppaths inunassigned.yml(setup_experience.script) resolve. -
No double-anchoring: parse-time paths (
controls.scripts,*_settingsprofiles) still resolve when combined with the now-absolute apply-time paths in the same file
Path's relative journey, Fleet unites, no file lost, Clouds clear, work's not tossed.