Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Token Found issue #169

Open
Shaun-RDP opened this issue Sep 10, 2024 · 8 comments
Open

No Token Found issue #169

Shaun-RDP opened this issue Sep 10, 2024 · 8 comments
Assignees
Labels
question Further information is requested by the person who opened the issue

Comments

@Shaun-RDP
Copy link

I am getting the below error on all .Jamf recipies. Non .Jamf recipies download as usual. I have tried removing the affected overrides as well as Updating the Trust info, with no change.
Error: No token found, cannot continue

When I searched the logs I found this error.
JamfCategoryUploader: ERROR: No token received

This issue started Aug. 23rd., I just have not had the time to troubleshoot. Below is the error I get everytime the AutoPkgr runs.

This is the output from my webhook.

The following failures occurred:
local.RDP.jamf.MicrosoftOffice365
local.RDP.jamf.Firefox
local.RDP.jamf.VLC
local.RDP.jamf.Python3
local.RDP.jamf.MicrosoftAutoUpdate
local.RDP.jamf.JabraDirect
local.RDP.jamf.GIMP
The following errors occurred:
No token found, cannot continue Failed.
No token found, cannot continue

@killer23d
Copy link

I am having same issue.

@grahampugh
Copy link
Owner

Please can you post a full, verbose output (at least -vvv, make sure you remove any secrets)

@grahampugh grahampugh added the question Further information is requested by the person who opened the issue label Oct 21, 2024
@grahampugh grahampugh self-assigned this Oct 21, 2024
@killer23d
Copy link

