Closed DennisD2 closed 5 years ago
One additional step...
I tried to "quick fix" the issue with a symbolical link:
sh-4.2$ cd /tmp/sb
sh-4.2$ ln -s \? %3F
Then spring-cloud-launcher-deployer-2.0.0.RELEASE.jar
is obviously found, but I get the next error in an unresolved dependency/class (org/slf4j/LoggerFactory
): . When examining the local repository, this dependency was not downloaded/resolved.
sh-4.2$ spring cloud configserver -- --spring.cloud.maven.proxy.host=localhost --spring.cloud.maven.proxy.port=3128
Oct 09, 2018 11:09:50 AM org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler run
SEVERE: Error running spring cloud
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.run(LauncherCommand.java:115)
at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:84)
at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:54)
at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219)
at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171)
at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.wrapper.ThinJarWrapper.launch(ThinJarWrapper.java:125)
at org.springframework.boot.loader.wrapper.ThinJarWrapper.main(ThinJarWrapper.java:97)
... 18 more
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.springframework.cloud.launcher.deployer.DeployerApplication.<clinit>(DeployerApplication.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.thin.ThinJarLauncher.launch(ThinJarLauncher.java:192)
at org.springframework.boot.loader.thin.ThinJarLauncher.main(ThinJarLauncher.java:139)
... 24 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
at org.springframework.boot.loader.thin.ThinJarLauncher$ThinJarClassLoader.loadClass(ThinJarLauncher.java:449)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 34 more
The "?" should be your home directory. Maybe the JVM is weird in this container and doesn't expose $HOME
as System.getProperty("user.home")
? Some steps to reproduce would be helpful. I suspect it's to do with your base image though.
P.S. please learn to format your code and logs. You obviously already know about Markdown because you use it to (annoyingly) highlight parts of your issue description, so it should be easy to find docs on the other features that you aren't using.
Hello @DennisD2, I guess it may be related to security context policies from your openshift cluster.
Can you tell us which user is running your container (by using command whoami
in your pod terminal)?
If openshift security context restricted
is configured to run containers with a range uid user (MustRunAsRange
), then openshift will run the container with a numeric user from the configured range that has no home folder.
To overcome that, you can test by adding scc anyuid
to the default
service account in your openshift namespace (if you have cluster-admin permissions):
oc adm policy add-scc-to-user anyuid -z default -n <your_namespace>
This way your container will start with default parametered user (or root if no default user specified in your docker file)
Hi, @remyma, you're right with the guess that the user has no home directory. This is OpenShift default behaviour and each build is executed with another generated non-persistent user.
From the lines above it can be seen that $HOME was defined pointing to an existing writable directory without improving the issue (so, a home folder was defined).
I understand that maybe this can be solved by tweaking the OpenShift cluster policies.
I would prefer to have a simple configuration option, e.g. in an environment variable or whatever, to point to a file system path that can be used by SB Cloud CLI and everyone is fine.
But this issue is some months old and I finally stayed away from using the CLI in OpenShift clusters.
Hi, I tried to install the Spring Cloud CLI in an OpenShift Container. While Spring Boot CLI installs well and can run test application, Spring Cloud CLI install fails.
It looks as if maven dependencies are installed in a directory called '?' and later searched for in another directory '%3F' (which is ASCII HEX for '?').
I tried the same things on a non container Linux and windows with no problems. So the issue comes up from execution inside anOpenShift v3.7.23 Container (this container runs RedHat Enterprise Linux 7).
Is there a workaround or so for that situation?
I add the session below which shows the fail:
Up to here all went well. Spring Boot CLI was installed, can resolve dependencies and can start a simple test application. Spring Cloud CLI also was installed without errors.
Now I tried to start the config server, which fails:
Ok, the lines above are saying that the following file is not there:
This is correct. The dependencies were installed to another place (namely /tmp/sb/\?/.m2/repository/org/springframework/cloud/launcher/spring-cloud-launcher-deployer/2.0.0.RELEASE/spring-cloud-launcher-deployer-2.0.0.RELEASE.jar) , as can be seen below:
The directories are different:
leading to the error...