<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Print Service fails to Print &amp;quot;Failed to create layer from service at &amp;quot;&amp;lt;Service_URL&amp;gt;&amp;quot; for Hosted Server in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1395747#M38967</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm also struggling with this issue and I'm desperate right now...&lt;/P&gt;&lt;P&gt;I have published secured service from ArcGIS Pro 2.9.11 to ArcGIS Server 10.9.1 (as they should be compatible) where I have also installed&amp;nbsp;&lt;SPAN&gt;ArcGIS Server Map and Feature Service Security 2023 Update 1 Patch (as there this bug should be fixed), included my credentials in script and everything, but still doesn't manage to print my secured service.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tried it as local ArcGIS Pro tool and it works fine, but after publishing it as geoprocessing tool to my server I get common error:&amp;nbsp; Failed to create layer from service at https://.../arcgis/rest/services/.../MapServer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there anything else I can do about it?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 11:06:49 GMT</pubDate>
    <dc:creator>StefanStamenković</dc:creator>
    <dc:date>2024-03-14T11:06:49Z</dc:date>
    <item>
      <title>Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318155#M36824</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We are working with a custom Print service created from ArcGIS Pro to allow printing of Secured service from different Servers. However, we encounter the issue when trying to print the secured services from the ArcGIS Server which on which the service is published.&lt;/P&gt;&lt;P data-unlink="true"&gt;We have configured the Print Service by following this "&lt;SPAN&gt;&lt;A title="HOW TO" href="https://support.esri.com/en-us/knowledge-base/how-to-publish-a-custom-print-service-with-embedded-cre-000026010" target="_self"&gt;HOW TO&lt;/A&gt;" article and it works well with other server services.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;As soon as I remove the service from that server everything work smoothly with any issues. We have tried several things, it still fails. Furthermore, if the service is created from ArcMap and then published everything works as expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;We have also installed Print service patches for this version.&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;Environment details:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;ArcGIS Enterprise 10.8.1&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;All components are installed on one machine except Web Adaptor&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;It would be great if I can some thoughts on this.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Aug 2023 06:17:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318155#M36824</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2023-08-13T06:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318180#M36825</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/59475"&gt;@ArchitSrivastava&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;for most of the case, you'd not need to embed credentials with a print service to allow print secured services. Please read this help topic.&lt;BR /&gt;&lt;A href="https://enterprise.arcgis.com/en/server/latest/publish-services/linux/printing-maps-that-contain-secured-services.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/server/latest/publish-services/linux/printing-maps-that-contain-secured-services.htm&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Pls let us know if you are in one of those situation where you must follow this approach. We had a bug in 10.8.1 that prevent print service from accessing secured services.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Aug 2023 19:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318180#M36825</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2023-08-13T19:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318220#M36830</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2620"&gt;@TanuHoque&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Hope you are keeping safe and well. Thanks for responding to this. I have embedded credentials because we utilize services in our Web Maps/Apps from several different servers and that too from different organization which are secured&lt;/P&gt;&lt;P&gt;Hence, to allow our users to be able to print those services utilizing our custom templates. We utilized this method:&lt;/P&gt;&lt;P&gt;&lt;A title="Print maps that contain non-token-based secured services from ArcGIS Server" href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/web-map-printing-with-arcpy-mp.htm#ESRI_SECTION1_1EB4BCD03C964BF2A9CDC6BC60329F7E" target="_blank" rel="noopener"&gt;Print maps that contain non-token-based secured services from ArcGIS Server&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have made sure of the following as well:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ArcGIS Server can access these files from a registered path&lt;/LI&gt;&lt;LI&gt;All connections are "ArcGIS Server User Connections"&lt;/LI&gt;&lt;LI&gt;The tool works fine on ArcGIS Pro&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Furthermore, We ran a check on BUGs and have installed the following patches (After that the service created from ArcMap Started working):&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A title="ArcGIS Server 10.8.1 Print Service and Text Element Patch" href="https://support.esri.com/en-us/patches-updates/2021/arcgis-server-10-8-1-print-service-and-text-element-pat-7868" target="_blank" rel="noopener"&gt;ArcGIS Server 10.8.1 Print Service and Text Element Patch&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;A title="ArcGIS Server 10.8.1 Print Service Patch" href="https://support.esri.com/en-us/patches-updates/2020/arcgis-server-10-8-1-print-service-patch-7834" target="_blank" rel="noopener"&gt;ArcGIS Server 10.8.1 Print Service Patch&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The cause behind working on this is that we would like to move away from "ArcMap and components created from it" and prepare for an upgrade to latest version of ArcGIS Enterprise.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Note: This service can print secured service from all other server embedded in the script except the services from it's own "Hosting Server".&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Hopefully I addressed the answers you were looking for. Any thoughts would be highly appreciated.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 05:15:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318220#M36830</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2023-08-14T05:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318351#M36839</link>
      <description>&lt;P&gt;I ran into the same issue, this is a known bug with Pro 3.1 and Server 10.8.1 (we were using 10.7.1), I needed to upgrade to Server 11.1.1 and the bug is fixed, because when creating the widget there is an application ID that is apart of the ArcGIS Pro, but it is not apart of the earlier versions of server, so it error's out when you try to publish.&amp;nbsp; Once you upgrade make sure to clear you browser cache as well.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 15:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318351#M36839</guid>
      <dc:creator>ChadKopplin</dc:creator>
      <dc:date>2023-08-14T15:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318381#M36842</link>
      <description>&lt;P&gt;Hey just further to what ChadKopplin said the following &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/share-analysis/geoprocessing-service-compatibility.htm" target="_self"&gt;documentation&lt;/A&gt; is pretty useful for judging what version of ArcGIS Pro to pair with ArcGIS Server or Enterprise.&lt;/P&gt;&lt;P&gt;Enterprise 11 and ArcGIS Pro 3 were both major updates so mixing either of these with Enterprise 10.x or ArcGIS Pro 2.x can have some compatibility issues if tool parameters are different.&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 16:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318381#M36842</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2023-08-14T16:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318580#M36846</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/50014"&gt;@David_McRitchie&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/168740"&gt;@ChadKopplin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for your valuable comments. I understand the compatibility point. Hence, We have tried several versions of ArcGIS Pro by for following the information mentioned in the document below:&lt;/P&gt;&lt;P&gt;&lt;A title="ArcGIS Pro and ArcGIS Enterprise compatibility" href="https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/share-analysis/geoprocessing-service-compatibility.htm#GUID-D29B4622-BDF7-4407-9F13-25FF9EC7ED92" target="_blank" rel="noopener"&gt;ArcGIS Pro and ArcGIS Enterprise compatibility&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We tried &lt;SPAN&gt;ArcGIS Pro 2.6 with our environment and it gives the same errors (allows us to publish but fails to print the layers). Probably, I can try other versions of ArcGIS Pro which are compatible with ArcGIS Enterprise 10.8.1 and check the behavior.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am considering upgrading as a possible option but it is a risk at the moment i.e., if I upgrade and things don't work out, It would cause an impact on user workflow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot for suggestions. I will keep you guys posted as I make progress.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Archit&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 04:58:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318580#M36846</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2023-08-15T04:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318688#M36849</link>
      <description>&lt;P&gt;Good morning Archit, I had the same concerns.&amp;nbsp; I will say that the upgrade went very smoothly, our only issue was that I needed to republish our image server services.&amp;nbsp; The portal, portal web adaptor, server, server web adaptor, and data store upgrades upgraded with no issues.&amp;nbsp; Our GIS server is upgraded nightly so we would have been able to restore the server quickly if an issue would have happened.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 14:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1318688#M36849</guid>
      <dc:creator>ChadKopplin</dc:creator>
      <dc:date>2023-08-15T14:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1320584#M36891</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/168740"&gt;@ChadKopplin&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;These comments are really helpful. As per both our experiences the upgrades should go smoothly without any issues.&lt;/P&gt;&lt;P&gt;However, upgrading to ArcGIS Enterprise 11.1 would discontinue the usage of ArcMap service. Hence, I am thinking of going to 10.9.1 first and see if everything works out and I will also have a fallback service from ArcMap (in case something goes out of expectation).&lt;/P&gt;&lt;P&gt;I will keep you posted if I successfully solve this by upgrading the system.&lt;/P&gt;&lt;P&gt;Thanks for all the valuable comments&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/168740"&gt;@ChadKopplin&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2620"&gt;@TanuHoque&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/50014"&gt;@David_McRitchie&lt;/a&gt;. Much appreciated.&lt;/P&gt;&lt;P&gt;-Archit&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 10:47:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1320584#M36891</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2023-08-21T10:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1321510#M36921</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/59475"&gt;@ArchitSrivastava&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have just released the patch. Please apply this to you 10.8.1 server and that should resolve your issues.&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/patches-updates/2023/arcgis-server-map-and-feature-service-security-2023-update-1-patch" target="_blank"&gt;https://support.esri.com/en-us/patches-updates/2023/arcgis-server-map-and-feature-service-security-2023-update-1-patch&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 06:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1321510#M36921</guid>
      <dc:creator>TanuHoque</dc:creator>
      <dc:date>2023-08-23T06:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1322873#M36956</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2620"&gt;@TanuHoque&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for sharing this. I tried this on our ArcGIS Enterprise 10.8.1. However, sadly the problem still persists with printing services from Hosting Server. It perfectly works if the map contain other ArcGIS Servers.&lt;/P&gt;&lt;P&gt;In order to further troubleshoot the issue I created a separate environment of ArcGIS Enterprise 10.9.1 in a different domain with similar configuration i.e. One machine where all components are installed and other where only Web Adaptors are configured and the problem persists on this as well.&lt;/P&gt;&lt;P&gt;This drives me to think that the problem could be with architecture configuration of this type but not too sure as of now.&lt;/P&gt;&lt;P&gt;Additionally, I am attaching the script for your reference perhaps I have missed something here.&lt;/P&gt;&lt;P&gt;Note: I have tried with registered paths as well. A similar folder exists on ArcGIS Server machines as well (from where .ags files are being refereed.)&lt;/P&gt;&lt;P&gt;I am working on troubleshooting this further. I will keep you posted with progress.&lt;/P&gt;&lt;P&gt;-Archit&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 07:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1322873#M36956</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2023-08-28T07:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1395747#M38967</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm also struggling with this issue and I'm desperate right now...&lt;/P&gt;&lt;P&gt;I have published secured service from ArcGIS Pro 2.9.11 to ArcGIS Server 10.9.1 (as they should be compatible) where I have also installed&amp;nbsp;&lt;SPAN&gt;ArcGIS Server Map and Feature Service Security 2023 Update 1 Patch (as there this bug should be fixed), included my credentials in script and everything, but still doesn't manage to print my secured service.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tried it as local ArcGIS Pro tool and it works fine, but after publishing it as geoprocessing tool to my server I get common error:&amp;nbsp; Failed to create layer from service at https://.../arcgis/rest/services/.../MapServer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there anything else I can do about it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 11:06:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1395747#M38967</guid>
      <dc:creator>StefanStamenković</dc:creator>
      <dc:date>2024-03-14T11:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1396028#M38977</link>
      <description>&lt;P&gt;Hey Stefan,&lt;/P&gt;&lt;P&gt;I would recommend raising a Support Case with your Esri distributor for assistance, as print cases can be fairly tricky.&lt;/P&gt;&lt;P&gt;I would recommend checking other patches that are available, as there are some print specific patches for 10.9.1 such as the &lt;A href="https://support.esri.com/en-us/patches-updates/2022/arcgis-server-10-9-1-map-and-print-service-patch-8059" target="_self"&gt;following&lt;/A&gt; which may assist.&lt;/P&gt;&lt;P&gt;For testing I would also ensure that your Web Map just contains a basemap and layers that are stored on the default datastore, as this can rule out a lot of permission errors that can arise when the ArcGIS Server account doesn't have internet access.&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1396028#M38977</guid>
      <dc:creator>David_McRitchie</dc:creator>
      <dc:date>2024-03-14T16:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1396468#M38980</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;Thank you for your answer. Mentioned patch has also been already installed and it doesn't seem to help as problem still persists.&lt;/P&gt;&lt;P&gt;I'm testing print service with basemap and two services with data in Enterprise database, one secured and other one not. As I mentioned, services are printing fine while using tool in Toolbox. After publishing and running GP tool I'm getting Error although I'm using the same WebMapJson, but even if I unlock services and update&amp;nbsp;WebMapJson to print unsecured services, I'm not getting the Error but services don't get printed.&lt;/P&gt;&lt;P&gt;If anyone has other advice, I'll be looking forward to try with it.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 09:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1396468#M38980</guid>
      <dc:creator>StefanStamenković</dc:creator>
      <dc:date>2024-03-15T09:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1397126#M39003</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/609241"&gt;@StefanStamenković&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Hope you are keeping safe and well. Could you please share more details mentioned below:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What is the Authentication Mode we are working with "Web-tier authentication" or "Portal-tier authentication"?&lt;/LI&gt;&lt;LI&gt;Can e change the logging level of Geoprocessing service to "Info" and then check what information is generated in those logs? For more details :&amp;nbsp;&lt;A href="https://enterprise.arcgis.com/en/server/10.8/publish-services/linux/troubleshooting-geoprocessing-rest-services.htm#GUID-6D899954-7051-4363-988E-7637BE1F9677" target="_blank" rel="noopener"&gt;Enabling info-level geoprocessing messages&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;I am assuming that this runs perfectly fine on ArcGIS Pro, no waring messages at all?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Additionally, could you share a snippet of the .py file you have generated and published.&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;-Archit&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 06:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1397126#M39003</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2024-03-18T06:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1400924#M39070</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/59475"&gt;@ArchitSrivastava&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Sorry for delayed answer.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;As we are using stand-alone server, I suppose it is&amp;nbsp;&lt;SPAN&gt;web-tier authentication.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;I managed to enable info-level messages for geoprocessing tool but it doesn't give me clearer insight what happens except it crashes while converting webmap to a map document and executes exception.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;&lt;SPAN&gt;Yes, in ArcGIS Pro it executes without any errors, after publishing it as geoprocessing tool and running it I receive error: &lt;STRONG&gt;&lt;EM&gt;Failed to create layer from service at &lt;A href="https://.../MapServer" target="_blank"&gt;https://.../MapServer&lt;/A&gt;&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;and it is secured serviceasdf&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Please find below content of my .py file.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import sys
