Comments (7)
can you pls activate this logger and post here the log?
thx
from lockable-resources-plugin.
We have the same problem. This is all I see (logging ALL of org.jenkins.plugins.lockableresources) after starting jenkins and loading the lockable resource page on Jenkins:
Jan 10, 2024 4:26:04 PM FINE org.jenkins.plugins.lockableresources.BackwardCompatibility compatibilityMigration
lockable-resources-plugin compatibility migration task run for 95 resources
Jan 10, 2024 4:26:04 PM INFO org.jenkins.plugins.lockableresources.NodesMirror createNodeResources
lockable-resources-plugin: configure node resources
Jan 10, 2024 4:26:04 PM FINE org.jenkins.plugins.lockableresources.FreeDeadJobs freePostMortemResources
lockable-resources-plugin free post mortem task run
I can reproduce it like this
- reserve all resources of a specific label
- start a pipeline job that tries to lock a resource with that label. This build ends up as a queuedContext in the XML
- restart Jenkins (https://jenkins/restart)
When Jenkins starts up again, and after opening the lockable resources page, I get the NullPointerException. Also when starting the same job again, it fails with that NullPointerException.
Pipeline: Groovy (workflow-cps) Version 3837.v305192405b_c0
Lockable Resources Version 1222.v3d55a_36d63e4
Jenkins 2.426.2
from lockable-resources-plugin.
feel free to review changes in the related PR #609
from lockable-resources-plugin.
I've tried the version of PR #609. Now the pipeline job waits for an available resource, but when I manually unreserve one of those resources, I still get the NullPointerException.
jenkins | Caused by: java.lang.NullPointerException: Cannot invoke "org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner.get()" because "this.executionRef" is null
jenkins | at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getExecution(CpsStepContext.java:217)
jenkins | at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadGroupSynchronously(CpsStepContext.java:242)
jenkins | at org.jenkinsci.plugins.workflow.cps.CpsStepContext.getThreadSynchronously(CpsStepContext.java:236)
jenkins | at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:293)
jenkins | at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
jenkins | at org.jenkins.plugins.lockableresources.LockableResourcesManager.unreserve(LockableResourcesManager.java:961)
jenkins | at org.jenkins.plugins.lockableresources.actions.LockableResourcesRootAction.doUnreserve(LockableResourcesRootAction.java:581)
jenkins | at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
jenkins | at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
jenkins | ... 116 more
When I make the same change at https://github.com/mPokornyETM/lockable-resources-plugin/blob/fix-possible-npe-in-get-queue/src/main/java/org/jenkins/plugins/lockableresources/LockableResourcesManager.java#L965 (catch all exceptions), then I can unreserve the resource again. So then there is one resource free, but the pipeline only continues after unreserving another resource, as unreserving the first time only tries to continue with the invalid queuedContext.
from lockable-resources-plugin.
because "this.executionRef" is null
strange, the exception "because "this.executionRef" is null" happens in other plugin. Not here, I tries just to cacht it. May we chat samewhere else. I need maybe some more configs ... , Because I have really no idea, how can I simulate it.
Or can you try to write test case in this branch, which can simulate the scenario?
from lockable-resources-plugin.
Unfortunately, I can't reproduce it in a development environment, so I don't know what triggers the problem.
I can force it in a development environment by removing the "executionRef" element from a QueuedContextStruct in the XML. Not sure if this is useful for finding the actual problem though, but it seems to yield the same results in the lockable resources plugin.
<org.jenkins.plugins.lockableresources.queue.QueuedContextStruct>
<context class="org.jenkinsci.plugins.workflow.cps.CpsStepContext" plugin="[email protected]">
<executionRef class="flow-owner" plugin="[email protected]">
<job>lock-resource-long-time</job>
<id>60</id>
</executionRef>
<id>7</id>
<bodyHeads/>
<body class="org.jenkinsci.plugins.workflow.cps.HandleBodyReference">
<id>5</id>
</body>
<threadId>4</threadId>
<stepDescriptorId>org.jenkins.plugins.lockableresources.LockStep</stepDescriptorId>
</context>
<lockableResourcesStruct>
...
</org.jenkins.plugins.lockableresources.queue.QueuedContextStruct>
from lockable-resources-plugin.
Thats too much hacking. I mean, when the xml file is broken, or other plugin throws unexpected exceptions, it is too hard to handle it here.
Anyway, I thinkg the proposed changes are OK. Because it does not matter, why the item can not be proceeded. It shall be removed from queue.
from lockable-resources-plugin.
Related Issues (20)
- Slash in name breaks navigation in lockable resource view for labels HOT 4
- Option to randomly assign a resource when requested by label HOT 2
- Ability to lock one resource from list, not by label HOT 2
- Re-define ephemeral resources used by revived builds when Jenkins controller is restarted HOT 1
- Aquire lock without using try-with-resources notation HOT 4
- Print detailed lock cause in the build log
- Name and value of properties are missing on api HOT 2
- ConcurrentModificationException when serializing LockedResourcesBuildAction#lockedResources HOT 5
- get lock by resource name result in NPE HOT 3
- Deadlock on Jenkins controller while using lockable resources HOT 13
- Trim spaces from resource name, otherwise it will stuck HOT 1
- Throw excpetion when count of requiered resources is bigger then current count of resources HOT 1
- Unqueue all items contains the build, when the build has been canceled / killed (to improve performance) HOT 1
- Use of [] for extra to not lock is not working anymore with 1232.v512d6c434eb_d release HOT 7
- LRM lacks a method to remove a lockable resource from the list HOT 3
- Empty ressource is not allowed anymore HOT 11
- Lease Time HOT 1
- jenkins startup failure HOT 22
- Is there any API documentation on what is supported? Can this be used from command line outside of jenkins? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lockable-resources-plugin.