I'm using Gitlab-CI
to build my application and have a weird error on some runners (Docker executors) when my service is starting. Indeed, on some runners, the service crashes at startup with a ClassNotFoundException
, and works perfectly on others runners.
This is the part of my .gitlab-ci.yml
which is relevant :
mvn-build:
services:
- name: my-repository.com:5002/networklocation/configuration-api:1.0.23
alias: configuration
variables:
CNB_PLATFORM_API: ""
SPRING_PROFILES_ACTIVE: docker
This configuration-api
application is a Java Spring Boot application built with Paketo Cloud Native Buildpacks.
Here are the logs when the job is scheduled on a non-working runner :
[service:configuration-api] 2023-02-23T08:30:33.319822839Z Error: Could not find or load main class org.springframework.boot.loader.JarLauncher
[service:configuration-api] 2023-02-23T08:30:33.320160182Z Caused by: java.lang.ClassNotFoundException: org.springframework.boot.loader.JarLauncher
The only workaround I have found is to connect to the runner and do a docker volume prune
. After that operation, the service is working correctly for some time, until a new build breaks it on some runners.
All runners are configured as docker executors and are in the same version (currently 15.8.1)
One hypothesis I have is that Cloud Native Buildpacks creates image without timestamp, may this cause some issues ? Is there anything else that may cause this issue ?