Skip to main content

I'm experiencing an issue writing into file geodatabases using the FILEGDB writer. The issue occurs when either

  1. The geodatabase has been created by ArcGIS Pro, or
  2. An existing geodatabase has had a feature class pasted using Pro, then
  3. Trying to create, or drop and create, a feature class

As with many things the problem is not always consistently apparent, but occurs much more frequently than not.

The issue shows itself by either not being able to drop and create an existing feature class, or by not being able to write a new one. Instead, a non spatial table is created with the schema, but no data. Deleting this sometimes seems to leave behind ghost feature classes that appear if the geodatabase is repaired, or if a feature class is pasted in that has the same name.

Using the GEODATABASE_FILE writer appears to be fine (but not an option for us when publishing to FME Server), and truncating and inserting into feature classes also appears to be fine (with the FILEGDB writer).

I'm using desktop 2019.1 and ArcGIS Pro 2.4, but we also had issues with Desktop 2017 and Pro 2.2 that we were never able to quite identify the source of. Now we're using Pro more it becoming more apparent. The error message looks like:

Geodatabase Error (-2147219115): The row contains a bad value.

FileGDB Writer: Could not create feature class 'Test'

A fatal error has occurred. Check the logfile above for details

Geodatabase Error (-2147418113): Unexpected operation.

FileGDB Writer: Could not disable Load Only Mode for feature type 'Test'

Geodatabase Error (-2147418113): Unexpected operation.

FileGDB Writer: Could not free Write Lock for feature type 'Test'

I'm sure there's no permissions issues. Geodatabases created with ArcCatalog (and not played around with in Pro) are fine, and using the ESRI writer is fine.

Any thoughts on this are welcome....

Hi @andrewspencer,

You need to make sure that nothing has opened the File Geodatabase. I am not sure what is your end product, but I would also look into writing to "Geodatabase API format" as plan "B".

Hope this helps.


Into Windows Explorer, you can open your GDB folder and see the locks name.

That could give you a hint about the problem. Normally, if there is a lock, you won't even be able to delete the GDB folder by yourself. FME has nothing to do with that.


