BLOG
|
Thank You Xander Bakker! I was afraid that was going to be the answer.
... View more
06-05-2019
10:01 AM
|
0
|
0
|
5168
|
BLOG
|
Is there a way to access and attribute using Arcade of a polyline that is coincident to another polyline. It seems the 'intersects' function selects using a polygon boundary. I'm looking for something that is going to select the polyline directly under the clicked on point of the selected polyline.
... View more
06-05-2019
08:36 AM
|
0
|
0
|
5288
|
DOC
|
Yes the database is version 10.6.1 also. Unfortunately we do not have another 10.6.1 database feeding services with which to use for testing. Thanks for all you assistance and suggestions.
... View more
11-16-2018
09:18 AM
|
0
|
0
|
18965
|
DOC
|
Thanks Jake. All the parameters matched up. Something in 10.6.1 is causing it to fail. Works fine in 10.6.0. I'll keep searching.
... View more
11-16-2018
06:53 AM
|
0
|
0
|
18965
|
DOC
|
Jake, Why would the code behave differently between the GP tool and running script? Still perplexed as to why this will not work at 10.6.1. Michael
... View more
10-29-2018
07:27 AM
|
0
|
0
|
18965
|
DOC
|
Have not tried it as the GP tool. We have been using it just running the script. It worked before we upgraded out Roads and Highways/Workflow manager environment to 10.6.1. Out Dev/UAT environment running 10.6 works fine using the scripts.
... View more
10-19-2018
07:04 AM
|
0
|
0
|
18965
|
DOC
|
import arcpy, smtplib, sys, time
from arcpy import env
env.overwriteOutput = 1
# Start time
startTime = time.clock()
# Variables
# UAT connection
#adminConnection = r"\\ITDHQ1FSP07\GISServer\RoadsHighwaysScripts\Connections\SDE@RHGDB_UAT.sde"
# Prod connection
adminConnection = r"\\ITDHQ1FSP07\GISServer\RoadsHighwaysScripts\Connections\SDE@RHGDB.sde"
federatedAGS = True # this is configured specifically for ITD's Roads and Highways setup
portalServer = 'itdhq1app114.itd.state.id.us'
#portalServer = 'itdhq1apu07.itd.state.id.us'
portalUsername = 'PortalAdmin'
portalPassword = 'XXXXXXX'
agsServer = 'itdhq1app112.itd.state.id.us'
#agsServer = 'itdhq1apu05.itd.state.id.us'
serverPort = 6443
agsUsername = ''
agsPassword = ''
deleteVersions = True
reconcileLog = r'\\ITDHQ1FSP07\GISServer\RoadsHighwaysScripts\logs\CompressTool_Log.txt'
sendEmail = True
emailFrom = 'michael.miller@itd.idaho.gov'
emailTo = ['michael.miller@itd.idaho.gov','Nicole.Hanson@itd.idaho.gov']
smtpServer = '10.1.9.67'
smtpPort = 25
# Function to get current State ID
def getStateID(adminConnection):
egdb_conn = arcpy.ArcSDESQLExecute(adminConnection)
sqlDBO = '''SELECT state_id FROM dbo.sde_states'''
sqlSDE = '''SELECT state_id FROM sde.sde_states'''
sqlORCL = '''SELECT state_id FROM sde.states'''
try:
state_id = egdb_conn.execute(sqlDBO)
except:
pass
try:
state_id = egdb_conn.execute(sqlSDE)
except:
pass
try:
state_id = egdb_conn.execute(sqlORCL)
except:
pass
try:
state_id = int(state_id)
except:
state_id = int(state_id[-1][0])
arcpy.AddMessage("Current State ID: " + str(state_id))
return state_id
# Function to send e-mail
def email(Subject,Msg):
email_Subject = Subject
email_Msg = Msg
email_From = emailFrom
email_To = emailTo
emails = ''
# take the email list and use it to send an email to connected users.
for email in email_To:
emails += email + "; "
emails = str(emails.replace(",", ";"))
# normalize newlines to CR+LF, as required by SMTP
headers = (('From', email_From),
('To', emails),
('Subject', email_Subject))
body = email_Msg.replace("\r\n", "\n").replace("\n", "\r\n")
msg = '\r\n'.join("%s: %s" % kv for kv in headers) + '\r\n'*2 + body
# Send the mail
server = smtplib.SMTP(host=smtpServer, port=int(smtpPort))
server.sendmail(email_From, email_To, msg)
# Get Current State ID
current_state_id = getStateID(adminConnection)
# Stop AGS services
arcpy.AddMessage("Stopping all ArcGIS Server services")
if federatedAGS:
import StopStartServices_Federated
StopStartServices_Federated.Services(portalServer, agsServer, serverPort, portalUsername, portalPassword, "STOP")
else:
import StopStartServices
StopStartServices.Services(agsServer, serverPort, agsUsername, agsPassword, "STOP")
# Block new connections to the database.
arcpy.AddMessage("Blocking new connections to the database")
arcpy.AcceptConnections(adminConnection, False)
# Disconnect all users
arcpy.AddMessage("Disconnecting all users from database")
arcpy.DisconnectUser(adminConnection, "ALL")
# Get a list of versions to pass into the ReconcileVersions tool.
arcpy.AddMessage("Getting list of all versions")
versionList = arcpy.ListVersions(adminConnection)
for version in versionList:
if 'default' in version.lower():
if 'dbo' in version.lower():
defaultVersion = 'dbo.DEFAULT'
elif 'sde' in version.lower():
defaultVersion = 'sde.DEFAULT'
# Execute the ReconcileVersions tool.
arcpy.AddMessage("Reconciling/posting LockRoot to Default")
if deleteVersions:
try:
arcpy.ReconcileVersions_management(adminConnection, "ALL_VERSIONS", "sde.DEFAULT", "ITDRH.LockRoot", "LOCK_ACQUIRED", "ABORT_CONFLICTS", "BY_OBJECT", "FAVOR_TARGET_VERSION", "POST", "KEEP_VERSION", reconcileLog)
except:
reconcileMessage = "Reconcile failed: " + arcpy.GetMessages() + ". Check reconcilelog.txt file in the " + str(reconcileLog)
if sendEmail:
email("Reconcile failed", reconcileMessage)
arcpy.AddWarning(reconcileMessage)
pass
else:
try:
arcpy.ReconcileVersions_management(adminConnection, "ALL_VERSIONS", "sde.DEFAULT", "ITDRH.LockRoot", "LOCK_ACQUIRED", "ABORT_CONFLICTS", "BY_OBJECT", "FAVOR_TARGET_VERSION", "POST", "KEEP_VERSION", reconcileLog)
except:
reconcileMessage = "Reconcile failed: " + arcpy.GetMessages() + ". Check reconcilelog.txt file in the " + str(reconcileLog)
if sendEmail:
email("Reconcile failed", reconcileMessage)
arcpy.AddWarning(reconcileMessage)
pass
# Run the compress tool.
arcpy.AddMessage("Running compress")
try:
arcpy.Compress_management(adminConnection)
arcpy.AddMessage("Compress was successful")
compressMessageSuccess = 'True'
except Exception, e:
compressMessage = 'Compress failed: ' + arcpy.GetMessages() + ". Please check the sde.COMPRESS_LOG file within the geodatabase"
if sendEmail:
email("Compress failed", compressMessage)
arcpy.AddWarning(compressMessage)
pass
arcpy.AddMessage("Rebuild indexes")
try:
arcpy.RebuildIndexes_management(adminConnection, "SYSTEM", "", "ALL")
arcpy.AddMessage("Rebuild was successful")
arcpy.AddMessage("Rebuild Complete")
rebuildMessageSuccess = 'True'
except:
rebuildMessage = "Rebuild failed: " + arcpy.GetMessages() + ". Check reconcilelog.txt file in the " + str(reconcileLog)
if sendEmail:
email("Rebuild failed", rebuildMessage)
arcpy.AddWarning(rebuildMessage)
pass
arcpy.AddMessage("Analyze datasets")
try:
arcpy.AnalyzeDatasets_management(adminConnection, "SYSTEM", "", "ANALYZE_BASE", "ANALYZE_DELTA", "ANALYZE_ARCHIVE")
arcpy.AddMessage("Analyze was successful")
arcpy.AddMessage("Analyze Complete")
analyzeMessageSuccess = 'True'
except:
analyzeMessage = "Analyze failed: " + arcpy.GetMessages() + ". Check reconcilelog.txt file in the " + str(reconcileLog)
if sendEmail:
email("Rebuild failed", analyzeMessage)
arcpy.AddWarning(analyzeMessage)
pass
# Allow the database to begin accepting connections again
arcpy.AddMessage("Allow users to connect to the database again")
arcpy.AcceptConnections(adminConnection, True)
# Clear workspace cache
arcpy.ClearWorkspaceCache_management()
# Start AGS services
if federatedAGS:
arcpy.AddMessage("Starting services again")
StopStartServices_Federated.Services(portalServer, agsServer, serverPort, portalUsername, portalPassword, "START")
else:
import StopStartServices
StopStartServices.Services(agsServer, serverPort, agsUsername, agsPassword, "START")
# Get New State ID
new_state_id = getStateID(adminConnection)
# Email succcessful compression results
endTime = time.clock()
elapsedTime = (endTime - startTime) / 60
message = "Previous State ID: " + str(current_state_id) + "\nCompressed completed in " + str(elapsedTime) + " mins. \nNew State ID: " + str(new_state_id)
if compressMessageSuccess:
if sendEmail:
email("Successful PROD compress", message)
... View more
10-18-2018
12:43 PM
|
0
|
0
|
18965
|
DOC
|
Jake, We've recently upgraded our systems to 10.6.1 and I'm now having issues with running the compress tools. I'm not sure why the SSL Wrong Version Number error is appearing? Any ideas? C:\Users\Mimiller\Source\Workspaces\HWY-GIS\RoadsAndHighways\env\Scripts\python.exe "C:/Users/Mimiller/Source/Workspaces/HWY-GIS/RoadsAndHighways/Scripts/DatabaseMaint/Compress Database State 0.py"
Current State ID: 15019
Stopping all ArcGIS Server services
STOPing services.
Traceback (most recent call last):
File "C:/Users/Mimiller/Source/Workspaces/HWY-GIS/RoadsAndHighways/Scripts/DatabaseMaint/Compress Database State 0.py", line 99, in <module>
StopStartServices_Federated.Services(portalServer, agsServer, serverPort, portalUsername, portalPassword, "STOP")
File "C:\Users\Mimiller\Source\Workspaces\HWY-GIS\RoadsAndHighways\Scripts\DatabaseMaint\StopStartServices_Federated.py", line 21, in __init__
stop_start_Service(self.portal, self.server, self.port, self.username, self.password, self.stop_start)
File "C:\Users\Mimiller\Source\Workspaces\HWY-GIS\RoadsAndHighways\Scripts\DatabaseMaint\StopStartServices_Federated.py", line 41, in stop_start_Service
token = getToken(username, password, portalName)
File "C:\Users\Mimiller\Source\Workspaces\HWY-GIS\RoadsAndHighways\Scripts\DatabaseMaint\StopStartServices_Federated.py", line 145, in getToken
response = urllib2.urlopen(req, context=gcontext)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 429, in open
response = self._open(req, data)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 447, in _open
'_open', req)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 407, in _call_chain
result = func(*args)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 1241, in https_open
context=self._context)
File "C:\Python27\ArcGIS10.6\Lib\urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:661)>
Process finished with exit code 1
... View more
10-17-2018
06:34 AM
|
0
|
0
|
18965
|
POST
|
I've been told via ESRI Architecture class, 3-5 instances per core for map services. From my experience this guideline works pretty well to provide stability and usability.
... View more
09-17-2018
05:38 AM
|
2
|
0
|
1405
|
POST
|
I believe you need to open configure Pop-up and under pop-up media add an image and add your field to URL. It should work that way.
... View more
08-15-2018
02:03 PM
|
0
|
0
|
761
|
POST
|
You might want to rethink the paths for gdb and sde, maybe create/copy the database connection to a shared location.
... View more
05-21-2018
11:53 AM
|
0
|
1
|
486
|
POST
|
Another shot, has the password changed of the account that was used to setup the Identity Store in Portal? We ran into this problem and choose to use a service account rather than a user account.
... View more
05-11-2018
08:01 AM
|
0
|
1
|
1236
|
POST
|
I echo Thomas Colson comments. Isolation of applications is key. As well as increasing the number of cores(processor) and memory per machine will do wonders.
... View more
05-04-2018
09:09 AM
|
0
|
0
|
1333
|
DOC
|
That did the trick. Thanks for the assistance @Jake Skinner!
... View more
05-03-2018
07:12 AM
|
0
|
0
|
18965
|
Title | Kudos | Posted |
---|---|---|
1 | 03-29-2012 10:22 AM | |
2 | 09-17-2018 05:38 AM | |
1 | 07-28-2017 10:44 AM | |
1 | 11-23-2015 08:40 AM | |
1 | 06-06-2016 11:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|