AtlasOfLivingAustralia / logger-service

Atlas event logging
https://logger.ala.org.au
1 stars 8 forks source link

Downloads not setting a source value for 'ALA' when sending to logger #20

Closed nickdos closed 3 years ago

nickdos commented 4 years ago

The logger stats are showing 0 counts for the ALA source (sourceId: 0):

https://logger.ala.org.au/service/sourceBreakdown?eventId=1002

image

Investigate and fix this so ALA stats are being recorded.

Possible causes: downloads-plugin and bioacache-service.

ansell commented 4 years ago

Given that OZCAM and AVH are there, it is possibly an ala-hub configuration issue, which would flow through to downloads-plugin

nickdos commented 4 years ago

Yes, was thinking same thing - they are all using the same code so its likely config.

ansell commented 4 years ago

The codes behind those values show "ALA" as being "0". Sometimes using "0" as a special code can break things if they are using "truthiness" checks.

https://logger.ala.org.au/service/logger/sources

I can't see anything in our ansible configuration for those codes, so it is possibly relying on a code pre-configured in the avh-hub/ozcam-hub codebases.

ansell commented 4 years ago

Looks like it is matching against the "skin", so that would be the next place to check (or fix that code so it checks a specific configuration value for logger source):

https://github.com/AtlasOfLivingAustralia/downloads-plugin/blob/8ed912240f9479db84752feff680f67d9e2fc065/grails-app/taglib/au/org/ala/downloads/plugin/DownloadsTagLib.groovy#L76-L81

ansell commented 4 years ago

That doesn't fully explain it though, as both ALA and AVH configurations use lower case and otherwise should match:

ansible-inventories $ grep 'skin_layout' bhub-b5 
skin_layout = ala
ansible-inventories $ grep 'skin_layout' aws-avh-prod 
skin_layout = avh
nickdos commented 4 years ago

PA found that biocache-service is receiving the correct param from ala-hub, so moving back to that repo.

2432:[REDACTED] - - [05/Feb/2020:08:39:06 +1100] "GET /ws/occurrences/offline/download?hubName=Atlas+of+Living+Australia&file=records-2020-02-05&mintDoi=true&reasonTypeId=0&searchUrl=https%3A%2F%2Fbiocache.ala.org.au%2Foccurrences%2Fsearch%3Fq%3Dqid%3A1580852326434&fileType=csv&qa=none&sourceTypeId=0&email=[REDACTED]&doiDisplayUrl=https%3A%2F%2Fbiocache.ala.org.au%2Fdownload%2Fdoi%3Fdoi%3D&extra=undefined&q=qid:1580852326434 HTTP/1.1" 200 252 "-" "-" "[REDACTED]" request_time=0.035 upstream_response_time=0.032 upstream_connect_time=0.000 upstream_header_time=0.032 upstream_cache_status=-

shows sourceTypeId=0.

Might be a truthy bug as suggested by @ansell above.

brucehyslop commented 4 years ago

The issue is a truthy issue with the LoggerService.groovy#L462.

sourceTypeId is resolving to a null LogSourceType object.

nickdos commented 3 years ago

Can see this working on logger-test now, with latest biocache-ws-test.

Can see stats for both ALA and unclassified: image