Thank you for the comments so far. We've done the usual things - looking for left over lock files, check permissions etc. The ESRI Geodatabase Writer (GEODATABASE_FILE - that requires a licensed Esri product to be installed) works fine - but it's not an option for us on FME Server. The open API writer (FILEGDB - that doesn't require a licensed Esri product) is the one that we're struggling with.


@andrewspencer Check that you're not trying to write data that is not supported by the File Geodb API writer. The File Geodb API writer only supports simple features and domain support is limited.


@andrewspencer Check that you're not trying to write data that is not supported by the File Geodb API writer. The File Geodb API writer only supports simple features and domain support is limited.

Thanks for your comments @markatsafe. We've done a fair bit of testing, including writing to ArcDesktop created geodatabases and Pro created created geodatabases - using the data same source and the same writer. Sometimes in the same FME workspace. The results have been consistent and reproducible - the data writes fine to the ArcDesktop geodatabase, but once Pro gets involved things unravel. This is for overwriting feature classes by dropping first.

The attached zip file contains two geodatabases - one created with Catalog and the other with Pro. There's a shapefile and an FME 2019 workspace that writes the shapefile into the geodatabases. Both geodatabases have had 1 other feature class added and subsequently deleted - one with Catalog and one with Pro.

Please let me know if you get the same result I do (the Pro writer fails, but creates an empty aspatial feature class with the attribute schema)

gdbtest.zip


Thanks for your comments @markatsafe. We've done a fair bit of testing, including writing to ArcDesktop created geodatabases and Pro created created geodatabases - using the data same source and the same writer. Sometimes in the same FME workspace. The results have been consistent and reproducible - the data writes fine to the ArcDesktop geodatabase, but once Pro gets involved things unravel. This is for overwriting feature classes by dropping first.

The attached zip file contains two geodatabases - one created with Catalog and the other with Pro. There's a shapefile and an FME 2019 workspace that writes the shapefile into the geodatabases. Both geodatabases have had 1 other feature class added and subsequently deleted - one with Catalog and one with Pro.

Please let me know if you get the same result I do (the Pro writer fails, but creates an empty aspatial feature class with the attribute schema)

gdbtest.zip

I can't see a featureclass in the ProGDB.gdb using Pro 2.4.1 / ArcMap 10.4.1 / QGIS 3.8.1 / FME 2019.1.1.0.

But if I create a fresh gdb using Pro 2.4.1 and copy the featureclass from ArcCatalogGDB.gdb I can reproduce the error using the issue with the Esri Geodatabase (File Geodb Open API) [filegdb] writer.

Using the Esri Geodatabase (File Geodb) [GEODATABASE_FILE] it works as expected.


@andrewspencer Check that you're not trying to write data that is not supported by the File Geodb API writer. The File Geodb API writer only supports simple features and domain support is limited.

Thanks @nielsgerrits. Yep - I deleted the feature class so the GDB was empty - not much point in leaving a possibly corrupt non spatial feature class in there. But I'm pleased (and also disappointed!) that you got the same error.


@andrewspencer Thanks for including the simple sample datasets and workspace. From this we were able to reproduce the problem with your databases. However, when I created a fresh File GeoDB using ArcPro 2.4.1 (I have installed the patch) then the File Geodb API writer worked OK.

I did notice that in your ArcPro File Geodb didn't have the TestPolygon feature class. I'm not sure if that has an impact on this issue. When I added the TestPolygon feature class to that geoDB it still failed.

I've attached the File Geodb from ArcPro 2.4.1 that I created and perhaps you can test that. ProGDB2_4.gdb.zip and the workspace: EsriGeodbAPI10_7PR.fmwt


@andrewspencer Thanks for including the simple sample datasets and workspace. From this we were able to reproduce the problem with your databases. However, when I created a fresh File GeoDB using ArcPro 2.4.1 (I have installed the patch) then the File Geodb API writer worked OK.

I did notice that in your ArcPro File Geodb didn't have the TestPolygon feature class. I'm not sure if that has an impact on this issue. When I added the TestPolygon feature class to that geoDB it still failed.

I've attached the File Geodb from ArcPro 2.4.1 that I created and perhaps you can test that. ProGDB2_4.gdb.zip and the workspace: EsriGeodbAPI10_7PR.fmwt

Thanks @markatsafe. Your workspace works, but it it's also set to drop and create the whole geodatabase rather than just the table. When I uncheck 'Overwrite Existing Geodatabase' (and set Table Handlig to Drop and Create) I get the same error as previously reported.


Thanks @markatsafe. Your workspace works, but it it's also set to drop and create the whole geodatabase rather than just the table. When I uncheck 'Overwrite Existing Geodatabase' (and set Table Handlig to Drop and Create) I get the same error as previously reported.

@andrewspencer I'm using the original File Geodb (ProGDB2_4.gdb) as a template. So FME makes a copy of that Geodb (ProGDB2_4output.gdb) and then loads that data into that. You could write direct to ProGDB2_4.gdb

This allows you to use the schema of a File Geodb and not have FME create that schema.

 


@andrewspencer I'm using the original File Geodb (ProGDB2_4.gdb) as a template. So FME makes a copy of that Geodb (ProGDB2_4output.gdb) and then loads that data into that. You could write direct to ProGDB2_4.gdb

This allows you to use the schema of a File Geodb and not have FME create that schema.

 

@markatsafe our workflow is to update a number of Feature Classes in a file geodatabase. We use FME Server to do this nightly. The geodatabase is around 2GB with several feature datasets and tens if not hundreds of feature classes. Overwriting the existing geodatabase using itself as the template loses all the feature classes not being updated / overwritten.


@markatsafe our workflow is to update a number of Feature Classes in a file geodatabase. We use FME Server to do this nightly. The geodatabase is around 2GB with several feature datasets and tens if not hundreds of feature classes. Overwriting the existing geodatabase using itself as the template loses all the feature classes not being updated / overwritten.

@andrewspencer You don't have to use a template. You can just write tot he existing File GeoDB as in the attached workspace. I use a template just so the 'original' doesn't get overwritten with the new data: EsriGeodbAPI10_7PR.fmw


Reply