macadmins / macadmins/jamf-pro-sdk-python

[Bug] Bizarre 409 error when updating a static group using a string value for the computer ID.

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
69
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Steps to Reproduce
client.classic_api.update_static_computer_group_membership_by_id(1, computers_to_add=["1"])
Expected Result

The computer is added. The underlying code should be casting the string value to an integer. The Pydantic model exports the correct XML document if the provided value is a string or an integer.

Actual Result

Debug logging to the console:

[ERROR] HTTPError: 409 Client Error:  for url: https//XXXXXXXXXX/JSSResource/computergroups/id/1
Error: Unable to match computer

I think this is an encoding issue with the XML and Jamf is throwing an incorrect error.

When looking up a computer using the Pro API that returns the id as a string value. Passing this directly to the static group update call surfaced the error.

System Information

jamf-pro-sdk 0.3a1
Jamf Pro 10.48.2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with client.classic_api.update_static_computer_group_membership_by_id, using the reproduction with computers_to_add=["1"] as the first check. Compare the behavior for a string and integer computer ID, then add regression coverage and verify that the computer is added without the 409 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.