Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate gdb fails at step 3.9 #101

Open
wgs-asteely opened this issue Mar 15, 2024 · 31 comments
Open

Validate gdb fails at step 3.9 #101

wgs-asteely opened this issue Mar 15, 2024 · 31 comments

Comments

@wgs-asteely
Copy link

Everything works great up to step 3.9, as below. I've run the tool successfully on several other gdbs. Not sure why this one is failing. One possibility is that the entries in MapUnit are kinda long...several are 8 characters, e.g. "Mv(gssc)". That's honestly the only thing I can see is different about this compared to other succesful runs.

Start Time: Friday, March 15, 2024 12:25:18 PM
This version of the tool is up to date: GeMS_ValidateDatabase.py, version of 11/28/2023

{omitted for clarity]

3.9 No unnecessary map units in DescriptionOfMapUnits
Traceback (most recent call last):
File "J:\geologic_mapping\methods_tools_instructions\GeMS\gems-tools-pro-2.12.9\Scripts\GeMS_ValidateDatabase.py", line 1716, in
dmu_path = db_dict["DescriptionOfMapUnits"]["catalogPath"]
File "J:\geologic_mapping\methods_tools_instructions\GeMS\gems-tools-pro-2.12.9\Scripts\GeMS_ValidateDatabase.py", line 1624, in main
for f in dmu_fields:
File "J:\geologic_mapping\methods_tools_instructions\GeMS\gems-tools-pro-2.12.9\Scripts\GeMS_ValidateDatabase.py", line 447, in check_map_units
# find all tables that have MapUnit-y field names
IndexError: list index out of range
Failed script Validate Database...
Failed to execute (ValidateDatabase).
Failed at Friday, March 15, 2024 12:25:58 PM (Elapsed Time: 40.23 seconds)

screenshot of DMU table attached

@ethoms-usgs
Copy link
Collaborator

Ok, I don't think it's the length. MapUnit is built by default in all tables with a length of 10 characters, and I don't think there is a reason it can't be modified to be longer. I also think parentheses should be ok, so I don't know off-hand what's triggering the error. Have you used those before?

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 18, 2024 via email

@ethoms-usgs
Copy link
Collaborator

Have you checked both fields for leading or trailing empty spaces?

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 18, 2024 via email

@ethoms-usgs
Copy link
Collaborator

Sorry, Alex. I didn't look super closely at the error message at first, but the report suggests to me that Arc is running a cached version of the script and may not be the most recent. See in the error message how it says that the error is happening when it hits line 447? That line is a comment; it can't trigger an error. This can happen when the application does not know about a new version that should replace a cached version. Can you close everything down and then try again?

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 19, 2024 via email

@ethoms-usgs
Copy link
Collaborator

Ok. Thanks for trying that. Can you send me the gdb?

@wgs-asteely
Copy link
Author

Sure. Thanks so much for taking a look! I'm attaching here...
KittitasEastKittitas_geologicmap_14MAR2024.gdb.zip

@ethoms-usgs
Copy link
Collaborator

Odd, I just ran the tool on it and there were no code errors. When you downloaded the new toolbox, did you completely replace the older folder? Also, try downloading to a new empty folder in a different location and try it from there.

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 20, 2024 via email

@wynaut
Copy link
Contributor

wynaut commented Mar 20, 2024

I am also not able to replicate the error... Interestingly, I'm not even able to trigger rule 3.9 on purpose on this one -- nonsense units added to the DMU get totally skipped over! It's also not flagging the null values in DescriptionSourceID (Ql, hy).

I thought it might have something to do with having 'geologicmap' in the gdb name (since that's also the feature dataset's name), or with Windows' path length limit. But no...

@ethoms-usgs
Copy link
Collaborator

Should have looked at ESRI earlier:

https://community.esri.com/t5/arcgis-pro-questions/scripting-tool-does-not-return-line-error/td-p/1262701

Alex, what version of Pro are you on? They say this bug has been addressed in 3.2

@ethoms-usgs
Copy link
Collaborator

@wynaut, uh oh, really? I get validation errors when I add an unused unit and it catches null values in _ID

image

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 20, 2024 via email

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 20, 2024 via email

@ethoms-usgs
Copy link
Collaborator

But the gdb is fine for me. Weird.

Try this. Paste the text below into a file with any name and a .py extension (I called it validate_this.py)

import arcpy

arcpy.ImportToolbox(r"C:\AAA\gems\gitspace\gems-tools-pro\GeMS_Tools.tbx")
arcpy.GEMS.ValidateDatabase(
    r"C:\AAA\gems\testing\kittitas\KittitasEastKittitas_geologicmap_14MAR2024.gdb",
    r"C:\AAA\gems\testing\kittitas",
    None,
    None,
    False,
    True,
    False,
    False,
    True,
    True)

Change the parameters as you need them. You will have to follow along with the parameter form to figure out what each one controls. Be sure to leave the r in front of the file paths.

Open the Python Command Prompt under ArcGIS at Windows Start
image

and cd to the folder where you saved that file. Then type

python validate_this.py

(arcgispro-py3) C:\AAA\gems\testing\kittitas>python validate_this.py

My guess is that the code/error mismatch is happening in Pro, with how Pro manages python. But I suspect that the actual installation of python is fine.

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 21, 2024 via email

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 26, 2024 via email

@wynaut
Copy link
Contributor

wynaut commented Mar 26, 2024

@wynaut, uh oh, really? I get validation errors when I add an unused unit and it catches null values in _ID

image

@ethoms-usgs I tried experimenting further with my "unbreakable 3.9" finding, but it's not happening now -- restarting everything between Tuesday and today must have fixed it somehow...
However, the second half of my comment remains true -- I thought that something weird was happening here due to the use of MapUnitOverlayPolys specifically, but I think it's more general. I'll open a separate issue.

@ethoms-usgs
Copy link
Collaborator

And what is the version of the new install of Pro on the new computer?
If you are now at 3.2 and still get the same error, the only thing I can think of is to copy all feature classes and tables to a new gdb.

Or contact ESRI

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 26, 2024 via email

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 27, 2024 via email

@ethoms-usgs
Copy link
Collaborator

Is this with a copy of the gdb created on your machine?
Are you still getting the same error you first reported?

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 27, 2024 via email

@ethoms-usgs
Copy link
Collaborator

Do the other gdbs on which the tool has run successfully have point feature classes? Is it just point feature classes that have a MapUnit field?

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 27, 2024 via email

@ethoms-usgs
Copy link
Collaborator

What a puzzle. But I still cannot reproduce the error and we still don't have an error with a line number that makes sense.

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 28, 2024 via email

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 28, 2024 via email

@wgs-asteely
Copy link
Author

wgs-asteely commented Mar 29, 2024 via email

@ethoms-usgs
Copy link
Collaborator

ethoms-usgs commented Apr 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants