jamf / JamfMigrator

A tool to migrate data granularly between Jamf Pro servers
MIT License
143 stars 10 forks source link

jamf migrator Status Code: 401 on v7.4.1 #101

Open Edgecrusherr160 opened 8 months ago

Edgecrusherr160 commented 8 months ago

I just updated to version v7.4.1, and get "jamf migrator Status Code: 401" on any account I use as the source (destination would probably fail if I could get that far). Rolling back to the v7.4.0 resolves the error.

BIG-RAT commented 8 months ago

If you're able, launch the app from Terminal to enable debug mode: /Applications/jamf-migrator.app/Contents/MacOS/jamf-migrator -debug

Then pass along (the redacted) log.

BIG-RAT commented 8 months ago

v7.4.2 should have the issue resolved. Let me know how it works for you, as time permits.

mikem011 commented 8 months ago

I just downloaded v7.4.2 and am still getting the same error. Here the export of the log:

[Credentials.itemLookup] start search for: jamf-migrator-apiClient- [Credentials.itemLookup] lookup error occurred for jamf-migrator-apiClient-: -25300 [Credentials.itemLookup] start search for: jamf-migrator-apiClient- [Credentials.itemLookup] lookup error occurred for jamf-migrator-apiClient-: -25300 2024-01-30 07:24:08.462 jamf-migrator[11457:5450134] Warning: Column selection is not supported in view-based table and outline views (<NSTableView: 0x13e83fa00>). [Credentials.itemLookup] start search for: jamf-migrator-apiClient- [Credentials.itemLookup] lookup error occurred for jamf-migrator-apiClient-: -25300 [Credentials.itemLookup] start search for: jamf-migrator-apiClient- [Credentials.itemLookup] lookup error occurred for jamf-migrator-apiClient-: -25300 [Credentials.itemLookup] start search for: jamf-migrator-apiClient- [Credentials.itemLookup] lookup error occurred for jamf-migrator-apiClient-: -25300 [sectionToMigrate] goSender: selectToMigrateButton [JamfPro] source received a new token [ViewController.go] JamfProServer.storeSourceCreds: 0 [JamfPro] dest received a new token [ViewController.go] JamfProServer.storeDestCreds: 0

dankudos commented 4 months ago

Seeing 401s here as well. Debug log attached with URLs changed to protect the paycheck.

