-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
-
710.v4b_94b_077a_808
Environments:
- Jenkins Version: 2.346.3
- Plugin Version: 612.v84da_9c54906d
Steps:
- Turn on cache for 'Global Pipeline Libraries' in 'Configure System' and specify a refresh interval greater than 0.
- Cache expiration detected, the plugin deletes the existing cache folder and creates a new empty cache folder with the name generated from some hash function.
- The plugin fails to fetch library from GitHub repository (e.g. the GitHub server is under maintenance).
- All subsequent pipelines trying to load the library from the cache folder fail with following errors.
Loading library some_library_name@some_tag_version Library some_library_name@some_tag_version is cached. Copying from home. ERROR: Library shared-lib expected to contain at least one of src or vars directories org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed
By navigating to '$JENKINS_HOME/global-libraries-cache', the cache folder is there but the contents are corrupted.
Only after next expiration, the plugin will attempt another try to refresh the cache. The situation is even worse when the refresh interval is relatively long.
The root cause is that the plugin determines the existence of a library cache by checking the existence of the cache folder and uses the modification time of the cache folder to determine if the cache has expired, regardless of the content of the folder.
The improvement I'd suggest is that removing the newly created cache folder if the plugin fails to fetch libraries, to let the next pipeline have the chance to re-create the cache, rather than to wait for next cache expiration.
- duplicates
-
JENKINS-72287 Shared Global Libraries Cache Issues
- Closed
- is duplicated by
-
JENKINS-72996 Shared Library cache is broken when build is aborted during scm retrieve
- Closed
- is related to
-
JENKINS-73769 Handle empty global libraries and change libraryPath
- Resolved