openaddresses / batch

OpenAddresses/Machine based AWS Batch based ETL Processing
https://batch.openaddresses.io/
MIT License
6 stars 5 forks source link

/docs leads to 404 #356

Open davidtorosyan opened 1 year ago

davidtorosyan commented 1 year ago

Describe the bug The docs link leads to a 404: https://batch.openaddresses.io/docs

To Reproduce Steps to reproduce the behavior:

  1. Go to https://batch.openaddresses.io/data
  2. Click on the question mark icon
  3. Observe 404 page

Expected behavior Expected a docs page.

Screenshots image

Desktop (please complete the following information):

Additional context This was previously filed in a different repo (https://github.com/openaddresses/openaddresses/issues/6669), opening here since this is more applicable.

From my investigation I found that the nginx config specifies that the link should be /docs/ https://github.com/openaddresses/batch/blob/4af5207e581ed8d463380c520b33d0be1ade749d/api/nginx.conf#L19

And if we go to the route (https://batch.openaddresses.io/docs/) we see a different 404 page, which indicates the nginx filter gets hit: image

But I also see that there's a route to /docs, without the slash. https://github.com/openaddresses/batch/blob/4af5207e581ed8d463380c520b33d0be1ade749d/api/index.js#L141

My guess is that the nginx override is messing with the proper path.

Also, I'm thinking this broke with 196793404b892922cbfd959e0e00feb2478b438c, which switched to Swagger. cc @ingalls

ingalls commented 1 year ago

image

Fixed.

davidtorosyan commented 1 year ago

I think this is only partly fixed.

The question mark icon leads to: https://batch.openaddresses.io/docs

This redirects to http://batch.openaddresses.io:5000/docs/ which then fails to load.

On the other hand https://batch.openaddresses.io/docs/ works as expected.

So either the question mark link needs to be updated, or the redirect from /docs to /docs/ needs to fix the port. Or both!

ingalls commented 1 year ago

I'm afraid I can't reproduce this? Can you try clearing your cache? This looks like the behavior I fixed.

I've tried all the permutations and am seeing it correctly direct to the Swagger Docs.

iandees commented 1 year ago

Something about generating the https://batch.openaddresses.io/docs/ page content is taking a very long time. I intermittently get 503s, blank pages after ~50 seconds, and the actual content you shared in the screenshot above.

Also, I see the URL without the slash at the end redirecting to :5000:

$ curl -sv https://batch.openaddresses.io/docs -o /dev/null
< HTTP/2 301
...
< location: http://batch.openaddresses.io:5000/docs/