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
Race condition and crash on Swagger UI startup #1126
Comments
The idea behind the two initializations was to preserve swagger-ui.html so that its easy to take in updates from the mother ship. Open to ideas on how best to do that. |
Let me see if I can figure out how to build this gradle thing and make the initialization sequential. |
Let me know if you need help with that.. but it fairly straight forward ./gradlew :springfox-swagger-ui:build will build your project. All it does is downloads the latest version of swagger-ui from the repo and repackages it as a webjar along with springfox customizations. Thanks for looking into it! 👍 |
I did consolidate initialization into one file as they are tightly coupled anyways. @dilipkrish, let me know if you think it is a bad idea. I cannot reproduce the problem after the change. |
I'm also seeing this under the same conditions: upgraded library, tested locally, pushed, then realized it was broken. What's the timeline for accepting the fix and releasing a new build? |
@tommack what was broken 2.3.1 or the PR? Probably over the weekend, haven't had a chance to test it, plus I plan to pull in swagger-ui 2.1.4. |
@dilipkrish I meant 2.3.1 was broken, haven't tested the PR. |
im running 2.3.1 and this is broken 100% of the time |
@tommack another user here with this same issue on 2.3.2-SNAPSHOT thanks for prioritizing this weekend |
Fixed via #1127 |
Hi, is the fix available? |
It will be available in |
I'm regularly hitting this one as well.. a 2.3.2 release for this alone would be neat, if you have the time. |
Should be pretty soon. 👍 |
@dilipkrish When will 2.4 be released? |
Hello, I'm experiencing the same problem with 2.4.0. What data do you need to debug this problem? |
@rzarajczyk can you please post the stack trace? Or is it exactly the one that I got last time? |
@rzarajczyk I'd clean out your browser cache and try again. |
Ok, probably it was a false alarm from my site - I updated gradle dependency of springfox to 2.4, rebuilt uding gradle and run application from IntelliJ IDEA, and the problem still exiasted. However when I run it from gradle, it begun working correctly. So maybe IntelliJ didn't refresh some content? This brings a question by the way: is there a way to check at runtime which springfox version is used? Is it written somewhere in javascripts? |
When I load Swagger UI by going to
http://<host>/swagger-ui.html
, about 10% of the time I get an empty screen and this error in JS console:This happens both on Chrome and Firefox and I see it happen more often when I access the page over the network as opposed to localhost.
I interpret this as a race condition between the Swagger UI application initialization and the Springfox code to set the base URI when the
$('#select_baseUrl').change()
event is fired during the$(document).ready()
callback. Sometimes these callbacks are fired beforewindow.swaggerUi
is set.I'm talking about these two places in code:
https://github.com/springfox/springfox/blob/master/springfox-swagger-ui/src/web/swagger-ui.html#L30
https://github.com/springfox/springfox/blob/master/springfox-swagger-ui/src/web/js/springfox.js#L35
Is there a reason why this initialization happens in two functions that are executed in parallel?
Version
2.3.1
The text was updated successfully, but these errors were encountered: