<?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 Python Application Error 0xs0000022 when run with service account in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/325369#M25312</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Just when you think you've read every thread about arcpy/Pro to get your&amp;nbsp;script to run and feel confident to have mastered this ridiculous convoluted world, you're back to square zero.&amp;nbsp;I mean I have literally spent hours reading about installation/configuration of Python 3.x/conda with ArcGIS Pro. I've replied to a number of threads feeling knowledgeable enough to chime in. But I don't know what's going on here.&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;I have an SDE maintenance script running on one server under a service (domain) account, and it works beautifully. I had to:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; background-color: #ffffff;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Install Pro (this is 2.3).&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Create a Portal user for the service account (for licensing) and make it admin.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Open Pro on server once and connect to correct&amp;nbsp;portal.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Upgrade to latest version of arcgis package. No other changes to conda env.&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; font-weight: inherit;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Only:&amp;nbsp;&lt;SPAN style="border: 0px currentColor; font-weight: inherit;"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Write my script.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Set up a Windows Scheduled task to use service account and run script with highest privileges&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Grant service account logon-as-service/RDP access&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Cross my fingers, and ..&lt;/LI&gt;&lt;/UL&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Boom everything worked.&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Now, on server 2, where I did the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px currentColor; font-weight: inherit; text-decoration: underline;"&gt;&lt;EM style="border: 0px currentColor; font-weight: bold; "&gt;&lt;STRONG&gt;exact same thing&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;, same script, same tasks, same service account, nothing happens.&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; background-color: #ffffff;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Can't run Python as service account. That gives me an Application Error&amp;nbsp;0xs0000022.&lt;P style="border: 0px currentColor; font-weight: inherit;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;The application was unable to start correctly (0xc0000022). 
Click OK to close the application.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Inside Pro (running as srv account), I can&amp;nbsp;open Python window but when I import arcpy, I get:&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;PermissionError: [Errno 13] Permission denied:
 'C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\
envs\\arcgispro-py3\\Lib\\site-packages\\mkl_fft\\__init__.py'
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;What am I doing wrong, what step did I skip or screw up on ? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:25:35 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2021-12-11T15:25:35Z</dc:date>
    <item>
      <title>Python Application Error 0xs0000022 when run with service account</title>
      <link>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/325369#M25312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Just when you think you've read every thread about arcpy/Pro to get your&amp;nbsp;script to run and feel confident to have mastered this ridiculous convoluted world, you're back to square zero.&amp;nbsp;I mean I have literally spent hours reading about installation/configuration of Python 3.x/conda with ArcGIS Pro. I've replied to a number of threads feeling knowledgeable enough to chime in. But I don't know what's going on here.&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;I have an SDE maintenance script running on one server under a service (domain) account, and it works beautifully. I had to:&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; background-color: #ffffff;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Install Pro (this is 2.3).&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Create a Portal user for the service account (for licensing) and make it admin.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Open Pro on server once and connect to correct&amp;nbsp;portal.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Upgrade to latest version of arcgis package. No other changes to conda env.&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; font-weight: inherit;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Only:&amp;nbsp;&lt;SPAN style="border: 0px currentColor; font-weight: inherit;"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Write my script.&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Set up a Windows Scheduled task to use service account and run script with highest privileges&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Grant service account logon-as-service/RDP access&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Cross my fingers, and ..&lt;/LI&gt;&lt;/UL&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Boom everything worked.&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;Now, on server 2, where I did the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="border: 0px currentColor; font-weight: inherit; text-decoration: underline;"&gt;&lt;EM style="border: 0px currentColor; font-weight: bold; "&gt;&lt;STRONG&gt;exact same thing&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;, same script, same tasks, same service account, nothing happens.&lt;/P&gt;&lt;UL style="padding: 0px 0px 0px 30px; border: 0px currentColor; background-color: #ffffff;"&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Can't run Python as service account. That gives me an Application Error&amp;nbsp;0xs0000022.&lt;P style="border: 0px currentColor; font-weight: inherit;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;The application was unable to start correctly (0xc0000022). 
Click OK to close the application.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI style="margin: 0.5ex 0px; border: 0px currentColor; font-weight: inherit;"&gt;Inside Pro (running as srv account), I can&amp;nbsp;open Python window but when I import arcpy, I get:&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;PermissionError: [Errno 13] Permission denied:
 'C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\
envs\\arcgispro-py3\\Lib\\site-packages\\mkl_fft\\__init__.py'
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="border: 0px currentColor; background-color: #ffffff;"&gt;What am I doing wrong, what step did I skip or screw up on ? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:25:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/325369#M25312</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-11T15:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python Application Error 0xs0000022 when run with service account</title>
      <link>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1537742#M72816</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/237415"&gt;@Arne_Gelfert&lt;/a&gt;&amp;nbsp;Did you ever find a solution to this?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 13:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1537742#M72816</guid>
      <dc:creator>awdowner</dc:creator>
      <dc:date>2024-09-12T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Application Error 0xs0000022 when run with service account</title>
      <link>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1562513#M73249</link>
      <description>&lt;P&gt;Sorry only seeing this now. But it's been a few years and countless upgrades since. I know I got it to work eventually and suspect it must have been service account permissions or something like that. Sorry to not be of more help.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 02:23:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1562513#M73249</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2024-11-26T02:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python Application Error 0xs0000022 when run with service account</title>
      <link>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1562517#M73250</link>
      <description>&lt;P&gt;Often times when running a script with a service account, the licensing information for ArcGIS Pro is not configured correctly.&amp;nbsp; Whereas ArcGIS Desktop/ArcMap was licensed at the machine level, ArcGIS Pro is licensed at the user level.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 04:35:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-application-error-0xs0000022-when-run-with/m-p/1562517#M73250</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-11-26T04:35:12Z</dc:date>
    </item>
  </channel>
</rss>