import os
import arcpy
import uuid

# constants
SERVER_PROD_NAME = 'Server'
PRO_PROD_NAME = 'ArcGISPro'
PAGX_FILE_EXT = "pagx"
MAP_ONLY = 'map_only'

# Specify credentials for secured services in the WebMap JSON
secure_server_connections = [r'path\to\ags\file.ags']

# Import credentials
importedConnections = arcpy.ImportCredentials(secure_server_connections)

# default location and current product name
#
_defTmpltFolder = os.path.join(arcpy.GetInstallInfo()['InstallDir'], r"Resources\ArcToolBox\Templates\ExportWebMapTemplates")
_prodName = arcpy.GetInstallInfo()['ProductName']
_isMapOnly = False

# export only map without any layout elements
def exportMap(result, outfile, outFormat):
    mapView = result.ArcGISProject.listMaps()[0].defaultView

    w = result.outputSizeWidth
    h = result.outputSizeHeight
    dpi = int(result.DPI) #a workaround for now for a bug

    try:
        if outFormat == "png8" or outFormat == "png32":
            if (outFormat == "png8"):
                colorMode = "8-BIT_ADAPTIVE_PALETTE"
            else:
                colorMode = "32-BIT_WITH_ALPHA"
            mapView.exportToPNG(outfile, w, h, dpi, None, colorMode)
        elif outFormat == "pdf":
            mapView.exportToPDF(outfile, w, h, dpi)
        elif outFormat == "jpg":
            mapView.exportToJPEG(outfile, w, h, dpi, None, '24-BIT_TRUE_COLOR', 100)
        elif outFormat == "gif":
            mapView.exportToGIF(outfile, w, h, dpi)
        elif outFormat == "eps":
            mapView.exportToEPS(outfile, w, h, dpi)
        elif outFormat == "svg":
            mapView.exportToSVG(outfile, w, h, dpi, False)
        elif outFormat == "svgz":
            mapView.exportToSVG(outfile, w, h, dpi, True)
        elif outFormat == "aix":
            mapView.exportToAIX(outfile, w, h, dpi)
        elif outFormat == "tiff":
            mapView.exportToTIFF(outfile, w, h, dpi, False, "32-BIT_WITH_ALPHA", "DEFLATE", True) #return geoTIFF_tags
    except Exception as err:
        arcpy.AddError("error raised..." + str(err))
        raise
    
