GlobalFishingWatch / gfwr

R package for accessing data from Global Fishing Watch APIs
https://globalfishingwatch.github.io/gfwr/
Apache License 2.0
58 stars 7 forks source link

Unexpected content type #128

Closed orowley closed 2 months ago

orowley commented 4 months ago

Kia Ora,

Wanting some assistance with the below error code when pulling data for a user defined json using the get_raster() function

Error in httr2::req_perform(): ! Failed to parse error body with method defined in req_error(). Caused by error in httr2::resp_body_json(): ! Unexpected content type "text/html". • Expecting type "application/json" or suffix "json".

giselamo commented 4 months ago

Hi @orowley Thank you for bringing this bug to our attention. Typically, this occurs when the request involves a large or intricate polygon, or encompasses multiple years or datasets (as illustrated in the example provided in the API errors section, see image attached. Screenshot from 2024-04-16 11-21-47 ). To help us investigate further, could you kindly provide the polygon and the specific request parameters you were using? Thanks!

AndreaSanchezTapia commented 2 months ago

Thanks for flagging this. I just encountered the same error with

get_event(event_type = "PORT_VISIT", vessels = c("e0c9823749264a129d6b47a7aabce377", "8c7304226-6c71-edbe-0b63-c246734b3c01"), start_date = "2017-01-26", end_date = "2017-12-31", confidence = c(3, 4), # only for port visits key = gfw_auth())

But the error solved itself when retrying later.

AndreaSanchezTapia commented 2 months ago

Hi @orowley thanks for flagging this issue. The most recent version of the package will be released on June 30th and this should not happen again, so I'm closing this issue. Please feel free to reopen if you encounter it again after installing the next version.

orowley commented 2 months ago

Awesome this is fantastic news and will make using the API through R so much easier for my team with our far reaching birds and large datasets!

Keep up the awesome work.

From: Andrea Sánchez-Tapia @.> Sent: Thursday, June 27, 2024 12:43 PM To: GlobalFishingWatch/gfwr @.> Cc: Olivia Rowley @.>; Mention @.> Subject: Re: [GlobalFishingWatch/gfwr] Unexpected content type (Issue #128)

Hi @orowleyhttps://github.com/orowley thanks for flagging this issue. The most recent version of the package will be released on June 30th and this should not happen again, so I'm closing this issue. Please feel free to reopen if you encounter it again after installing the next version.

- Reply to this email directly, view it on GitHubhttps://github.com/GlobalFishingWatch/gfwr/issues/128#issuecomment-2192851106, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDTLS62ZUAM7FYVE2F2VZRDZJNN23AVCNFSM6AAAAABGIL6F2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSHA2TCMJQGY. You are receiving this because you were mentioned.Message ID: @.**@.>>

Caution - This message and accompanying data may contain information that is confidential or subject to legal privilege. If you are not the intended recipient you are notified that any use, dissemination, distribution or copying of this message or data is prohibited. If you received this email in error, please notify us immediately and erase all copies of the message and attachments. We apologise for the inconvenience. Thank you.