AtlasOfLivingAustralia / dashboard

Atlas Dashboard
https://dashboard.ala.org.au
3 stars 13 forks source link

JSON link results in 500 error #82

Open nickdos opened 7 years ago

nickdos commented 7 years ago

"Show raw data" link on dashboard - "https://dashboard.ala.org.au/dashboard/data

returns NPE error:

Cannot get property 'facets' on null object ->> 273 | doCall in au.org.ala.dashboard.DashboardController$_closure29

Line 273 of DashboardController:

metadataService.getMostRecordedSpecies(group).facets?.each() {

quick fix would be to add ?. before facets but better fix is to work out why the getMostRecordedSpecies service is returning null and/or make the service null-safe.

patkyn commented 7 years ago

getMostRecordedSpecies service is returning null for species_group Fish. https://biocache.ala.org.au/ws/occurrences/search?q=*:*&fq=species_group:Fish&flimit=6&pageSize=0&fsort=count&facets=species_guid

Seems like Biocache doesn't have occurrence data for Fish?

nickdos commented 7 years ago

Answer is in https://biocache.ala.org.au/ws/occurrences/search?q=nsw&fq=species_group:*&flimit=30&pageSize=0&fsort=count&facets=species_group

patkyn commented 7 years ago

Looks like not all groups are listed for example Molluscs , Protozoa, Crustaceans etc https://github.com/AtlasOfLivingAustralia/dashboard/blob/grails3/grails-app/controllers/au/org/ala/dashboard/DashboardController.groovy#L311

Could the group and count be obtained from the query https://biocache.ala.org.au/ws/occurrences/search?q=*:*&fq=species_group:*&flimit=30&pageSize=0&fsort=count&facets=species_group rather than hardcoded?