0

When i am trying to execute the following script from my desktop it's executing successfully, but same is not executing/not throwing error in linux

              agsPath="/sharedFolder/arcgiscon(admin).ags"
               try:
                  print "stared"
                  for item in arcpy.ListDataStoreItems(agsPath,'FOLDER'):
                      pint item
               excpet:
                      print "problem in executuion"

In linux it is printing stared but after putty is not showing any thing. My arcgis version is 10.2

What could be the reason.

3
  • 1
    Whats the actual error thrown? try adding except Exception, exc: print exc Also I am confused about putty. Are you using putty to get to the command line on the unix server and then executing a copy of the script from there? What do you mean by "printing stared"
    – Dowlers
    Nov 11 '14 at 15:21
  • 2
    Did you setup a datastore before you published? So, should that file be copied to the server when the service was published, or you have registered folders? Best guess is either the file wasnt copied, or the path isn't right in the published service. I'd get on the linux box, find the script and see where its pointing / if the AGS file is where it should be.
    – KHibma
    Nov 11 '14 at 15:41
  • It's not wise to use parenthesis in filenames on Linux.
    – Vince
    Nov 12 '14 at 2:16
1

I ran into this recently on AGS 10.4 as well, so I guess it's still relevant.

As far as I can tell, this is caused by an unverified cert in an HTTPS request, running inside of WINE--you can replicate it with just about any ArcPy call that uses a .ags connection; the call will just hang.

By default, the self-signed cert that ships with AGS is not trusted, and the server is set up to redirect all HTTP admin requests to HTTPS, so you'll see this behavior out of the box. There are two possible workarounds:

  1. Set the admin API to HTTP only; this will do away with the cert verification entirely.

  2. Add the self-signed cert to the trusted store. The procedure for this will vary by distro--this page can get you started. You can export the cert via ESRI's REST API, or you can use OpenSSL.

I've had some trouble getting update-ca-trust to work on CentOS 7, but I know the following works (pulled from a docker build script):

CERTFILE=~/sscert.pem
openssl s_client -connect localhost:6443 -showcerts && \
        /home/arcgis/server/startserver.sh && openssl x509 -inform DER -in /home/arcgis/server/framework/etc/certificates/SelfSignedCertificate.cer -out $CERTFILE && \
        cat $CERTFILE >> /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem && \
        cat $CERTFILE >> /etc/pki/ca-trust/extracted/pem/ca-bundle.trust.crt

Hopefully that will help someone...I know it took me a while to crack!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.