Inaturalist 504 gateway timeout while testing my api key for MO

Please fill out the following sections to the best of your ability, it will help us investigate bugs if we have this information at the outset. Screenshots are especially helpful, so please provide those if you can.

Platform (Android, iOS, Website): Pc

App version number, if a mobile app issue (shown under Settings or About):

Browser, if a website issue (Firefox, Chrome, etc) : Firefox & Chrome giving same 504 message

URLs (aka web addresses) of any relevant observations or pages: https://www.inaturalist.org/observations/moimport

Screenshots of what you are seeing (instructions for taking a screenshot on computers and mobile devices: https://www.take-a-screenshot.org/):

Description of problem (please provide a set of steps we can use to replicate the issue, and make as many as you need.):

Step 1: Seached how to import MO observations to IN

Step 2: Got an API key from MO typing “Inaturalist” for description of app using api

Step 3: Pasted api in preview your import, and got 505 error

seems like this happens every once in a while:

1 Like

We’re aware of the issue. I can’t estimate when it’ll be fixed, however.

1 Like

I’m attempting to use the MushroomObserver import tool to import my observations from MO to iNat and I keep getting a 504 Gateway Timeout after Step 1 and hitting [Test] with my api key entered.

https://www.inaturalist.org/observations/moimport

It seems to be quite similar to this issue:
https://forum.inaturalist.org/t/inaturalist-504-gateway-timeout-while-testing-my-api-key-for-mo/27515

This is platform-independent issue that has been reported to both Mushroom Observer and to INat support by multiple users.

Description of problem

Step 1: Goto https://www.inaturalist.org/observations/moimport

Step 2: Fill in MO API Key

Step 3: Click “Test”

RESULT: 504 Gateway Time-out nginx

I hope the following will expedite a fix.
PS: It’s not safe to assume that the MO image has extension jpg.


MO Webmaster webmaster@mushroomobserver.org
Oct 24, 2021, 8:19:42 PM
to help@inaturalist.org, mo-developers

Dear iNat:

I poked around a bit in the iNat code. I don’t completely understand what’s going on, but I see some issues here:

image_url = "[https://mushroomobserver.nyc3.digitaloceanspaces.com/orig/#{image[:id]}.jpg](https://mushroomobserver.nyc3.digitaloceanspaces.com/orig/#%7Bimage[:id]%7D.jpg)"

https://github.com/inaturalist/inaturalist/blob/88c24041fe0df7f81fe1d04914ecdba29c319f43/app/models/mushroom_observer_import_flow_task.rb#L293

and maybe here:

image_url = "[https://images.mushroomobserver.org/orig/#{image[:id]}.jpg](https://images.mushroomobserver.org/orig/#%7Bimage[:id]%7D.jpg)"

https://github.com/inaturalist/inaturalist/blob/88c24041fe0df7f81fe1d04914ecdba29c319f43/app/models/mushroom_observer_import_flow_task.rb#L303

To get an MO image, external users should use a URL in the form:

https://mushroomobserver.org/images/<*size*>/<*id*>.<*ext*>

Other URLs are not guaranteed to be stable and may break at some point down the line.

Line 293 above will certainly cause an error; we recently moved our image store from Digital Ocean to Google Cloud Platform. Digital Ocean’s response looks like:

<Error>
<Code>AccessDenied</Code>
<BucketName>mushroomobserver</BucketName>
<RequestId>tx00000000000001bc68251-0061761d48-67e7768-nyc3a</RequestId>
<HostId>67e7768-nyc3a-nyc</HostId>
</Error>

I don’t know how the iNat code interprets that.

Line 303 above should not cause a timeout, but may cause a 404.

Please let us know if you think there’s a different problem, or if there’s something we can do to help isolate/debug the issue.

Again, it would help to know the details of the request that’s causing the 504 gateway timeout.

Best regards,

– Joe Cohen
MO Dev Team

1 Like

PPS: The Digital Ocean response to line 293 has changed since 24-Oct, because MO has since completely deleted the DO bucket. The response now looks like this:

<Error>
<Code>BucketDeleted</Code>
<Message>This bucket is temporarily reserved for administrative purposes.</Message>
</Error>

(consolidated several bug reports into this one)

Hi @tiwane - could you point me to the GitHub issue for this? I wasn’t able to find it. If it doesn’t exist, should we create it? I’m interested in submitting a PR but the contribution guidelines strongly urges not to issue PRs without specific issues.

As far as I know there isn’t a GH issue for this current problem.

OK - I’ve created an issue for it here: https://github.com/inaturalist/inaturalist/issues/3331 - If someone will review and approve or escalate the issue, I’d be happy to submit a PR.