clarin-eric / VLO

Virtual Language Observatory
GNU General Public License v3.0
14 stars 6 forks source link

"Handle API response did not incude a URL field" in Tomcat log #388

Closed twagoo closed 2 months ago

twagoo commented 3 months ago

The webclient regularly logs an error message "Handle API response did not incude a URL field".

From the production (vps16) logs:

Handle API response did not incude a URL field
Error while getting resolved handle from cache
com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key hdl:11858/00-1734-0000-0002-FD87-E.
(..)
at nl.mpi.archiving.corpusstructure.core.handle.CachingHandleResolver.resolve(CachingHandleResolver.java:72) ~[classes/:?]
at eu.clarin.cmdi.vlo.service.impl.HandleResolverWrapper.lambda$resolve$0(HandleResolverWrapper.java:82) ~[classes/:?]
twagoo commented 2 months ago

API response for https://hdl.handle.net/11858/00-1734-0000-0002-16D6-5:

$ curl -L -H "Accept: application/json" -X GET 'http://hdl.handle.net/api/handles/11858/00-1734-0000-0002-16D6-5'
{
  "responseCode": 1,
  "handle": "11858/00-1734-0000-0002-16D6-5",
  "values": [
    {
      "index": 1,
      "type": "HS_ALIAS",
      "data": {
        "format": "string",
        "value": "21.11113/00-1734-0000-0002-16D6-5"
      },
      "ttl": 86400,
      "timestamp": "2017-10-05T13:58:46Z"
    },
    {
      "index": 8,
      "type": "DISABLED_CREATOR",
      "data": {
        "format": "string",
        "value": "1734"
      },
      "ttl": 86400,
      "timestamp": "2017-10-05T13:58:46Z"
    },
    {
      "index": 100,
      "type": "HS_ADMIN",
      "data": {
        "format": "admin",
        "value": {
          "handle": "0.NA/11858",
          "index": 200,
          "permissions": "010001110000",
          "legacyByteLength": true
        }
      },
      "ttl": 86400
    }
  ]
}
twagoo commented 2 months ago

In the case above there is no URL but there is an alias (values[1].type == 'HS_ALIAS'). In this case, a new request should be made to look up the URL for the alias handle.