Backup.py fails when executed remotely

593
2
03-12-2021 06:57 AM
jorisfrenkel
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\Backup.py", line 202, in <module>
sys.exit(backup())
File "C:\Program Files\ArcGIS\Server\tools\admin\Backup.py", line 75, in backup
token = getToken(serverName, serverPort, protocol, tokenURL, username, password)
File "C:\Program Files\ArcGIS\Server\tools\admin\Backup.py", 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
2 Replies
JeffK
by MVP Regular Contributor
MVP Regular Contributor

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

0 Kudos
jorisfrenkel
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