Publish service directly on server

414
7
09-28-2020 01:34 PM
DarrenWiens2
MVP Honored Contributor

I've been publishing services through arcpy and service definition files from a remote machine, but now want to publish services from a mosaic dataset actually stored on the ArcGIS Server machine.

Is this possible? Is there a local script on the ArcGIS Server for publishing services?

The first problem I've encountered with this plan is that arcpy installed on the server does not seem to include the mapping module, necessary for creating the connection file (which shouldn't be necessary, since I'm already on the machine): CreateGISServerConnectionFile—Help | ArcGIS for Desktop 

The rest of my workflow involves creating, staging, and uploading a service definition file.

Reply
0 Kudos
7 Replies
CalvinLietz
Esri Contributor

Hi Darren,

Is there any way you can copy a previously generated ArcGIS Server connection file from another machine to the machine running ArcGIS Server? These .ags files can be copied between machines, and should work just fine.

-Calvin

Reply
0 Kudos
DarrenWiens2
MVP Honored Contributor

Hi Calvin,

I have copied a working .ags to my server machine, however when running CreateImageSDDraft—Help | ArcGIS Desktop I see, "Unable to connect to the provided target server: https://xxx.xxx.xxx.xxx:6443/arcgis/admin/". I've tried with ags files referencing the actual server ip, as well as attempts at 127.0.0.1 and localhost. Any ideas?

Reply
0 Kudos
CalvinLietz
Esri Contributor

Darren,

If you copy the URL returned in the error message and paste it into a web browser, are you able to access the page with the credentials provided in the .ags file?

Reply
0 Kudos
DarrenWiens2
MVP Honored Contributor

Yes, I can.

Reply
0 Kudos
CalvinLietz
Esri Contributor

I have never seen that particular error message before and I see no other reports of it after a quick GeoNet search. Could you provide the full error trace stack?

Also, what Python ID are you using?

Reply
0 Kudos
DarrenWiens2
MVP Honored Contributor
Traceback (most recent call last): File "/arcgis/server/publisher/publish.py", line 175, in publish_dir self.create_sddraft(mds_name, sddraft) File "/arcgis/server/publisher/publish.py", line 95, in create_sddraft "wms_proxy," + mds_name File "/home/arcgis/miniconda2/envs/arcpy-publish/lib/python3.6/site-packages/arcpy/__init__.py", line 2119, in CreateImageSDDraft return arcgisscripting._createimageservicesddraft(raster_or_mosaic_layer, out_sddraft, service_name, server_type, connection_file_path, copy_data_to_server, folder_name, summary, tags) RuntimeError: Unable to connect to the provided target server: https://xxx.xxx.xxx.xxx:6443/arcgis/admin/‍‍

More info: using Linux Enterprise AMI on AWS EC2. Do I perhaps need to expose any outgoing ports to allow this sort of roundtrip connection?

I'm using VS Code, but running in bash terminal.

Reply
0 Kudos
DarrenWiens2
MVP Honored Contributor

I think there may be a certificate issue on the server. The resolution was to use http/port 6080 rather than https/port 6443.

Reply
0 Kudos