Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc UI not loading on servers #483

Closed
shurwit opened this issue May 2, 2022 · 7 comments
Closed

Doc UI not loading on servers #483

shurwit opened this issue May 2, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@shurwit
Copy link
Collaborator

shurwit commented May 2, 2022

When attempting to load the Swagger documentation UI on the Core BB hosted on the servers it currently returns a blank page (see https://api.rokwire.illinois.edu/core/doc/ui/index.html). This is consistent across all server environments (dev, test, prod), however issue does not seem to occur when running locally. This issue also does not occur on the version hosted on our ROKMETRO servers.

After investigating with the browser "inspect" tool, we found that this page is making several requests that are failing with 404 errors.

GET https://api.rokwire.illinois.edu/core/doc/ui/swagger-ui.css net::ERR_ABORTED 404  index.html:68
GET https://api.rokwire.illinois.edu/core/doc/ui/swagger-ui-bundle.js net::ERR_ABORTED 404  index.html:69
GET https://api.rokwire.illinois.edu/core/doc/ui/swagger-ui-standalone-preset.js net::ERR_ABORTED 404  index.html:73
Uncaught ReferenceError: SwaggerUIBundle is not defined
    at window.onload (index.html:73:14)

We verified that on our servers these requests return successfully with content served by the http-swagger package.

I found a related issue on the http-swagger library: swaggo/http-swagger#10

@shurwit shurwit added the bug Something isn't working label May 2, 2022
@shurwit
Copy link
Collaborator Author

shurwit commented May 2, 2022

Hi @petyos, after looking into this for a while I am still not sure what could be causing this in the Illinois environments. Could you please take a look when you get a chance to see if you notice any issues? Thanks!

@petyos
Copy link
Collaborator

petyos commented May 3, 2022

Hi @shurwit , for me it works on dev but not on test and prod.
BTW the url for accessing it is https://api-dev.rokwire.illinois.edu/core/doc/ui/ , i.e. without index.html at the end.
test and prod does not work for me.

cc @stefanvit

@shurwit
Copy link
Collaborator Author

shurwit commented May 3, 2022

Hi @shurwit , for me it works on dev but not on test and prod. BTW the url for accessing it is https://api-dev.rokwire.illinois.edu/core/doc/ui/ , i.e. without index.html at the end. test and prod does not work for me.

cc @stefanvit

Hi @petyos, thanks for trying this out! This is very interesting because dev is working for me too now. I am pretty sure I tried it earlier today and found that it had the same issue as test and prod. The https://api-dev.rokwire.illinois.edu/core/doc/ui/ endpoint simply reroutes to https://api-dev.rokwire.illinois.edu/core/doc/ui/index.html so I do not believe that should make a difference.

Since you mentioned it, one interesting thing to note is that https://api.rokwire.illinois.edu/core/doc/ui/ is actually rerouting to https://api.rokwire.illinois.edu/core/doc/index.html (missing the /ui component), while in dev it goes to the correct path (including the /ui component). I suspect this may indicate that the base path for the Swagger handler is getting mixed up in some cases. For example, it looks like it is expecting to find/serve the internal documents (index.html, swagger-ui-bundle.js...) on the /core/doc path, while they are supposed to be hosted on the /core/doc/ui path. I am still not sure what would be causing that mixup though.

@stefanvit
Copy link
Collaborator

HI @petyos @shurwit, i've been trying to find the solution all day. I think the problem is somewhere in the library but I couldn't find it.

@shurwit
Copy link
Collaborator Author

shurwit commented May 3, 2022

HI @petyos @shurwit, i've been trying to find the solution all day. I think the problem is somewhere in the library but I couldn't find it.

Hi @stefanvit, thanks for looking into this! I'll take another look today too.

@stefanvit
Copy link
Collaborator

@shurwit Thanks!

@shurwit
Copy link
Collaborator Author

shurwit commented Aug 1, 2022

This issue seems to have resolved itself for now. This may have been the result of an issue with a specific deployment. Closing for now

@shurwit shurwit closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants