Underlying DBMS error caused by query for null GlobalID

571
9
Jump to solution
11-16-2023 06:36 AM
Labels (1)
HanliePetoors
New Contributor III

Hi,

We are working in ArcGIS Enterprise 10.8.1 on Windows.

We are getting an error in our ArcGIS Server Log:

HanliePetoors_1-1700144954158.png

When we trace that back to the IIS logs via the Site admin logs, we find a query in the IIS logs like this:

 cs-uri-query:

 f=json&where=GlobalID%3D%27null%27&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=OBJECTID%2CSGCode%2CCadastreDate%2CGlobalID%2Ccreated_user%2Ccreated_date%2Clast_edited_user%2Clast_edited_date&token=c4UIGaj-ZopDMQJcAELgDnEKunP5qxETc69ijuEVynAEnhrcIRUymSiUVDUHdDv2R-9tolTAuLLSUi4DEoISRI99Hf0cIq2x2uBjGYqbV2YQo0re7HutHbQ_494kGht6cz6LM-sKJO3Dm582mm0DOnJCX8jhsk4QigQWd3rXCkio_VWy_yEuB2jP26al3RvOPv0K_sxvgGhEth8h-5IU9Mo2sPzoA1ZfHGQuzhdDjDgNd0vjViYwRdNYNOA9vszGnIqoC3LD0UIJV6QT7Rz33P9uLVA-B6rHTxVjLBNQPsI.

 

This translates to whereGlobalID="null", which seems to be the generator of this error.

Does anybody know where this is coming from and if we can do anything to prevent it from occurring?

Thanks

0 Kudos
1 Solution

Accepted Solutions
MarceloMarques
Esri Regular Contributor

I recommend you open a ticket with Esri Tech Support to investigate further.

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov

View solution in original post

0 Kudos
9 Replies
MarceloMarques
Esri Regular Contributor

You can check the source data in the SQL Server Geodatabase, open SQL Server Management Studio (SSMS) and run a SQL query against the Featureclass table to find if there are any rows where GlobalID is null.

Note: 

Where GlobalID="null"      ( this is searching for a string value "null" and not searching for NULL values )

Where GlobalID is NULL  ( this is searching for NULL values )

If the Featureclass is branch versioned then you can query using ArcGIS Pro or via SSMS.

If the Featureclass is registered as traditional version and you have versions child of sde.default, then some data might still be in the delta tables after the reconcile and post to sde.default and only a sde compress will move the rows from the delta table to the base table, hence you can query the Featureclass using ArcGIS Pro or you can use the Featureclass EVW view (multi versioned view) instead of the Featureclass base table.

I hope this helps.

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
MarceloMarques
Esri Regular Contributor

MarceloMarques_0-1700172554409.png

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
MichaelMorgan4
Occasional Contributor

There is a query somewhere in the Capture_Field_Card map service that is checking the GlobalID field for the string 'null', but GlobalID is not a string field, it is a "UniqueIdentifier" type. This field should also be set with a "not null" constraint, meaning that no value in the GlobalID field would be null. To check for null values, the query should be "WHERE <field> IS NULL" (capitalization not necessary).

MarceloMarques
Esri Regular Contributor

@MichaelMorgan4 - good catch! 👍

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
HanliePetoors
New Contributor III

Thanks to everyone who replied.

I understand that the where clause is malformed but I don't know where it's coming from.

The GlobalID field is an Esri GlobalID so it is virtually impossible for it to be NULL.

I want to say that I would not formulate a query comparing a GlobalID to a string, but I guess this is not impossible. So I checked all the views in the database, and I checked all the layers in the map service for definition queries. I also checked the SQL Server Agent Jobs that work on the feature classes and tables contained in that feature service. Cannot find any where GlobalID="null" clauses.

This seems to be coming from the Esri innards. I have two attribute rules using the intersect operator in the web app that uses this feature service but they only refer to two text fields.

The feature classes and tables in the feature service are not versioned.

The malformed where clause is in the IIS log, so it is being sent from the web application (Web App Builder custom application) to the ArcGIS Server.

I really have no idea where that where clause is coming from.

0 Kudos
MarceloMarques
Esri Regular Contributor

@HanliePetoors you have the service name in the ArcGIS Server Log "Validation/Capture_Field_Card.MapServer" and if you know that this belongs to the Web App Builder Custom Application, then someone can look into the Web Application source code to try to find out why the issue is happening.

MarceloMarques_0-1700239891940.png

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
HanliePetoors
New Contributor III

Hi @MarceloMarques ,

Sorry I wasn't accurate when I said that it's a custom web app. I meant that it's not an instant app, it's a configured web app using the web app builder. No custom code involved.

 

Regards

Hanlie

0 Kudos
MarceloMarques
Esri Regular Contributor

I recommend you open a ticket with Esri Tech Support to investigate further.

| Marcelo Marques | Principal Product Engineer | Esri |
| Cloud & Database Administrator | OCP - Oracle Certified Professional |
I work with Enterprise Geodatabases since 1997.
“ I do not fear computers. I fear the lack of them." Isaac Isimov
0 Kudos
HanliePetoors
New Contributor III
Thanks, will do that.
Regards
Hanlie
0 Kudos