Skip to content

GBIF API fetch issues on Windows machines #165

@damianooldoni

Description

@damianooldoni

Sometimes trias functions using GBIF API behind the hood return fetching errors, containing the sentence: Error in the HTTP2 framing layer [api.gbif.org]. Impossible to replicate automatically. It seems there is a limit on how fast API calls can follow each other. Maybe to avoid overloading?

This is the returned error:

gbif_has_distribution(145953242,
  country = "BE",
  status = "PRESENT",
  establishmentMeans = "INTRODUCED"
)
Error in curl::curl_fetch_memory(x$url$url, handle = x$url$handle) : 
  Error in the HTTP2 framing layer [api.gbif.org]
10. stop(e)
9. raise_libcurl_error(16L, "Error in the HTTP2 framing layer",
   "", "https://api.gbif.org/v1/species/145953242/distributions?offset=0&limit=100",
   NULL)
8. curl::curl_fetch_memory(x$url$url, handle = x$url$handle)
7. crul_fetch(opts)
6. private$make_request(rr)
5. cli$get(query = args)
4. gbif_GET(url, args, FALSE, curlopts)
3. getdata(data, key, uuid, shortname, args, curlopts)
2. distr_properties <- rgbif::name_usage(
   key = as.integer(taxon_key),
   data = "distribution"
  )$data at gbif_has_distribution.R#101
1. gbif_has_distribution(145953242, country = "BE", status = "PRESENT",
   establishmentMeans = "INTRODUCED")

This issue is important while running unit-tests. In #163 I added skip_on_os("windows") where needed. Of course it's more a patch than a sustainable solution. Something to think about it as this error could also arise in automatised pipelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions