Vagrant - Swagger Broken?

464 views
Skip to first unread message

James d'Arcy

unread,
May 24, 2018, 11:02:04 AM5/24/18
to xnat_discussion
If I provision a new VM via Vagrant (changed the schema so had to re-do my dev machine) and then try to access Swagger, the server seems to go into an infinite loop logging the following to spring.log:

2018-05-24 13:25:41,702 [http-bio-8080-exec-7] WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/xapi/null/swagger-resources/configuration/ui] in DispatcherServlet with name 'dispatcher'

This is on a completely vanilla install, no plugins at all. The null in the URI /xapi/null/swagger-resources/configuration/ui is suspicious.

After destroying and reprovisioning various VMs I've got these results:

Head revision - infinite loop
1.7.4.1 - infinite loop
1.7.4 - infinite loop
1.7.3 - works fine

I had been working fine on 1.7.4 with no problems until this week.

The only difference I can think of is that 1.7.4 onwards use Ubuntu 16.04 and 1.7.3 uses 14.04. Maybe a recent package update for 16.04 has broken something?

Anyone else seeing this behaviour and know a fix or where to start looking?

ttfn

James

Herrick, Rick

unread,
May 24, 2018, 11:36:13 AM5/24/18
to xnat_di...@googlegroups.com

You mean you can’t access this page?

 

https://xnatdev.xnat.org/xapi/swagger-ui.html

 

Changing server address, etc., as appropriate of course. I haven’t seen any problems with that myself. Here’s that page running on the xnat-release configuration with 1.7.4.1:

 

 

Same story with the latest dev build.

 

You’re right about that path though, it’s definitely fishy. I get this in the nginx access logs (edited down):

 

"GET /xapi/swagger-resources/configuration/ui HTTP/2.0" 200 519 "https://xnatdev.xnat.org/xapi/swagger-ui.html"

 

I moved the war file from ROOT.war to xnat.war so that XNAT would have an application context path (e.g. http://server/xnat) but no issues there either.

 

These are both running on Ubuntu 16.04 from the nrgxnat/xnatstack-ubuntu1604 1.1.2 base box.

 

I doubt this is the issue but have you tried updating the base box for the VM configuration?

 

$ vagrant box outdated

$ vagrant box update

 

If that doesn’t fix the issue, check what versions of the Swagger and Springfox libraries you have:

 

$ find /var/lib/tomcat7/webapps/xnat/WEB-INF/lib -name "*swagger*" -o -name "*springfox*" | sort -u

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-core-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-schema-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-spi-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-spring-web-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-swagger2-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-swagger-common-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/springfox-swagger-ui-2.4.0.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/swagger-annotations-1.5.6.jar

/var/lib/tomcat7/webapps/xnat/WEB-INF/lib/swagger-models-1.5.6.jar

 

Those should be the versions for 1.7.4.1. Our most recent dev builds replace 2.4.0 with 2.7.0 and 1.5.6 with 1.5.13, but otherwise it’s the same list of jars.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

James d'Arcy

unread,
May 24, 2018, 12:23:54 PM5/24/18
to xnat_discussion
Thanks for the reply.

That's the page that causes the infinite loop, yes.

In case it's useful here's what I'm using:

Windows 10 Enterprise
Git Bash - Git 2.17.0
Vagrant 2.1.1
VirtualBox 5.2.12


Same behaviour was observed with:

Vagrant 2.0.0
VirtualBox 5.1.30

I upgraded them trying to find a fix.

Base box is up to date according to Vagrant.

Jars:
xnat@xnat-release:~/logs$ sudo find / -name "*swagger*" -o -name "*springfox*" | sort -u
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-core-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-schema-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-spi-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-spring-web-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-swagger2-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-swagger-common-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/springfox-swagger-ui-2.4.0.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/swagger-annotations-1.5.6.jar
/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/swagger-models-1.5.6.jar

Same result, access Swagger and infinite loop.

There are some odd looking lines in catalina.out:

May 24, 2018 4:13:35 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
May 24, 2018 4:13:35 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
May 24, 2018 4:13:35 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak.

I've attached the full catalina.out.

James
catalina.out

James d'Arcy

unread,
May 24, 2018, 3:38:38 PM5/24/18
to xnat_discussion
Further testing:

MacBook Pro with base box 1.1.1 and 1.7.4.1 is fine.
Windows 10 Pro with 1.7.4.1 is fine.

I guess the question becomes, what the heck is wrong with my dev workstation?

James

Herrick, Rick

unread,
May 24, 2018, 3:49:10 PM5/24/18
to xnat_di...@googlegroups.com

The SEVERE messages in catalina.out are routine and out of our control. Background in this StackOverflow post. I’ve tried to add calls to unregister drivers and generally those have only led to even more panicky messages, so now I just let them happen.

 

I still have no idea what’s causing your issue with Swagger in that one instance though.

Thanks for the reply.

 

Image removed by sender.

James d'Arcy

unread,
May 25, 2018, 7:28:16 AM5/25/18
to xnat_discussion
Seems to be browser-specific. It happens if I use Brave on Windows but not Brave on OSX. Chrome and Firefox are fine on both Windows and OSX. I'll change browser but being able to DOS the server might be worth filing a bug report on?

ttfn

James


On Thursday, May 24, 2018 at 8:49:10 PM UTC+1, Rick Herrick wrote:

The SEVERE messages in catalina.out are routine and out of our control. Background in this StackOverflow post. I’ve tried to add calls to unregister drivers and generally those have only led to even more panicky messages, so now I just let them happen.

 

I still have no idea what’s causing your issue with Swagger in that one instance though.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

Phone: +1 (314) 273-1645

 


Reply all
Reply to author
Forward
0 new messages