jssimporter / JSSImporter

JSSImporter is deprecated. Please see the wiki for alternatives
Apache License 2.0
145 stars 38 forks source link

[1.0.2b2] Unable to upload Self Service Icons #145

Open qu1gl3s opened 6 years ago

qu1gl3s commented 6 years ago

Hi,

Currently unable to upload Self Service Icons, here is the error I'm receiving.

All other functionality is working as intended.

'self_service_icon': u'MSTeams.png',

JSSImporter: Found file: /Users/administrator/Library/AutoPkg/RecipeRepos/#####/MSTeams/MSTeams.png Response Code: 404 Response: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. https://#####:8443//JSSResource/fileuploads/policies/id/587. Failed.

Error in #####.MSTeams: Processor: JSSImporter: Error: Response Code: 404 Response: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. https://#####:8443//JSSResource/fileuploads/policies/id/587.

This is running as verbose with -vv

Thanks!

grahampugh commented 5 years ago

@qu1gl3s Are you using Jamf Cloud? I wonder if this is a delay issue where it is expecting to find policy 587 but it hasn't yet been replicated to the cloud node that it's attempting to upload the icon to. We're seeing a few issues with this.

grahampugh commented 5 years ago

I believe this is a duplicate of #81

qu1gl3s commented 5 years ago

Hi Graham,

I'm not a Jamf Cloud customer, I'm on-premise so I can't see any reason so far that could explain the issue at hand.

Thanks!

grahampugh commented 5 years ago

OK, is this a generic issue with all icons or just the MSTeams icon? Have you tried running it on more than one Mac?

qu1gl3s commented 5 years ago

Yes, I've tried running it on more than one Mac and all icons are affected, including existing ones.

grahampugh commented 5 years ago

On prem or a cloud DP e.g. S3?

qu1gl3s commented 5 years ago

On-prem distribution point.

perryk commented 5 years ago

Hi,

I've run into this issue recently also. For me, icons failed to upload for an On-prem distribution point yet uploaded without any trouble to a Cloud based DP. I was receiving the same error message as above, although if I manually uploaded the icon and re-run the recipe it would complete ok.

I still have both instances in a testing environment, the Cloud based DP is a Jamf 10.13 Beta cloud instance.

I was also using 1.0.2b2, however, I can test with 1.0.2b3 shortly.

perryk commented 5 years ago

Ok, have tried this and 1.0.2b3 has the same issue with On-prem DP for me.

All good if manually uploading the icon and using STOP_IF_NO_JSS_UPLOAD to continue even if the package uploaded ok earlier.

grahampugh commented 5 years ago

Hi @perryk you say this affected you recently, could that be related to a Jamf Pro update? I started having some icon upload issues from last week using regular curl (not JSSImporter issues) where the icon is corrupted, around the same time I upgraded to 10.12. It’s probably unrelated but worth an ask!

Update: This was unrelated in the end - some issue with our nginx load balancer that went away when pointing directly to one of our JSSes.

perryk commented 5 years ago

Sorry, this is the first time I have stood up Autopkg/JSS Importer so actually I have only tested on 10.13 beta for On-Prem and 10.12 for Cloud.

qu1gl3s commented 4 years ago

Just confirming the issue is still occurring in 1.0.3.

Not sure whether there is an issue with the API accepting the image.

aluminummonster00 commented 4 years ago

Having the same issue in 1.0.5, cloud distribution point.

grahampugh commented 4 years ago

@aluminummonster00 Jamf Cloud or some other cloud? Distribution point is kind of irrelevant for icons.

aluminummonster00 commented 4 years ago

Self hosted in AWS, Jamf Pro 10.15.1.

grahampugh commented 4 years ago

Can you provide a full output from autopkg -vvvv SomeRecipe.jss (removing any sensitive passwords etc)?

danengh commented 4 years ago

The problems seems to be that it is looking for an icon and if it doesn't exist, it errors.

two different macs, two different JSS's Failure - Policy exists but has no icon:

SSImporter: Looking for Policy template file NoMADAutoInstallPolicy.xml...
JSSImporter: Found file: /Users/autopkg-admin/Library/AutoPkg/RecipeRepos/repo/NoMAD/NoMADAutoInstallPolicy.xml
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
JSSImporter: Setting policy to 'Install' package.
PUT https://my.jss.com:8443/JSSResource/policies/id/5658: Success.
Retrieving data from JSS...
GET https://my.jss.com:8443/JSSResource/policies/id/5658: Success.
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
JSSImporter: Policy ID '5658' verified on server
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
JSSImporter: Policy 'NoMAD' updated.
JSSImporter: Looking for Icon file NoMAD.png...
JSSImporter: Found file: /Users/autopkg-admin/Library/AutoPkg/RecipeRepos/repo/NoMAD/NoMAD.png
JSSImporter: Icon name in existing policy: None
Response Code: 404      Response:  The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. https://my.jss.com:8443//JSSResource/fileuploads/policies/id/5658.
Failed.

Success - Policy exists and has icon:

JSSImporter: Looking for Policy template file NoMADAutoInstallPolicy.xml...
JSSImporter: Found file: /Users/engh/Github/autopkg/NoMAD/NoMADAutoInstallPolicy.xml
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
JSSImporter: Setting policy to 'Install' package.
PUT https://my.jss.com:8443/JSSResource/policies/id/1256: Success.
Retrieving data from JSS...
GET https://my.jss.com:8443/JSSResource/policies/id/1256: Success.
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
GET https://my.jss.com:8443/JSSResource/policies/name/NoMAD: Success.
JSSImporter: Policy 'NoMAD' updated (ID: 1256).
JSSImporter: Looking for Icon file NoMAD.png...
JSSImporter: Found file: /Users/engh/Github/autopkg/NoMAD/NoMAD.png
JSSImporter: Icon matches existing icon, moving on...
grahampugh commented 4 years ago

Edit: sorry, misread the output (output in code format is nicer to read!).

I guess we need another wait loop at theicon.save() part.

qu1gl3s commented 4 years ago

Just want to mention that the issue is still occurring in 1.1.2

JSSImporter: Looking for Icon file Mendeley Reference Manager.png...

JSSImporter: Found file: /AUTOPKG/CACHE/LOCATION/MendeleyReferenceManager/Mendeley Reference Manager.png

JSSImporter: Icon name in existing policy: None

Traceback (most recent call last): File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process self.env = processor.process() File "/Library/AutoPkg/autopkglib/__init__.py", line 465, in process self.main() File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 1388, in main self.handle_icon() File "/Library/AutoPkg/autopkglib/JSSImporter.py", line 743, in handle_icon icon.save() File "/Library/AutoPkg/JSSImporter/jss/misc_endpoints.py", line 221, in save error_handler(PostError, response) File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 96, in error_handler raise exception

jss.exceptions.PostError: Response Code: 404 Response: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. https://JAMFPRO//JSSResource/fileuploads/policies/id/824.

File "/Library/AutoPkg/autopkglib/__init__.py", line 658, in process self.env = processor.process()

Response Code: 404 Response: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. https://JAMFPRO/JSSResource/fileuploads/policies/id/824. Failed.