Google thematic maps not working

I have on instance where add the population thematic map shows this

but the maps never show up, the loading progress never stops.

I have another instance for niger, where everything is fine
we tried on both to upgrade the dhis2 apps (maps, climate,…)

on the non working instance the only related call is

  • /api/42/tokens/google that seem to return a legit token
  • we never see calls to earth engine
  • we see a weird error : TypeError: can’t access property “urlFormat”, b is undefined
    • /dhis-web-maps/assets/ee_worker-BYZZdtSN.js ( [ee_worker-BYZZdtSN.js:91:197504

in the differences between the 2 instances we notice the content of the dataStore DHIS2_MAP_CORE/MANAGED_LAYER_SOURCES to be really different but I don’t know the source of it (user config or migration ?).

Is there something we need to do to reset
not working instance


working instance

I saw a ticket in the changelog talking about the new global2 dataset : feat: new worldpop global2 layer sources [DHIS2-20774] by BRaimbault · Pull Request #3608 · dhis2/maps-app · GitHub
Is it possible that a new token should be re-issued ?
or the working instance is using the old dataset despite the apps update ?

perhaps @Bruno can you help me ?

Hi @Stephan_Mestach

Just one quick question please, are these two instances and apps all the same version (both the one that’s working and the one that’s not working)? You said you tried to upgrade the apps so they’re now the same versions on both instances?

Did you try to run the analytics tables export, clear the application cache and reset apps (from the Data Administration app), and then test while on your browser’s Guest mode? After running analytics tables export in the instance that’s not working, do you see any errors in the Catalina.out log (just to eliminate any DB issues)?

Thanks!

  • dhis2 same version 2.42.5.1
  • maps : was originally different, use latest on the non working one
    • working one was on 101.4.6
    • the non working one is now on 101.16.0
    • tried to rollback on 101.5.5 but it looks in weird state
  • for cache
    • app cache cleaner
    • tried a fresh anonymous browser (firefox and google chrome)
      • They both show the same issue with urlFormat

image

Sorry but I won’t touch the working one… (don’t know to rollback)

Thanks!

Yes, I’d only recommend making changes to a working production one, only after testing in a development environment.

I am not sure how to reproduce this on play, so I will go ahead and triage this and see if more info is needed or this is enough to be able to debug. Thanks again!

in the code I found

I discovered that worker are hidden from the default / main devtools in most browsers, making it complicated to debug.
I found a request to that seem to pass

https://earthengine.googleapis.com/v1/projects/earthengine-legacy/algorithms?prettyPrint=false

but then I don’t see other requests to the earthengine api or errors.

Also noticed the geometries are 8Mb, I don’t know if there are limits or badly formatted or weird (they seem to display at least in the simple maps)

So I don’t know “why” but simplifying/cleaning the geometries fixed the issues.

Clearly I don’t know the link. I guess some operation is done to get a bbox or something like that and it slow/dying/… Strangely the shapes where ok in other maps but not once bundled for a google related map.

I made a Dhis Taskr recipe
to update the geometries and now it’s fast and displaying data

Hi @Stephan_Mestach,

I was on leave, I’m glad you figured it out by yourself.
More detailed geometries require more resources from Google Earth Engine to retrive the data, it seems plausible that you were hitting a limit there.

Here is a follow-up ticket I’ve created to see what we can do to catch these type of errors and provide user with helpful information: JIRA - DHIS2-22015
Don’t hesitate to comment there if you want to add details or watch the ticket to follow its resolution.

Finally thanks for sharing your snippet of code. We have a section about geometry simplification in our documentation here: Maps - DHIS2 Documentation, we’ve been recommending MapShaper, but a code based alternative certainly has its advantages. The use of turf.simplify is sensible.

Thanks, indeed the lack of error message or network error from the main app is not helping.

From my understanding each js worker is isolated in its own env (so debugger env too), making it hard to see the real error. The classic advice “look in the dev console” is not really working here.