# export layout

def exportLayout(result, outfile, outFormat):
    layout = result.ArcGISProject.listLayouts()[0]
    dpi = result.DPI

    try:
        if outFormat == "png8" or outFormat == "png32":
            if (outFormat == "png8"):
                colorMode = "8-BIT_ADAPTIVE_PALETTE"
            else:
                colorMode = "32-BIT_WITH_ALPHA"
            layout.exportToPNG(outfile, dpi, colorMode)
        elif outFormat == "pdf":
            layout.exportToPDF(outfile, dpi)
        elif outFormat == "jpg":
            layout.exportToJPEG(outfile, dpi)
        elif outFormat == "gif":
            layout.exportToGIF(outfile, dpi)
        elif outFormat == "eps":
            layout.exportToEPS(outfile, dpi)
        elif outFormat == "svg":
            layout.exportToSVG(outfile, dpi, False)
        elif outFormat == "svgz":
            layout.exportToSVG(outfile, dpi, True)
        elif outFormat == "aix":
            layout.exportToAIX(outfile, dpi)
        elif outFormat == "tiff":
            layout.exportToTIFF(outfile, dpi, "32-BIT_WITH_ALPHA", "DEFLATE")
    except Exception as err:
        arcpy.AddError("error raised..." + str(err))
        raise

