UnsupportedClassVersionError When connecting drawio to self-hosted GitLab instance
See original GitHub issuePreflight Checklist
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Describe the bug We recently updated our GitLab to version 15.1.0-ee, and drawio to version 20.0.4 (running in a docker container). With these updates, drawio can no longer connect to GitLab. (We were using GitLab 14.8.2-ee and drawio version 14.0.3, and these were working fine.)
I spent lots of time digging, checking other issues (https://github.com/jgraph/drawio/issues/2192 , https://github.com/jgraph/drawio/issues/2474) get to the bottom of this bug and updated several things following what other people have tried to try to get it to work:
- ensured that all our self-signed certificates are both on the gitlab server and in the drawio container
- these work, I can curl gitlab from drawio and vice versa without any issues.
- ensured that my gitlab application settings are correct
- callback to
https://diagrams.xxxxxxx.local/gitlab
(no.html
at the end, and using https) - application has the correct scopes (api, read_repository, write_repository)
- callback to
- set all the correct environment variables in my docker container:
DRAWIO_GITLAB_URL=https://gitlab.xxxxxxx.local
DRAWIO_GITLAB_ID=9b0axxxxxxxxxxxxxxxxxxxxxxxxxxda0a4aeb21c518fcad78517b26b
DRAWIO_GITLAB_SECRET=3867f5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx96fc353da7ebb562696
DRAWIO_BASE_URL=https://diagrams.xxxxxxxx.local
And when I spin up the drawio page and try to connect, it raises an “Unknown error”. If I inspect the page and look at the actual request, I see that drawio tried to access endpoint https://diagrams.xxxxxxx.local/gitlab?getState=1
and returns a 500 error:
Exception
jakarta.servlet.ServletException: Error instantiating servlet class [com.mxgraph.online.GitlabAuthServlet]
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:356)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:867)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1760)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:750)
Root Cause
java.lang.UnsupportedClassVersionError: com/mxgraph/online/GitlabAuthServlet has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 (unable to load class [com.mxgraph.online.GitlabAuthServlet])
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2515)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:877)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1413)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1257)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:356)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:867)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1760)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:750)
Note: any subsequent attempts to connect raise a 404. I can only get the 500 error on the first connection attempt when I startup the container.
And at this point, I’m very far down the rabbit hole, I don’t know what to do anymore… Any help is greatly appreciated.
To Reproduce Steps to reproduce the behavior:
- Install GitLab 15.1.0-ee (on an Ubuntu 20.04.4 LTS machine)
- Create an application for drawio
- Install drawio 20.0.4 in a docker container
- add the application credentials in the container’s environment variables when starting it
- Install self-signed certificates on GitLab server and drawio container
- Try to connect to gitlab in the drawio page
Expected behavior Successful connection to gitlab to see, edit, and commit diagrams to repository D Screenshots
draw.io version (In the Help->About menu of the draw.io editor):
- draw.io version 20.0.4 (running in docker container)
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
Oh, that’s not right, we’ll look.
Will be fixed in the next release. A manual fix is here https://github.com/jgraph/drawio/issues/2932