-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Unable to start alpine based docker images #5609
-
I have a alpine based docker image which is getting deployed as Pod in K8s deployment. It deploys well for all customers except one.
It just has only one line in log file.
Error: An unexpected error occurred while trying to open file app.jar
however when i run entry point with -Xdiag (java -jar -Xdiag app.jar), i get detailed log
java.nio.file.FileSystemException: unload-service.jar: Function not implemented
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:148)
at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1432)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:717)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:251)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:180)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:346)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:317)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:256)
at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:561)
at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:787)
at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:695)
The above error seems little generic and do not give us pointers what is missing.
We have checked a few things , like app.jar is available at the location and is user has permissions to run it. the JDK version (openjdk version "17.0.12" 2024年07月16日, which is inline with other images). Tried running java -jar -Xdiag -verbose app.jar
Any sugestions here will be helpful
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
I don't have a clear-cut answer to this, but perhaps some pointers;
Function not implemented is the text-representation used by Golang for an ENOSYS error. It's hard to tell exactly what's causing it, but it could be;
- the container trying to make a syscall that's not supported by the host; this can happen if the container is running with a more recent "user land" than the host. In many codebases, and
ENOSYSmay trigger it to fallback to an alternative syscall, but that's not always the case (in some cases this can be caused by theseccompprofile used) - another possible cause (given that I see extracting an archive is involved), is if the extracted archive contains extended-attributes (xattrs), and the container filesystem doesn't support extended attributes, or it's trying to set an extended attribute that's not supported by the platform (we've had some cases where, e.g., macOS-specific extended attributes were included in an archive, and trying to set those on a Linux platform would make Linux refuse to set them).
Beta Was this translation helpful? Give feedback.
All reactions
-
Containers are running in K8s cluster (kubectl version 1.30).
container is running with a more recent "user land" than the host
Are you trying to suggest that host kernel is very old which may have compatibility issue with container OS.
I see similar regression bug reported with openJDK (17.0.11), but its not exactly same (this issue is also observed while reading extended-attribute). With our images we are using openJDK17.0.12.
https://bugs.openjdk.org/browse/JDK-8337966 (Operation not permitted instead of Function not implemented )
This above bug is regression introduced
https://bugs.openjdk.org/browse/JDK-8316304
Beta Was this translation helpful? Give feedback.