heremaps / here-sdk-examples

Android, iOS and Flutter example apps for the HERE SDK 4.x (Lite Edition, Explore Edition, Navigate Edition)
https://developer.here.com/products/here-sdk
Apache License 2.0
171 stars 135 forks source link

MapDownloader throws Internal Error when different Map Versions installed #185

Closed StefanTiess closed 1 year ago

StefanTiess commented 1 year ago

Hi, there is a nasty bug in the MapLoader for OfflineMaps. It seems linked to the different Map Versions when you download a offlineMap vs after the update that is available immediately.

Steps to reproduce with SDK 4.12.8

Expected would be that the MapLoader can handle different Map Versions and that newly downloaded Maps do not Require an immediate Update.

samvmisti commented 1 year ago

Hi, @StefanTiess ! I am not from HERE team, but also was curious why should we do immediate update. Answer is here https://github.com/heremaps/here-sdk-examples/issues/168#issuecomment-1237402843

StefanTiess commented 1 year ago

@samvgorode , i would be ok to do an immediate update. But the issue is that you still run into the "INTERNAL_ERROR" sooner or later and the only thing you can do is to do a complete Memory swipe. Many of our drivers download the complete Europe Package of 29Gigs. Imagine you have to redownload it every month because the Offline Map Storage became corrupted for no apparent reason.

samvmisti commented 1 year ago

@StefanTiess, there is a case when interrupted map update causes "INTERNAL_ERROR" all the time. When update started and have some percentage - just kill the app. I've opened some time ago another issue https://github.com/heremaps/here-sdk-examples/issues/167 They recommend to mapDownloader.repairPersistentMap but it will never work.

StefanTiess commented 1 year ago

After some investigation I found the issue to be reproducible in the OfflineMaps Example App: I manipulated it by allowoing the download of multiple regions

 String swizNameInGerman = "Schweiz";
        try {
            List<InstalledRegion> list = mapDownloader.getInstalledRegions();
            if(list.size() > 0) swizNameInGerman = "Liechtenstein";
            if(list.size() > 1) swizNameInGerman = "Vatikanstadt";
            if(list.size() > 2) swizNameInGerman = "Monaco";

        } catch (MapLoaderException e) {
            e.printStackTrace();
        }

If you kill the app after each downloaded map, reopen it, then try to download the next map, you will get the INTERNAL_ERROR.

Curiously the log shows the follwing warnings:

[INFO ] CatalogManager - Existing catalog found, hrn='hrn:here:data::olp-here:ocm', version=56, catalog_handle=0
[WARN ] JournalAlgorithms - IsConfigurationValid issue, dependency not found, hrn='hrn:here:data::olp-here:ocm', dependency='hrn:here:data::olp-here:ocm-japan'
WARN ] CacheUpdateManager - PrefetchMapRegions: journal configuration do not match linked catalogs configuration, catalog_handle=0
 [WARN ] CacheUpdateManager - PrefetchMapRegions: could not start map prefetch job, catalog_handle=0, prefetch_error=kBadRequest, is_cancelled=0

Please provide a fix asap or advice for a workaround. I see this issue causing a lot of problems for drivers on the road.

samvmisti commented 1 year ago

@datasun , please take a look. This is really important.

HERE-SDK-Support-Team commented 1 year ago

We have created a ticket on our end to investigate this: #15196.

HERE-SDK-Support-Team commented 1 year ago

Our team reports that this was fixed with 4.12.11.0. Closing.