# generating a unique name for each output file
def generateUniqueFileName(outFormat):
    guid = str(uuid.uuid1())
    fileName = ""
    fileExt = outFormat

    #changing the file extension for few instances
    if outFormat == "png8" or outFormat == "png32":
        fileExt = "png"
    elif outFormat == "tiff":
        fileExt = "tif"

    fileName = '{}.{}'.format(guid, fileExt)
    fullFileName = os.path.join(arcpy.env.scratchFolder, fileName)
    return fullFileName

# Main module
def main():
    # Get the value of the input parameter
    WebMap_as_JSON = arcpy.GetParameterAsText(0)
    outfilename = arcpy.GetParameterAsText(1)
    format = arcpy.GetParameterAsText(2).lower()
    layoutTemplatesFolder = arcpy.GetParameterAsText(3).strip()
    layoutTemplate = arcpy.GetParameterAsText(4).lower()

    if (layoutTemplate.lower() == MAP_ONLY):
        _isMapOnly = True
        layoutTemplate = None
    else:
        _isMapOnly = False

    # Special logic while being executed in ArcGIS Pro 
    # - so that a Geoprocessing result can be acquired without needing any json to begin to feed in
    # - this is to make the publishing experience easier
    if (WebMap_as_JSON.replace(' ', '') == '#'):
        WebMap_as_JSON = '#'
        if (_prodName == PRO_PROD_NAME):
            return
        elif (_prodName == SERVER_PROD_NAME):
            arcpy.AddIDMessage('ERROR', 590, 'WebMap_as_JSON')
        else:
            arcpy.AddIDMessage('ERROR', 120004, _prodName)

    # generate a new output filename when the output_filename parameter is empty or the script is running on server
    if outfilename.isspace() or _prodName == SERVER_PROD_NAME:
        outfilename = generateUniqueFileName(format)

    # constructing the full path for the layout file (.pagx)
    if not _isMapOnly:
        # use the default location when Layout_Templates_Folder parameter is not set
        tmpltFolder = _defTmpltFolder if not layoutTemplatesFolder else layoutTemplatesFolder
        layoutTemplate = os.path.join(tmpltFolder, '{}.{}'.format(layoutTemplate, PAGX_FILE_EXT))

    #Convert the webmap to a map document
    try:
        result = arcpy.mp.ConvertWebMapToArcGISProject(WebMap_as_JSON, layoutTemplate)
        
        #Export...
        if (_isMapOnly):
            if (result.outputSizeWidth == 0) or (result.outputSizeHeight == 0):
                arcpy.AddIDMessage('ERROR', 1305)
            exportMap(result, outfilename, format)
        else:
            exportLayout(result, outfilename, format)

        # Clear credentials
        arcpy.ClearCredentials(importedConnections)
        
    except Exception as err:
        arcpy.AddError(str(err))

    # Set output parameter
    #
    arcpy.SetParameterAsText(1, outfilename)

