I have read many questions like this and have not found any resolution yet.
Recently after upgrade to 10.5.1, the custom print service on one of my arcgis servers is failing.
The print service is a geoprocessing service published using Export Web Map tool and uses some custom templates.
In one server machine, it works and in another it fails. Both arcgis servers are set identical interms of security and permissions to files and folders.
It's always good practice to explain what you did so it may help others in the future. Even if the solution was something like "I had a typo". Then mark your question as "assumed answered" or your answer as correct so the thread can be closed. thanks.
'Unable to complete' is a very generic message. It does not give you much info why it is failing.
I'd suggest you to change your print service message level to 'Info'
and check what is the message returned by the service when it fails. If you use web app, then you can use browser's Developer Tools to check the network traffic to find that out.
also, pls check the Server log.
My error is specifically
Error executing tool. Export Web Map Job ID: ja350acef3caa48fe9f9a288726e04f24 : Layer "Basemap": Unable to connect to map server at https://..../arcgis/rest/services/.../Basemap/MapServer. Failed to execute (ExportWebMap2). Failed to execute (Export Web Map).
what that means is that your print service can't access Basemap map service.
may be there is some kind of admin setting on the server that prevents it from accessing the map service.
one quick way to find that out is:
yes, you service may be public, but due firewall or other kind of restrictions your print service (in fact the server that is hosting the print service) may not have access.
did you try logging on the server and try to access the map service (using the same url that you'd use in your web app) as I mentioned?
are both map and print services running on the same machine?