gravitational/teleport · error

unexpected jamf version string: %q

Error message

unexpected jamf version string: %q

What it means

getJamfBinaryVersion parses the output of 'jamf version' (e.g. 'version=10.46.1-t1683911857'); this error fires when the trimmed output does not match the expected 'version=...' pattern, so the version cannot be extracted. A missing jamf binary is handled separately and is not an error.

Source

Thrown at lib/devicetrust/native/device_darwin.go:195

	// See https://learn.jamf.com/bundle/jamf-pro-documentation-current/page/Components_Installed_on_Managed_Computers.html
	cmd := exec.Command("/usr/local/bin/jamf", "version")
	out, err := cmd.Output()
	if err != nil {
		// Jamf binary may not exist. This is alright.
		pathErr := &fs.PathError{}
		if errors.As(err, &pathErr) {
			slog.DebugContext(context.Background(), "Device Trust: Jamf binary not found", "binary_path", pathErr.Path)
			return "", nil
		}

		return "", trace.Wrap(err, "running jamf version")
	}

	// Eg: "version=10.46.1-t1683911857"
	s := string(bytes.TrimSpace(out))
	tmp := strings.Split(s, "=")
	if len(tmp) != 2 {
		return "", fmt.Errorf("unexpected jamf version string: %q", s)
	}

	return tmp[1], nil
}

func getMacosEnrollmentProfiles() (string, error) {
	cmd := exec.Command("/usr/bin/profiles", "status", "-type", "enrollment")
	out, err := cmd.Output()
	if err != nil {
		return "", trace.Wrap(err, "running /usr/bin/profiles status -type enrollment")
	}
	return string(bytes.TrimSpace(out)), nil
}

func signChallenge(chal []byte) (sig []byte, err error) {
	h := sha256.Sum256(chal)
	digC := C.Digest{
		data:     (*C.uint8_t)(C.CBytes(h[:])),

View on GitHub (pinned to 1283425b60)

Solutions

  1. Check the jamf binary version output manually (/usr/local/bin/jamf version) to see its actual format
  2. Upgrade jamf to a version with the standard output format
  3. Report the unexpected format to Teleport if jamf changed its output
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/devicetrust/native/device_darwin.go:195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02). Data as JSON: /api/errors/94ac0daa5b7087fd. Report an issue: GitHub.