if __name__ == "__main__":
    main()&lt;/LI-CODE&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 14:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1400924#M39070</guid>
      <dc:creator>StefanStamenković</dc:creator>
      <dc:date>2024-03-26T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Print Service fails to Print "Failed to create layer from service at "&lt;Service_URL&gt;" for Hosted Server</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1401297#M39076</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/609241"&gt;@StefanStamenković&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for sharing the details. While I analyze the script you have shared as it seems a bit modified than usual. I would like to bring the following to attention and consideration:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can you confirm that you are using Web-Tier to check that:&lt;UL&gt;&lt;LI&gt;Navigate to ArcGIS Server Manager &amp;gt; Security &amp;gt; What you see under configuration settings&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Confirm the Version of ArcGIS Server you are working with&lt;/LI&gt;&lt;LI&gt;Make Sure that ArcGIS Server Connection is "User Connection"&lt;/LI&gt;&lt;LI&gt;Can we try the basic script and steps recommended by ESRI in the following article, this will help us make sure if the modifications are causing any problems:&lt;UL&gt;&lt;LI&gt;&lt;A title="Publish a custom print service with embedded credentials from ArcGIS Pro to a standalone ArcGIS Server site" href="https://support.esri.com/en-us/knowledge-base/how-to-publish-a-custom-print-service-with-embedded-cre-000026010" target="_blank" rel="noopener"&gt;Publish a custom print service with embedded credentials from ArcGIS Pro to a standalone ArcGIS Server site&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Here are some initial tests I ran:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Configured you script at my end with Sample Server 6 credentials ags file (as I do not have standalone server) (Made sure that the connection Type is USER)&lt;/LI&gt;&lt;LI&gt;Made some basic changes in script to help me understand things better and handle things better (mentioned below)&lt;/LI&gt;&lt;LI&gt;Used "Web Map as JSON" from ESRI article&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&lt;A title="Publish a custom print service with embedded credentials from ArcGIS Pro to a standalone ArcGIS Server site" href="https://support.esri.com/en-us/knowledge-base/how-to-publish-a-custom-print-service-with-embedded-cre-000026010" target="_blank" rel="noopener"&gt;Publish a custom print service with embedded credentials from ArcGIS Pro to a standalone ArcGIS Server site&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Published it as a Web Tool To Portal for ArcGIS (11.1)&lt;/LI&gt;&lt;LI&gt;Added a secured Hosted Service and a Secured service from Sample Server 6 and ran Print in Web App Builder Widget and it seems to work&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Changes Made in the script (very-initial) (attached updated):&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Wrapped some parts of code in 'try-except'&amp;nbsp;&lt;SPAN&gt;to catch specific exceptions that might occur during execution.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Added exception handling&amp;nbsp;&lt;SPAN&gt;for both map export and layout export functions&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;Additionally, &lt;STRONG&gt;I think "Web-Tier Authentication" could be the culprit here,&lt;/STRONG&gt; Can you check this &lt;A href="http://ArcGIS%20Server Windows Service" target="_blank" rel="noopener"&gt;post&lt;/A&gt; about&amp;nbsp;ArcGIS Server Windows Service account with IWA.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;It would be great if you can try the attached script, publish it as geoprocessing service, Set the logging level for Geoprocessing service and try to run the tool and what happens.&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;-Archit&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 07:16:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/custom-print-service-fails-to-print-quot-failed-to/m-p/1401297#M39076</guid>
      <dc:creator>ArchitSrivastava</dc:creator>
      <dc:date>2024-03-27T07:16:45Z</dc:date>
    </item>
  </channel>
</rss>

