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.
Is there any mismatch of python versions/ environments between the two environments? What python version are you using?
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.
Did you find a solution to this? I get the same error, but am actually running the script on the ArcGIS machine, not remote
Hi,
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.