BIG-RAT / jamfcpr

Replicate packages between Jamf Pro Servers
Apache License 2.0
76 stars 3 forks source link

jamfcpr 4.0.2 is showing us less than half of the packages in the GUI #21

Closed randomName0815 closed 5 months ago

randomName0815 commented 6 months ago

Hi, jamfcpr 4.0.2 is showing us less than half of the packages in the GUI. In the log, the JSON looks complete and it starts loading the metadata until it can't talk to the server anymore.

First try with User+PW :

20240206_165708 [JamfPro.getToken] Generate token for source server: https://XYZ.jamfcloud.com 20240206_165709 [JamfPro.getToken] Use existing token from Optional(https://XYZ.jamfcloud.com/api/v1/auth/token) 20240206_165709 [endPointByID] Response: nil. ken for source server: https://XYZ.jamfcloud.com 20240206_165709 [JamfPro.getToken] Use existing token from Optional(https://XYZ.jamfcloud.com/api/v1/auth/token) 20240206_165709 [endPointByID] Issue communicating with the https://XYZ.jamfcloud.com. 20240206_165709 [endPointByID] Response: nil. 20240206_165709 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2651 20240206_165709 [endPointByID] Issue communicating with the https://XYZ.jamfcloud.com. 20240206_165709 [endPointByID] Response: nil. 20240206_165709 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 41 20240206_165709 [endPointByID] Issue communicating with the https://XYZ.jamfcloud.com. 20240206_165709 [endPointByID] Response: nil.

and so on, this is written for all packages, which are of course not displayed in the GUI afterwards.

Second try with API Client:

20240206_175218 [JamfPro.getToken] Generate token for source server: https://XYZ.jamfcloud.com 20240206_175218 [ApiAction.getPackages] looking up: JustAnotherPackage.pkg d.com/JSSResource/packages/id/2067 pi/oauth/token) 20240206_175218 [JamfPro.getToken] Generate token for source server: https://XYZ.jamfcloud.com 20240206_175218 [endPointByID] fetching XML from: https://XYZ.jamfcloud.com/JSSResource/packages/id/2518 pi/oauth/token) 20240206_175218 [JamfPro.getToken] Generate token for source server: https://XYZ.jamfcloud.com 20240206_175218 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com ://XYZ.jamfcloud.com/api/oauth/token) 20240206_175218 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175219 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175219 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175219 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175219 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com

... literally over 500 times ...

20240206_175301 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175301 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175302 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175302 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175302 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175302 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240206_175350 [JamfPro.getToken] token response error from https://XYZ.jamfcloud.com. Verify url and port 20240206_175350 [endPointByID] Unable to get valid token. 20240206_175350 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 1963 20240206_175351 [JamfPro.getToken] token response error from https://XYZ.jamfcloud.com. Verify url and port 20240206_175351 [endPointByID] Unable to get valid token. 20240206_175351 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2510 20240206_175400 [JamfPro.getToken] token response error from https://XYZ.jamfcloud.com. Verify url and port 20240206_175400 [endPointByID] Unable to get valid token. 20240206_175400 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2639

During the API Client try I also got a "...verify url and port" dialog in the GUI in a continuous loop and had to close it forced. The packages mentioned at the end of the log look completely normal and are in use, assume it is output incorrectly due to the previous issues.

btw. there is another report that sounds similar, but I could not identify from the information whether it is the same problem https://github.com/BIG-RAT/jamfcpr/issues/18

Tested with: JamfCPR 4.0.2 Jamf Pro Cloud Prod Instance with 11.1.1 (it´s not one of the sandbox Instances from my other open Issue)

BIG-RAT commented 6 months ago

v4.1.0 (corrected) addresses some API Client issues. See if it helps with yours.

randomName0815 commented 6 months ago

probably meant v4.1.0 , unfortunately unchanged with this behavior.

but i had a new issue and had to use 4.0.2 to add the server again because i couldn't do it in 4.1.0. when i enter everything in the "New Server:" dialog in v4.1.0 and click connect a token is created in the log, but the dialog does not close and the server is not saved in the list. I also noticed that "API Client" is checked when opening the dialog, but it shows "Username" and "Password". After unchecking and checking "API Client" it is displayed correctly.

BIG-RAT commented 6 months ago

Nice catch on the use API client button - thanks. Do you have your JCDS set as principal (Settings - Server - Cloud distribution point)? Still seeing the token response errors?

randomName0815 commented 6 months ago

