AnsweredAssumed Answered

Map deploy with Python and Jenkins

Question asked by PottyProgrammer on Mar 7, 2016
Latest reply on Mar 9, 2016 by PottyProgrammer

I have a great little Python script that works fabulously to deploy map services and register data sources.  It works well on my PC, in Pyscripter and from the command line but only works in Pyscripter on the server, where I wish to have a Jenkins job do the deployment.

When run from the command line on the server it returns "Cannot connect to database", in Pyscripter it just works.

If anyone has a clue why this could be, it does not appear to be a user and permission issue.


Output from Pyscripter:

Command Line : DEV


The following information was returned during analysis of the MXD:


     Layer draws at all scale ranges  (CODE 30003)

       applies to: Bid Points Bid Lines Bid Points Bid Lines



Service BIDS, successfully published

Executing: UploadServiceDefinition "C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY\MXD\" "C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY\MXD\serverconnection.ags" # # FROM_SERVICE_DEFINITION # STARTED USE_DEFINITION NO_SHARE_ONLINE PRIVATE NO_SHARE_ORGANIZATION #

Start Time: Fri Mar 18 13:40:44 2016



Executing (Publish Service Definition): PublishServiceDefinition i6cdf6dfc-7490-426c-a096-4f8e77852141 # {"buildInitialCache":false} #

Start Time: Fri Mar 18 13:40:45 2016

Validating publish options.

Connecting to the server.

Getting basic item metadata for service definition upload.

Getting server information (server folders, data stores, etc.).

Extracting manifiest from uploaded service definition.

Deriving arcgis server service from hosted service (hosted service definition).

Validating service definition.

Determining service's input folder name.

Attempt to find service's input folder.

Creating the service.

Adding item information card to service.

Updating file and folder information in service's manifest.

Updating database information in service's manifest.

Adding manifest to configuration store.

Building the service URLs.

Succeeded at Fri Mar 18 13:41:17 2016 (Elapsed Time: 32.17 seconds)


Succeeded at Fri Mar 18 13:41:17 2016 (Elapsed Time: 33.10 seconds)


Output from Command line:

C:\Program Files (x86)\Jenkins\workspace\MAP-DEPLOY>python MXD\ DEV

Cannot open server connection to database.


Also see comments below