a year ago
Hi, I migrated my spring application to Metal a couple of weeks ago and now the deployment keeps crashing with this error:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.micrometer.core.instrument.binder.system.ProcessorMetrics]: Factory method 'processorMetrics' threw exception with message: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null.
The same code was running without any issues on the legacy servers, since I can't go back to the legacy servers my application is now unavailable. Is there a different config needed for Metal? Thanks.
Pinned Solution
a year ago
I would recommend upgrading to at least Java 21. 21 is latest LTS, so you should probably be on it anyway. I see many people with this issue on this image of Java 17 and none on Java 21.
9 Replies
a year ago
Hey! Are you using your own dockerfile or any of the railway included builders like Nixpacks or Railpack?w
a year ago
I'm using my own dockerfile
a year ago
Looks like its trying to get a controller that doesn't exist, which is what I think is for performance instrumentation. Do you have any more logs?
a year ago
This is the only relevant part of the log, it repeats itself a couple of times.
I've tried removing all the performance related dependencies, and disabling spring's performance metrics with:
management.metrics.enable.processor: false
But it doesn't change anything
a year ago
Can you share your Dockerfile? I see a few reports of this happening with outdated version of JDK.
a year ago
This is the dockerfile:
FROM gradle:8.2.1 AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle bootJar
FROM openjdk:17-jdk-slim-buster
EXPOSE 8080
COPY --from=build /home/gradle/src/build/libs/backend-1.0.0.jar /app/
RUN bash -c 'touch /app/backend-1.0.0.jar'
ENTRYPOINT ["java","-jar","/app/backend-1.0.0.jar"]a year ago
I would recommend upgrading to at least Java 21. 21 is latest LTS, so you should probably be on it anyway. I see many people with this issue on this image of Java 17 and none on Java 21.
a year ago
That solved it, thanks!
Status changed to Solved medim • about 1 year ago