MacAdmin@AutoPKG-49487 bin % ./autopkg run local.jamf.BBEdit -vvv
Processing local.jamf.BBEdit...
{'API_PASSWORD': 'xxx',
 'API_USERNAME': 'xxx',
 'AUTOPKG_VERSION': '2.7.3',
 'CACHE_DIR': '/Users/Shared/AutoPkg/Cache',
 'FAIL_RECIPES_WITHOUT_TRUST_INFO': False,
 'GIT_PATH': '/usr/bin/git',
 'JSS_REPOS': [{'type': 'JDS'}],
 'JSS_URL': 'https://jamf.mycompany.com:8443',
 'NAME': 'BBEdit',
 'PARENT_RECIPES': ['/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes/Barebones/BBEdit.pkg.recipe',
                    '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes/Barebones/BBEdit.download.recipe'],
 'RECIPE_CACHE_DIR': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit',
 'RECIPE_DIR': '/Users/Shared/AutoPkg/Overrides',
 'RECIPE_OVERRIDE_DIRS': ['/Users/Shared/AutoPkg/Overrides'],
 'RECIPE_PATH': '/Users/Shared/AutoPkg/Overrides/BBEdit.jamf.recipe',
 'RECIPE_REPOS': {'/Users/Shared/AutoPkg/Repos/com.github.autopkg.ahousseini-recipes': {'URL': 'https://github.com/autopkg/ahousseini-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.dataJAR-recipes': {'URL': 'https://github.com/autopkg/dataJAR-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.grahampugh-recipes': {'URL': 'https://github.com/autopkg/grahampugh-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.hansen-m-recipes': {'URL': 'https://github.com/autopkg/hansen-m-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.hjuutilainen-recipes': {'URL': 'https://github.com/autopkg/hjuutilainen-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.homebysix-recipes': {'URL': 'https://github.com/autopkg/homebysix-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.jazzace-recipes': {'URL': 'https://github.com/autopkg/jazzace-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.jss-recipes': {'URL': 'https://github.com/autopkg/jss-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.killahquam-recipes': {'URL': 'https://github.com/autopkg/killahquam-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.nmcspadden-recipes': {'URL': 'https://github.com/autopkg/nmcspadden-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.nstrauss-recipes': {'URL': 'https://github.com/autopkg/nstrauss-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes': {'URL': 'https://github.com/autopkg/recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.rtrouton-recipes': {'URL': 'https://github.com/autopkg/rtrouton-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.autopkg.scriptingosx-recipes': {'URL': 'https://github.com/autopkg/scriptingosx-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.beatlemike.autopkg-recipes': {'URL': 'https://github.com/beatlemike/autopkg-recipes.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.grahampugh.jamf-upload': {'URL': 'https://github.com/grahampugh/jamf-upload.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.hjuutilainen.autopkg-virustotalanalyzer': {'URL': 'https://github.com/hjuutilainen/autopkg-virustotalanalyzer.git'},
                  '/Users/Shared/AutoPkg/Repos/com.github.killer23d.autopkg-recipe': {'URL': 'https://github.com/killer23d/autopkg-recipe.git'}},
 'RECIPE_REPO_DIR': '/Users/Shared/AutoPkg/Repos',
 'RECIPE_SEARCH_DIRS': ['.',
                        '~/Library/AutoPkg/Recipes',
                        '/Library/AutoPkg/Recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.grahampugh-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.grahampugh.jamf-upload',
                        '/Users/Shared/AutoPkg/Repos/com.github.hjuutilainen.autopkg-virustotalanalyzer',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.homebysix-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.rtrouton-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.dataJAR-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.jss-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.nmcspadden-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.hjuutilainen-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.scriptingosx-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.hansen-m-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.nstrauss-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.jazzace-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.killahquam-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.killer23d.autopkg-recipe',
                        '/Users/Shared/AutoPkg/Repos/com.github.beatlemike.autopkg-recipes',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.ahousseini-recipes',
                        '/Users/Shared/AutoPkg/Overrides',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes/Barebones',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes/Barebones',
                        '/Users/Shared/AutoPkg/Repos/com.github.autopkg.recipes/Barebones'],
 'UPDATE_PREDICATE': 'pkg_uploaded == False',
 'verbose': 3}
BarebonesURLProvider
{'Input': {'product_name': 'bbedit'}}
BarebonesURLProvider: Found URL https://s3.amazonaws.com/BBSW-download/BBEdit_15.1.2.dmg
{'Output': {'minimum_os_version': '11.0',
            'url': 'https://s3.amazonaws.com/BBSW-download/BBEdit_15.1.2.dmg',
            'version': '15.1.2'}}
URLDownloader
{'Input': {'filename': 'BBEdit.dmg',
           'url': 'https://s3.amazonaws.com/BBSW-download/BBEdit_15.1.2.dmg'}}
URLDownloader: No value supplied for prefetch_filename, setting default value of: False
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: Storing new Last-Modified header: Mon, 19 Aug 2024 14:14:01 GMT
URLDownloader: Storing new ETag header: "be6144edd473fc08d46fc8be07670bd2-2"
URLDownloader: Downloaded /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg
{'Output': {'download_changed': True,
            'etag': '"be6144edd473fc08d46fc8be07670bd2-2"',
            'last_modified': 'Mon, 19 Aug 2024 14:14:01 GMT',
            'pathname': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg',
            'url_downloader_summary_result': {'data': {'download_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg'},
                                              'summary_text': 'The following '
                                                              'new items were '
                                                              'downloaded:'}}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
CodeSignatureVerifier
{'Input': {'input_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg/BBEdit.app',
           'requirement': 'anchor apple generic and identifier '
                          '"com.barebones.bbedit" and (certificate '
                          'leaf[field.1.2.840.113635.100.6.1.9] /* exists */ '
                          'or certificate 1[field.1.2.840.113635.100.6.2.6] /* '
                          'exists */ and certificate '
                          'leaf[field.1.2.840.113635.100.6.1.13] /* exists */ '
                          'and certificate leaf[subject.OU] = W52GZAXT98)'}}
CodeSignatureVerifier: Mounted disk image /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg
CodeSignatureVerifier: Verifying code signature...
CodeSignatureVerifier: Deep verification enabled...
CodeSignatureVerifier: Strict verification not defined. Using codesign defaults...
CodeSignatureVerifier: /private/tmp/dmg.BLVeq9/BBEdit.app: valid on disk
CodeSignatureVerifier: /private/tmp/dmg.BLVeq9/BBEdit.app: satisfies its Designated Requirement
CodeSignatureVerifier: /private/tmp/dmg.BLVeq9/BBEdit.app: explicit requirement satisfied
CodeSignatureVerifier: Signature is valid
{'Output': {}}
AppDmgVersioner
{'Input': {'dmg_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg'}}
AppDmgVersioner: Mounted disk image /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg
AppDmgVersioner: BundleID: com.barebones.bbedit
AppDmgVersioner: Version: 15.1.2
{'Output': {'app_name': 'BBEdit.app',
            'bundleid': 'com.barebones.bbedit',
            'version': '15.1.2'}}
PkgRootCreator
{'Input': {'pkgdirs': {'Applications': '0775'},
           'pkgroot': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit'}}
PkgRootCreator: Created /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit
PkgRootCreator: Creating Applications
PkgRootCreator: Created /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit/Applications
{'Output': {}}
Copier
{'Input': {'destination_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit/Applications/BBEdit.app',
           'source_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg/BBEdit.app'}}
Copier: Parsed dmg results: dmg_path: /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg, dmg: .dmg/, dmg_source_path: BBEdit.app
Copier: Mounted disk image /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg
Copier: Copied /private/tmp/dmg.DCiUyK/BBEdit.app to /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit/Applications/BBEdit.app
{'Output': {}}
PkgCreator
{'Input': {'pkg_request': {'chown': [{'group': 'admin',
                                      'path': 'Applications',
                                      'user': 'root'}],
                           'id': 'com.barebones.bbedit.pkg',
                           'options': 'purge_ds_store',
                           'pkgdir': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit',
                           'pkgname': 'BBEdit-15.1.2',
                           'scripts': 'BBEdit_Scripts'}}}
PkgCreator: Connecting
PkgCreator: Sending packaging request
PkgCreator: Disconnecting
PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor
{'Output': {'new_package_request': True,
            'pkg_creator_summary_result': {'data': {'identifier': 'com.barebones.bbedit.pkg',
                                                    'pkg_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit-15.1.2.pkg',
                                                    'version': '15.1.2'},
                                           'report_fields': ['identifier',
                                                             'version',
                                                             'pkg_path'],
                                           'summary_text': 'The following '
                                                           'packages were '
                                                           'built:'},
            'pkg_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit-15.1.2.pkg'}}
com.github.grahampugh.jamf-upload.processors/JamfPackageUploader
{'Input': {'API_PASSWORD': 'xxx',
           'API_USERNAME': 'xxx',
           'JSS_URL': 'https://jamf.mycompany.com:8443',
           'pkg_category': 'Packages',
           'pkg_path': '/Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit-15.1.2.pkg',
           'version': '15.1.2'}}
JamfPackageUploader: No value supplied for CLOUD_DP, setting default value of: False
JamfPackageUploader: No value supplied for SMB_URL, setting default value of: 
JamfPackageUploader: No value supplied for SMB_USERNAME, setting default value of: 
JamfPackageUploader: No value supplied for SMB_PASSWORD, setting default value of: 
JamfPackageUploader: No value supplied for pkg_name, setting default value of: 
JamfPackageUploader: No value supplied for pkg_display_name, setting default value of: 
JamfPackageUploader: No value supplied for pkg_info, setting default value of: 
JamfPackageUploader: No value supplied for pkg_notes, setting default value of: 
JamfPackageUploader: No value supplied for pkg_priority, setting default value of: 10
JamfPackageUploader: No value supplied for reboot_required, setting default value of: 
JamfPackageUploader: No value supplied for os_requirements, setting default value of: 
JamfPackageUploader: No value supplied for required_processor, setting default value of: None
JamfPackageUploader: No value supplied for send_notification, setting default value of: 
JamfPackageUploader: No value supplied for replace_pkg, setting default value of: False
JamfPackageUploader: No value supplied for jcds_mode, setting default value of: False
JamfPackageUploader: No value supplied for jcds2_mode, setting default value of: False
JamfPackageUploader: No value supplied for replace_pkg_metadata, setting default value of: False
JamfPackageUploader: No value supplied for skip_metadata_upload, setting default value of: False
JamfPackageUploader: No value supplied for sleep, setting default value of: 0
JamfPackageUploader: Checking for existing package 'BBEdit-15.1.2.pkg' on https://jamf.mycompany.com:8443
JamfPackageUploader: Checking for existing authentication token
JamfPackageUploader: No existing valid token found
JamfPackageUploader: Getting an authentication token using Basic Auth
JamfPackageUploader: Output file is:  /tmp/jamf_upload_2inmfemp/jamf_upload_9uhih933.txt
JamfPackageUploader: No existing cookie found - starting new session
JamfPackageUploader: curl command: /usr/bin/curl --location --dump-header /tmp/jamf_upload_2inmfemp/curl_headers_from_jamf_upload.txt https://jamf.mycompany.com:8443/api/v1/auth/token --header User-Agent: JamfUploader/2024.10.17.0 --request POST --silent --show-error --header authorization: Basic YXV0b3BrZ2FwaTp1bHRyQENsdWI3OA== --header Content-type: application/json --output /tmp/jamf_upload_2inmfemp/jamf_upload_9uhih933.txt --cookie-jar /tmp/jamf_upload_2inmfemp/curl_cookies_from_jamf_upload.txt
JamfPackageUploader: ERROR: No token received
Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
  File "/Library/AutoPkg/autopkglib/__init__.py", line 626, in process
    self.main()
  File "/Users/Shared/AutoPkg/Repos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfPackageUploader.py", line 260, in main
    self.execute()
  File "/Users/Shared/AutoPkg/Repos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfUploaderLib/JamfPackageUploaderBase.py", line 983, in execute
    token = self.handle_api_auth(
  File "/Users/Shared/AutoPkg/Repos/com.github.autopkg.grahampugh-recipes/JamfUploaderProcessors/JamfUploaderLib/JamfUploaderBase.py", line 310, in handle_api_auth
    raise ProcessorError("No token found, cannot continue")
autopkglib.ProcessorError: No token found, cannot continue
  File "/Library/AutoPkg/autopkglib/__init__.py", line 840, in process
    self.env = processor.process()
No token found, cannot continue
Failed.
Receipt written to /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/receipts/local.jamf-receipt-20241021-131731.plist

The following recipes failed:
    local.jamf.BBEdit
        Error in local.jamf.BBEdit: Processor: com.github.grahampugh.jamf-upload.processors/JamfPackageUploader: Error: No token found, cannot continue

The following new items were downloaded:
    Download Path                                                       
    -------------                                                       
    /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/downloads/BBEdit.dmg  

The following packages were built:
    Identifier                Version  Pkg Path                                                         
    ----------                -------  --------                                                         
    com.barebones.bbedit.pkg  15.1.2   /Users/Shared/AutoPkg/Cache/local.jamf.BBEdit/BBEdit-15.1.2.pkg  
MacAdmin@AutoPKG-49487 bin %

I suspect the error comes from Jamf because it is trying to use basic auth.

@grahampugh
Copy link
Owner

Jamf uses basic auth to get a bearer token. But in your case it's failing to get authorisation. I suspect you're using either incorrect credentials, or there is a special character in the password that's defeating the code.

@killer23d
Copy link

killer23d commented Oct 22, 2024

Jamf uses basic auth to get a bearer token. But in your case it's failing to get authorisation. I suspect you're using either incorrect credentials, or there is a special character in the password that's defeating the code.

In that case, I am very positive it is the credentials using special characters, because I use the same API credentials for a another Autopkg instance that uploads to local DP, and that is working fine.

I can troubleshoot this with you, let me know what credentials you want me to try and I will create a new set for testing.

@Shaun-RDP
Copy link
Author

Shaun-RDP commented Oct 28, 2024

I changed the password to one without special characters, it is now working correctly. Thank you all for the effort and help.

@grahampugh
Copy link
Owner

"Not" working, or "now" working? Do you happen to know which special character caused the issue?

@Shaun-RDP
Copy link
Author

"Not" working, or "now" working? Do you happen to know which special character caused the issue?

"Now working", I am not sure as the password had 2 different special characters. "&" "%"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested by the person who opened the issue
Projects
None yet
Development

No branches or pull requests

3 participants