Description:
Recent merge (#114 - Add report lifecycle management) causes prod crashes with this error (from pod logs):
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reportExpirationService' ...
Caused by: java.lang.IllegalStateException: Encountered invalid @Scheduled method 'expireOldReports': Could not resolve placeholder 'cleanup.expire-cron' in value "${cleanup.expire-cron}"
Similar for cleanup.delete-cron.
Cause: New placeholders in @Scheduled (cron for expire/delete) lack values in prod. Set in test/application.yml but not in Kubernetes deployment (Jenkinsfile). App can't resolve them → startup crash.
Also (from earlier PR): Google OAuth2 needs proper prefix on env-vars to create ClientRegistrationRepository bean, or authentication fails. This has been confirmed working after manual patching of the deployment manifest.
Impact: App doesn't start in prod; pods loop restarting.
Proposed fix: Update Jenkinsfile in Generate Kubernetes Manifests stage (deployment.yaml). Add these env-vars after existing ones (e.g., after GOOGLE_MAPS_API_KEY):
- REPORT_DELETEEXPIREDAFTERDAYS="30" # Days after expiration before permanent delete
- CLEANUP_EXPIRE_CRON="0 0 * * * ?" # Hourly
- CLEANUP_DELETE_CRON="0 30 2 * * ?" # Daily at 02:30
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_ID from secret
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_SECRET from secret
- SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_SCOPE="openid,profile,email"
Description:
Recent merge (#114 - Add report lifecycle management) causes prod crashes with this error (from pod logs):
Similar for
cleanup.delete-cron.Cause: New placeholders in
@Scheduled(cron for expire/delete) lack values in prod. Set in test/application.yml but not in Kubernetes deployment (Jenkinsfile). App can't resolve them → startup crash.Also (from earlier PR): Google OAuth2 needs proper prefix on env-vars to create
ClientRegistrationRepositorybean, or authentication fails. This has been confirmed working after manual patching of the deployment manifest.Impact: App doesn't start in prod; pods loop restarting.
Proposed fix: Update Jenkinsfile in
Generate Kubernetes Manifestsstage (deployment.yaml). Add these env-vars after existing ones (e.g., after GOOGLE_MAPS_API_KEY):