Geodatabase returns empty GeodatabaseFeatureTables collection

3446
16
08-08-2017 10:29 AM
JoeHershman
MVP Regular Contributor

I have come across a number of cases where the Geodatabase object has an empty collection of GeodatabaseFeatureTables.  I have gone back and recreated everything from scratch, sometimes I have seen it fix the issues others not.  When generating these replicas everything goes fine, I have checked Server logs and these only contain debug/info messages.  Nothing indicative of errors.  I can open the databases in DB Browser for SQLLite and everything looks fine.

After a bunch of research I have found one difference.  The databases that work all seem to have a table called GDB_ServiceItems.  The databases that show no layers none appear to have this table.

So a question, would this table missing cause the API to behave in this manner?  Does the initialization of the Geodatabase object look to this table for information about the tables?

-Joe

Thanks,
-Joe
16 Replies
JoeHershman
MVP Regular Contributor

If your desire is to create offline content that is not edited I would look at either creating Runtime content on ArcMap or Mobile Map package in ArcGIS Pro.  I am pretty certain you need a version above 10.3 to create Runtime Content in ArcMap.  I would suggest using 10.4.1 or better.

Thanks,
-Joe
0 Kudos
AnttiKajanus1
Occasional Contributor III

Hi,

Hopefully this helps.

Taking layers offline using ArcGIS Runtime

- ExportTileCacheTask Class is used to generate a TPK file from a service that supports export operation

GeodatabaseSyncTask Class is used to generate a geodatabase file from a service that has sync enabled

Taking a map offline using ArcGIS Runtime

OfflineMapTask Class is used to generate a mobile map package based on a webmap which is using services that support operations mentioned above. Feature collections are set of features that are stored directly in webmaps or they live in a JSON format in an ArcGIS Portal item.

Creating layers for offline use with ArcMap

- ArcMap seems to work only with local content which means that if you create the geodatabase based on the feature service, it won't at the moment return any layers in it. The documentation indicates that this shouldn't work but I would assume that loading the geodatabase should fail instead it returning zero tables. I have raised a question to see if this is an area that we can do something. What comes to the TPK creation, the data also needs to be local (non-service based).

- If you want to use ArcMap to create the geodatabase, you first need to create a local copy from the data. This can be done by many different ways but one example is to use Feature Class To Geodatabase—Help | ArcGIS for Desktop tool.

- Note that it will copy only the data so you need to set the renderer / other needed information to the layers. You can, for example, create Layer Packages from the Feature Service layers and then apply them to the layers in your MXD by using Apply Symbology From Layer—Help | ArcGIS for Desktop 

- If you create the geodatabase from the new map with full extent, it should work without problems. 

Here is a picture from the linked service running in Runtime with a local geodatabase which was created with 10.5 ArcMap.

Please note that the service is in WGS84 projection so if you want to use our basemaps with the data, you need to project the local data first to the Web Mercator projection.

0 Kudos
AnttiKajanus1
Occasional Contributor III

Btw, the datasets are really cool. 

0 Kudos
JoeHershman
MVP Regular Contributor

Antti Kajanus

Back to my original issue, I would be interested in knowing if the missing GDB_ServiceItems table would result in the behavior I see with the Geodatabase object containing no tables.  The reason for the missing table would seem to be an issue for the server team, but I would be nice to have confirmation that the resultant behavior makes sense as a result of that table missing.   

Thanks,
-Joe
0 Kudos
AnttiKajanus1
Occasional Contributor III

Joe Hershman‌ yes, I highly believe so. I haven't seen situation yet where creating a replica will end up in a situation where it doesn't have the GDB_ServiceItems table in it. This is actually what happens when you try to create a geodatabase from ArcMap when the layers are pointing into a FeatureService and that is the reason why we don't get any tables out from the Geodatabase instance which seems to be loaded correctly.

If you can let me know more details so I can start pinging people about this. It's not very good if creating replica fails this manner every now and then and there is no way to know if the replica is corrupted or not.

Could you let me know following stuff (at least)
- Server version
- Server OS

- Runtime API version
- Server logs related to the generation

- Access to the service or way to generate the service

- Short summary of the use case

0 Kudos
JoeHershman
MVP Regular Contributor

Antti Kajanus‌ Just wanted to update you after doing some work with the replication team.  It seems the issue is a result of us having the security access through WebAdpater not enabled in the our high availability architecture.  Although this does not seem to be an issue in a single machine architecture.  It still bugs me that it is a random thing and they don't really know why it happens, but early testing indicates this fix works.

Thanks

-Joe

Thanks,
-Joe
0 Kudos
NathanMellor
Occasional Contributor

What Antti looks like the information I need. I'll get these instructions to the contractor and try this again. 

Since then, I've implemented something that uses MobileMapDownload. I've found that mmpk files can contain one or more .geodatabase files inside them. 

I don't think it is realistic for me to expect many public feature servers to have sync enabled or allow all their layers to be taken offline. 

So the desktop model is the way to go, and apparently under the right conditions an ArcGIS Pro user can get me an mmpk file and an ArcMap user can get me a .geodatabase file. 

0 Kudos