arcrest sample create_replica_portal_sample proxy error

1795
2
Jump to solution
07-25-2016 05:59 AM
BertKraan1
Occasional Contributor III

I've managed to get the create_replica_portal_sample working on my desktop https://github.com/Esri/ArcREST/blob/master/samples/create_replica_portal_item.py

however in production it needs to run on a server through a proxyserver.

All I can get is the error "URLError: <urlopen error Tunnel connection failed: 407 Proxy Authorization Required>"

I suspect the magic should happen by filling in the securityinfo dict in the right way but can someone shine some light on this?

without proxy, on my desktop, it's:

securityinfo{'securitytype':'Portal','username':'myagolusername','password':'myagolpassword'}

I can fill in the proxy_url and proxy_port but that doesn't work. I suspect I need to authenticate myself on the proxyserver.

I did so in another script where I used the form 'http://mynetworkaccount:mynetworkpassword@proxyserver.com:proxyportmynetworkpassword@proxyserver.com:proxyport' but that used urllib2.ProxyHandler and I do not know how to translate that to this case.

Any help, as you all know, is greatly appreciated.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BertKraan1
Occasional Contributor III

Solved.

It turned out that the server having the problem has an (redundant and faulty) environment setting for proxy.

urllib reads that and acts upon the faulty settings.

Removing the environment setting and rebooting the server solved the problem.

View solution in original post

2 Replies
BertKraan1
Occasional Contributor III

Hmm, found issue: HTTP Error 407 · Issue #126 · Esri/ArcREST · GitHub​ and proposed solution in that thread. Will ask IT for permission to test this.

0 Kudos
BertKraan1
Occasional Contributor III

Solved.

It turned out that the server having the problem has an (redundant and faulty) environment setting for proxy.

urllib reads that and acts upon the faulty settings.

Removing the environment setting and rebooting the server solved the problem.