Select to view content in your preferred language

ArcGISProject.importDocument(mxd_path) hangs on broken datasource

210
3
Jump to solution
3 weeks ago
HVN
by
New Contributor II

I'm working on a Python script that import mxd files with the importDocument function. The Python script is ran outside ArcGIS Pro using the default arcgispro-py3 environment, and the MXD datasources link to underlying geodatabases (Oracle geodatabase if that matters) that I do not have access to.

When I'm using the function, the process seems to take forever and never end. Launching the same script in the ArcGIS Pro console, I get windows asking for credentials which I just press on "Cancel", and the map document is properly imported to the project with broken datasources.

I believe that I have encountered the same issue when the MXD references MapService/FeatureService with SSL certificate errors.

Is there any way to use the import function that would behave the same way (or ignore datasources)?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
HVN
by
New Contributor II

I took a quick look at the log of the diagonistic monitor. What seems to happen is that when using the import function, ArcGIS try to connect to the underlying DBMS with retries (around 5) before ignoring the datasource and importing it to the project.

In the case of Oracle, ArcGIS use the Oracle Client to connect to the DBMS. For some reasons, the connection attempt takes way longer before failing (more than 45s per attempt) whereas it fails almost immediatly on Postgres. Turning on the SQL*NET traces, we can notice that Oracle takes its sweet time to return an error message, with for example the following messages repeating for more than one hour...

nnfun2a: address for name "*******" not found
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001

I tried modifying the parameters through sqlnet.ora first with some success, but finally decided on straight up removing the client from my PATH environment variable.

View solution in original post

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

check isBroken in the layer class

Layer—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
TonyAlmeida
Occasional Contributor III

Can you share your current code, so we can see what you have going on?

0 Kudos
HVN
by
New Contributor II

I took a quick look at the log of the diagonistic monitor. What seems to happen is that when using the import function, ArcGIS try to connect to the underlying DBMS with retries (around 5) before ignoring the datasource and importing it to the project.

In the case of Oracle, ArcGIS use the Oracle Client to connect to the DBMS. For some reasons, the connection attempt takes way longer before failing (more than 45s per attempt) whereas it fails almost immediatly on Postgres. Turning on the SQL*NET traces, we can notice that Oracle takes its sweet time to return an error message, with for example the following messages repeating for more than one hour...

nnfun2a: address for name "*******" not found
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001
snlinGetAddrInfo: getaddrinfo() failed with error 11001

I tried modifying the parameters through sqlnet.ora first with some success, but finally decided on straight up removing the client from my PATH environment variable.

0 Kudos