fails when executed remotely

03-12-2021 06:57 AM
Occasional Contributor II

I use a task on a remote server to regularly backup our ArcGIS Server site (stand alone). I use PsExec (newest version) to remotely execute it. Since a short time it stopped working with the following error:

Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Server\tools\admin\", line 202, in <module>
File "C:\Program Files\ArcGIS\Server\tools\admin\", line 75, in backup
token = getToken(serverName, serverPort, protocol, tokenURL, username, password)
File "C:\Program Files\ArcGIS\Server\tools\admin\", line 166, in getToken
params = urllib.urlencode({'username': username.decode(sys.stdin.encoding).encode('utf-8'), 'password': password.decode(sys.stdin.encoding).encode('utf-8'),'client': 'referer','referer':'backuputility','f': 'json'})
TypeError: decode() argument 1 must be string, not None

So Python does not get the encoding string sys.stdin.encoding anymore.

When I start the script on the ArcGIS machine, it runs fine.

I am not sure when this stopped working, there haven't been changes on the server except Windows updates and updates of mapservices.



Tags (3)
0 Kudos
4 Replies
by Anonymous User
Not applicable

Is there any mismatch of python versions/ environments between the two environments?  What python version are you using?

0 Kudos
Occasional Contributor II

Hi Jeff,

On the remote server Python is not installed. Both environments are Windows Server 2019.

Python 2.7.14 is installed, the version that comes with ArcGIS 10.6.1.

0 Kudos
New Contributor II

Did you find a solution to this?  I get the same error, but am actually running the script on the ArcGIS machine, not remote

0 Kudos
Occasional Contributor II


As far as I can remember, it just started working again after some time, without me doing anything in particular. I'm sorry I cannot help you with any more info.

0 Kudos