20240508_213923 [- debug -] ----- Debug Mode ----- 20240508_213923 [- debug -] jamf-migrator Version: 7.4.2 Build: 20240124-802 20240508_213931 [- debug -] func sectionToMigrate active tab: macOS. 20240508_213931 [- debug -] Selectively migrating: ["restrictedsoftware"] for NSUserInterfaceItemIdentifier(_rawValue: macOS) 20240508_213931 [- debug -] Start Migrating/Removal 20240508_213931 [- debug -] Migrating data from https://OnPremJamfServer to https://ours.jamfcloud.com. 20240508_213931 [- debug -] [ViewController.Go] go sender: selectToMigrateButton 20240508_213931 [- debug -] [ViewController.Go] Go button pressed from: selectToMigrateButton 20240508_213931 [- debug -] [ViewController.activeTab] Active tab caller: Go - activeTab: selective 20240508_213931 [- debug -] [ViewController.Go] Migration Mode (Go): selective 20240508_213931 [- debug -] [checkURL2] --- checking availability of server: https://OnPremJamfServer 20240508_213931 [- debug -] [checkURL2] checking: https://OnPremJamfServer 20240508_213931 [- debug -] [checkURL2] --- checking healthCheck page. 20240508_213932 [- debug -] [checkURL2] Server check: https://OnPremJamfServer/healthCheck.html, httpResponse: 200 20240508_213932 [- debug -] [checkURL2] checkURL2 data: [] 20240508_213932 [- debug -] [checkURL2] --- checking availability of server: https://ours.jamfcloud.com 20240508_213932 [- debug -] [checkURL2] checking: https://ours.jamfcloud.com 20240508_213932 [- debug -] [checkURL2] --- checking healthCheck page. 20240508_213932 [- debug -] [checkURL2] Server check: https://ours.jamfcloud.com/healthCheck.html, httpResponse: 200 20240508_213932 [- debug -] [checkURL2] checkURL2 data: [] 20240508_213932 [- debug -] [go] Using API client/secret to generate token for OnPremJamfServer. 20240508_213932 [- debug -] [JamfPro.getToken] Token for source server is 0 minutes old. 20240508_213932 [- debug -] [JamfPro.getToken] Attempting to retrieve token from https://OnPremJamfServer/api/oauth/token 20240508_213933 [- debug -] [JamfPro.getToken] new token created for source: https://OnPremJamfServer 20240508_213933 [- debug -] [Jpapi.action] Attempting GET on https://OnPremJamfServer/api/v1/jamf-pro-version. 20240508_213933 [- debug -] [Jpapi.action] Data retrieved from https://OnPremJamfServer/api/v1/jamf-pro-version. 20240508_213933 [- debug -] [JamfPro.getVersion] source Jamf Pro Version: 11.4.2-t1713554080 20240508_213933 [- debug -] [JamfPro.getVersion] https://OnPremJamfServer set to use Bearer Token 20240508_213933 [- debug -] [go] Using API client/secret to generate token for ours.jamfcloud.com. 20240508_213933 [- debug -] [JamfPro.getToken] Token for dest server is 0 minutes old. 20240508_213933 [- debug -] [JamfPro.getToken] Attempting to retrieve token from https://ours.jamfcloud.com/api/oauth/token 20240508_213934 [- debug -] [JamfPro.getToken] new token created for dest: https://ours.jamfcloud.com 20240508_213934 [- debug -] [Jpapi.action] Attempting GET on https://ours.jamfcloud.com/api/v1/jamf-pro-version. 20240508_213934 [- debug -] [Jpapi.action] set cookie (name:value) jpro-ingress:33fd935279750b6b for ours.jamfcloud.com 20240508_213934 [- debug -] [Jpapi.action] Data retrieved from https://ours.jamfcloud.com/api/v1/jamf-pro-version. 20240508_213934 [- debug -] [JamfPro.getVersion] dest Jamf Pro Version: 11.4.2-t1713554080 20240508_213934 [- debug -] [JamfPro.getVersion] https://ours.jamfcloud.com set to use Bearer Token 20240508_213934 [- debug -] [Jpapi.action] Attempting GET on https://ours.jamfcloud.com/api/v1/csa/token. 20240508_213935 [- debug -] [Jpapi.action] Response error: 403. 20240508_213935 [- debug -] call startMigrating(). 20240508_213935 [- debug -] [ViewController.startMigrating] enter 20240508_213935 [- debug -] [ViewController.startMigrating] Start Migrating/Removal 20240508_213935 [- debug -] [ViewController.startMigrating] platform: macOS. 20240508_213935 [- debug -] [ViewController.startMigrating] Migration Mode (startMigration): selective. 20240508_213935 [- debug -] [ViewController.startMigrating] objects: ["restrictedsoftware"]. 20240508_213935 [- debug -] ----------- Starting Migration ----------- 20240508_213935 [- debug -] [ViewController.startMigrating] migrating/removing 1 sections 20240508_213935 [- debug -] [ViewController.startMigrating] Starting to process restrictedsoftware 20240508_213935 [- debug -] [ViewController.startMigrating] getting endpoint: restrictedsoftware 20240508_213935 [- debug -] [ViewController.readNodes] enter search for restrictedsoftware 20240508_213935 [- debug -] [ViewController.readNodes] getting endpoint: restrictedsoftware 20240508_213935 [- debug -] [ViewController.readNodes] set access permissions to file:///Users/HB32806/Documents/jamf migrator export/ 20240508_213935 [- debug -] [ViewController.getEndpoints] enter 20240508_213935 [- debug -] [ViewController.getEndpoints] Getting restrictedsoftware 20240508_213935 [- debug -] [ViewController.getEndpoints] URL: https://OnPremJamfServer/JSSResource/restrictedsoftware 20240508_213935 [- debug -] [ViewController.getEndpoints] Getting all endpoints from: https://OnPremJamfServer/JSSResource/restrictedsoftware 20240508_213935 [- debug -] [ViewController.getEndpoints] endpointJSON: ["restricted_software": <__NSArrayI 0x600002803f90>( { id = 4; name = "Title 1"; }, { id = 5; name = Title2; }, { id = 3; name = Title3; } ) ]) 20240508_213935 [- debug -] [ViewController.getEndpoints] Initial count for restrictedsoftware found: 3 20240508_213935 [- debug -] [ViewController.getEndpoints] Verify empty dictionary of objects - availableObjsToMigDict count: 0 20240508_213935 [- debug -] [existingEndpoints] enter - destination endpoint: restrictedsoftware 20240508_213935 [- debug -] [ViewController.activeTab] Active tab caller: existingEndpoints - activeTab: selective 20240508_213935 [- debug -] [existingEndpoints] endpointDependencyArray: ["restrictedsoftware"] 20240508_213935 [- debug -] [ViewController.readNodes] getEndpoints result: ["Got endpoint - restrictedsoftware", "3"] 20240508_213935 [- debug -] [ViewController.readNodes] exit 20240508_213935 [- debug -] [ViewController.activeTab] Active tab caller: readNodes - activeTab: selective 20240508_213944 [- debug -] [existingEndpoints] current endpoint dict: [:] 20240508_213944 [- debug -] [existingEndpoints] clearing existing current endpoints: restrictedsoftware 20240508_213944 [- debug -] [ViewController.readNodes] getEndpoints result: ["migration stopped", "0"] 20240508_213944 [- debug -] [ViewController.readNodes] exit 20240508_213944 [- debug -] [ViewController.activeTab] Active tab caller: readNodes - activeTab: selective 20240508_214059 [- debug -] [JamfPro.getToken] Token for source server is 1 minutes old. 20240508_214059 [- debug -] [JamfPro.getToken] Attempting to retrieve token from https://OnPremJamfServer/api/oauth/token 20240508_214059 [- debug -] [JamfPro.getToken] new token created for source: https://OnPremJamfServer 20240508_214059 [- debug -] [Jpapi.action] Attempting POST on https://OnPremJamfServer/api/v1/auth/invalidate-token. 20240508_214100 [- debug -] [Jpapi.action] Response error: 401. 20240508_214100 [- debug -] source server token task: failed 20240508_214100 [- debug -] [JamfPro.getToken] Token for dest server is 1 minutes old. 20240508_214100 [- debug -] [JamfPro.getToken] Attempting to retrieve token from https://ours.jamfcloud.com/api/oauth/token 20240508_214101 [- debug -] [JamfPro.getToken] new token created for dest: https://ours.jamfcloud.com 20240508_214101 [- debug -] [Jpapi.action] Attempting POST on https://ours.jamfcloud.com/api/v1/auth/invalidate-token. 20240508_214101 [- debug -] [Jpapi.action] Response error: 401. 20240508_214101 [- debug -] destination server token task: failed