yes it is set as principal. i see no response error in the v4.1.0 log, but also no other errors, just again this after some hundred packages:

... 20240214_163846 [ApiAction.getPackages] looking up: ASUPERNICEPACKAGE.pkg d.com/JSSResource/packages/id/2067 20240214_163846 [JamfPro.getToken] Attempting to retrieve token from Optional(https://XYZ.jamfcloud.com/api/oauth/token) 20240214_163846 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com urce/packages/id/2518 20240214_163846 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163846 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163846 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com

    ... several hundred times later ...

20240214_163913 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163913 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163913 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163913 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2571 20240214_163913 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2715 20240214_163913 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2649

    ... several hundred times later ...

20240214_163926 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 1701 20240214_163926 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2523 20240214_163926 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 1324 20240214_163926 [JamfPro.getToken] new token created for https://XYZ.jamfcloud.com 20240214_163929 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 1689 20240214_163929 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2084 20240214_163929 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 189

    ... several hundred times later ...

20240214_163944 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2507 20240214_163944 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2656 20240214_163944 [ApiAction.getPackages] Found package record missing the filename in xml. Package id: 2116 20240214_163945 [ViewController.reloadFileList] source: https://XYZ.jamfcloud.com 20240214_163945 [ViewController.reloadFileList] display packages from source JCDS ...

BIG-RAT commented 6 months ago

Thanks for the details. I need to figure out why there is one attempt to get a token: 20240214_163846 [JamfPro.getToken] Attempting to retrieve token from Optional(https://xyz.jamfcloud.com/api/oauth/token)

but hundreds of new tokens created:

20240214_163846 [JamfPro.getToken] new token created for https://xyz.jamfcloud.com/
20240214_163846 [JamfPro.getToken] new token created for https://xyz.jamfcloud.com/

Or are there many more attempts to retrieve a token, just removed from your post.

randomName0815 commented 6 months ago

no, i have only shortened where there was no change in the output (except date and package id).

I just see more attempts to get a token, earlier in the log, where it looks pretty normal, I think... ...now that i think about it, it doesn't look so normal... if i see correctly, it requests a new token for each access, while it should still have a valid one, if i understand the log correctly. token lifetime is on default

20240214_165723 [endPointByID] fetching XML from: https://XYZ.jamfcloud.com/JSSResource/packages/id/2487 20240214_165723 [JamfPro.getToken] Attempting to retrieve token from Optional(https://XYZ.jamfcloud.com/api/oauth/token) 20240214_165723 [ApiAction.getPackages] looking up: ANOTHERNICEPACKAGE.pkg d/2567 20240214_165723 [JamfPro.getToken] Attempting to retrieve token from Optional(https://XYZ.jamfcloud.com/api/oauth/token) 20240214_165723 [endPointByID] fetching XML from: https://XYZ.jamfcloud.com/JSSResource/packages/id/2593 20240214_165723 [endPointByID] endpoint passed to endPointByID: packages/id/2667 ps://XYZ.jamfcloud.com/api/oauth/token) 20240214_165723 [endPointByID] fetching XML from: https://XYZ.jamfcloud.com/JSSResource/packages/id/2667 20240214_165723 [JamfPro.getToken] Attempting to retrieve token from Optional(https://XYZ.jamfcloud.com/api/oauth/token) 20240214_165724 [ApiAction.getPackages] looking up: ANDANOTHERNICEPACKAGE.pkg

BIG-RAT commented 6 months ago

Give the following a try as time permits: https://github.com/BIG-RAT/jamfcpr/releases/download/v4.1.1-b1/jamfcpr_4.1.1-b1.zip

I was able to transfer 400+ packages without issue.

randomName0815 commented 6 months ago

What has changed in the log is that a token is only requested at the beginning and no more attempts. But now no packages are listed in the gui anymore and again hundreds of "Found package record missing the filename in xml. Package id:" in the log - apparently now for every package. Maybe you know that already, but I wanted to mention it, it starts these messages when it has already gone through all packages in alphabetical order (as listed in json format in the log). I had just realized that all these "record missing" ID's are from packages that he had already processed.

I have run a sync with jamf admin into a local folder to make sure that we don't have a problem in general and have looked at some xml's via api for anomalies... but nothing

if it's ok for you, i would send you a complete log in macadmins slack next week, maybe it will help to narrow down

BIG-RAT commented 6 months ago

Reading my mind - you can find me as lnh_slack.

BIG-RAT commented 5 months ago

v4.1.1 has been posted. Please re-open the issue if the behavior persists.