POST
|
Hello Morten and Chad. I've uploaded Chad's crash dump to: Dropbox - CrashDump.zip Please let me know if you have any troubles downloading it.
... View more
01-26-2017
07:40 AM
|
0
|
0
|
2701
|
POST
|
Hi, Gareth. Many times when we see this error (which, it seems, can crop up for a variety of reasons that, I guess, don't show up in the analysis), it's ends up being a problem with the data (as when a layer references an SDE source to which it can't connect, or something like that). Have you tried the solutions documented here? Also, we had some problems with staging during the transition from 10.3 to 10.4: If I recall correctly, an MXD saved in ArcMap 10.3 would fail during the stage if an arcpy script running under 10.4 tried to publish from it.
... View more
11-10-2016
03:21 PM
|
1
|
1
|
852
|
POST
|
I am using arcpy.UploadServiceDefinition_server to publish an MXD to an on-premise Portal for ArcGIS 10.4.1 (ArcGIS Server 10.4.1 is installed and federated with the portal). I have created a script based on this example. I have also been using this documentation (especially example 3) to guide me. My goal is to share the published services with a group defined on the Portal server, but so far every time I publish, the feature layer is "Not Shared". Here is an example of my UploadServiceDefinition call: arcpy.UploadServiceDefinition_server(
"myMapService.sd", # in_sd_file
"myServerConnection.ags", # in_server
"newServiceName", # in_service_name
"", # in_cluster
"", # in_folder_type
"", # in_folder
"STARTED", # in_startupType
"OVERRIDE_DEFINITION", # in_override
"SHARE_ONLINE", # in_my_contents
"PRIVATE", # in_public
"NO_SHARE_ORGANIZATION", # in_organization
"My Group" # in_groups
) I have also tried changing the in_groups parameters to a list, like so: arcpy.UploadServiceDefinition_server(
"myMapService.sd", # in_sd_file
"myServerConnection.ags", # in_server
"newServiceName", # in_service_name
"", # in_cluster
"", # in_folder_type
"", # in_folder
"STARTED", # in_startupType
"OVERRIDE_DEFINITION", # in_override
"SHARE_ONLINE", # in_my_contents
"PRIVATE", # in_public
"NO_SHARE_ORGANIZATION", # in_organization
["My Group"] # in_groups
) But, so far, no matter what parameters I supply that seem to apply to sharing, the feature layer is always "Not Shared" after publishing. Am I missing something fundamental? If anyone can point me toward the light I would be most appreciative.
... View more
07-22-2016
10:48 AM
|
0
|
1
|
2379
|
POST
|
Hello. I have an arcpy script that can draft, stage, and upload a service on Machine A, but which fails during staging on Machine B when I get to the point where I call arcpy.server.StageService(). Here is the error: arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data filed. Failed to execute(StageService). Machine A is running ArcGIS 10.2 while Machine B is running 10.2.2. I have created the simplest possible map document that I know how to create and modified it to the point that Machine A can publish it without errors, messages, or warnings. Neither Machine A nor Machine B report any errors during the analysis of the draft, though Machine B seems to report a warning that Machine A does not: "Layer is using unsupported label settings (KML) (CODE 20032)". Having said that, I should mention that I don't have any unusual labeling effects (of which I'm aware), and according to this document, you can simply "Do nothing" when you see it because "the effects not supported by KML will be ignored by the KML service". From Machine A, I can draft, stage, and upload the map to the ArcGIS Server instance on Machine B, but I get the exception noted above when I attempt to run the same script, against the same data, on Machine B. On both machines, the data is stored in the same directory (ie. all the file paths are the same). I have done much research (reviewing ESRI docs, older posts, etc.) trying to figure out what might be causing this behavior and what I must correct to make it work. For example, I have followed the advice in this document, but to no avail. So far, though, I am still unable to get around this error. I have attached my test script to this post, and also pasted it below. I believe that the test script I am running is just about the least-exotic possible example of publishing a map service using arcpy, and I am at a loss to determine why Machine B is unhappy. Any advice you may be able to provide would be greatly appreciated. Many thanks. (Script Follows) import arcpy
import arcpy.mapping
import arcpy.server
import os, ntpath, sys
# See which python version we're running.
print sys.executable # C:\Python27\ArcGISx6410.2\python.exe
mxd = "C:\\MapData\\Main.mxd"
working_dir = "C:\\Temp"
connection_file_name = "my_ags.ags"
connection_file_path = ntpath.join(working_dir, connection_file_name)
draft_file_path = "C:\\Temp\\my_draft.sddraft"
service_def_file_path = draft_file_path[:-5]
server_url = "http://MYSERVER:6080/arcgis/admin"
service_name = "Main"
folder = "MyFolder"
# Remove the files created by previous runs.
for f in [ connection_file_path, draft_file_path, service_def_file_path ]:
if ntpath.isfile(f):
os.remove(f)
print("Creating the connection file.")
# Create the connection file.
arcpy.mapping.CreateGISServerConnectionFile(connection_type='ADMINISTER_GIS_SERVICES',
out_folder_path=working_dir,
out_name=connection_file_name,
server_url=server_url,
server_type='ARCGIS_SERVER',
use_arcgis_desktop_staging_folder=False, # Don't use an ArcGIS desktop staging folder.
staging_folder_path=working_dir,
username='myuser',
password='mypassword',
save_username_password='SAVE_USERNAME')
# Create the draft.
print("Creating the draft.")
analysis = arcpy.mapping.CreateMapSDDraft(mxd,
draft_file_path,
service_name,
'ARCGIS_SERVER',
connection_file_path,
False,
folder,
'summary',
'tags')
# Perform the analysis.
print("Here comes the analysis...")
for key in ('messages', 'warnings', 'errors'):
print "----" + key.upper() + "---"
vars = analysis[key]
for ((message, code), layerlist) in vars.iteritems():
print " ", message, " (CODE %i)" % code
# I've redacted the affected layers from the output just to make it a little
# easier to read, but here's the code...
# print " applies to:",
# for layer in layerlist:
# print layer.name,
# print
# Stage the draft.
print("Staging the draft.") # Machine B fails at the next line...
arcpy.server.StageService(in_service_definition_draft=draft_file_path,
out_service_definition=service_def_file_path)
# Upload the service.
print("Uploading the service.")
arcpy.server.UploadServiceDefinition(service_def_file_path,
connection_file_path)
... View more
06-05-2015
11:10 AM
|
0
|
3
|
5641
|
Title | Kudos | Posted |
---|---|---|
1 | 11-10-2016 03:21 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|