jmahlman commented 4 months ago

I too am seeing this issue on 7.4.2 (Jamf Pro version 11.4.1). Here is my redacted log:

20240604_083556 [- debug -] ----- Debug Mode -----
20240604_083556 [- debug -] jamf-migrator Version: 7.4.2 Build: 20240124-802
20240604_083602 [- debug -] func sectionToMigrate active tab: general.
20240604_083602 [- debug -] Selectively migrating: ["advancedusersearches"] for NSUserInterfaceItemIdentifier(_rawValue: general)
20240604_083602 [- debug -] Start Migrating/Removal
20240604_083602 [- debug -] Migrating data from https://mdmserver.com:8443/ to https://mdmserverQA.com:8443/.
20240604_083602 [- debug -] [ViewController.Go] go sender: selectToMigrateButton
20240604_083602 [- debug -] [ViewController.Go] Go button pressed from: selectToMigrateButton
20240604_083602 [- debug -] [ViewController.activeTab] Active tab caller: Go - activeTab: selective
20240604_083602 [- debug -] [ViewController.Go] Migration Mode (Go): selective
20240604_083602 [- debug -] [checkURL2] --- checking availability of server: https://mdmserver.com:8443/
20240604_083602 [- debug -] [checkURL2] checking: https://mdmserver.com:8443/
20240604_083602 [- debug -] [checkURL2] --- checking healthCheck page.
20240604_083602 [- debug -] [checkURL2] Server check: https://mdmserver.com:8443/healthCheck.html, httpResponse: 200
20240604_083602 [- debug -] [checkURL2]
checkURL2 data: []
20240604_083602 [- debug -] [checkURL2] --- checking availability of server: https://mdmserverQA.com:8443/
20240604_083602 [- debug -] [checkURL2] checking: https://mdmserverQA.com:8443/
20240604_083602 [- debug -] [checkURL2] --- checking healthCheck page.
20240604_083602 [- debug -] [checkURL2] Server check: https://mdmserverQA.com:8443/healthCheck.html, httpResponse: 200
20240604_083602 [- debug -] [checkURL2] checkURL2 data: []
20240604_083602 [- debug -] [go] Using API client/secret to generate token for mdmserver.com.
20240604_083602 [- debug -] [JamfPro.getToken] Token for source server is 0 minutes old.
20240604_083602 [- debug -] [JamfPro.getToken] Attempting to retrieve token from https://mdmserver.com:8443/api/oauth/token
20240604_083603 [- debug -] [JamfPro.getToken] Failed to authenticate to https://mdmserver.com:8443/.  Response error: 401.
20240604_083608 [- debug -] Source server authentication failure.
20240604_083629 [- debug -] source server token task: no valid token found
20240604_083629 [- debug -] destination server token task: no valid token found

Here are my permissions for the API Role: Screenshot 2024-06-04 at 8 38 28 AM

Using basic auth works fine.