Hi!
I have a problem with error "Tried to update an entity that does not exist" on different transitions on workflow. It shows sometimes for a few second, but then disappear and all post-functions and automations works correctly. Some days I don't see this error at all.
So that error don't a real error - all procceses works fine - but it's really confusing.
What is common:
1) I have a rule that trigger on every comment with special tag and post a "public duplicate" (way to create anonymous public comments on Jira SD)
2) Post-function that pulling a JSON to create a worklog (Worklog PRO) note from admin, that then edited to assignee name (not very correct, but dont know yet how to fix that)
But it also happens on transitions that don't have 1 (only internal comment) or 2 (no worklog note) - but have one from that list. I tried to add a "sleep" in Thread to make "adding" new info in issue a bit longer - at first I thoung that it helped, but error still exist.
Also all transitions have validators for field required (comment and others) - I'm not sure that there may be a problem.
Will be grateful for any advice!
Do you see any error or stack traces in atlassian-jira.log file?
Yes, when it shows.
[c.a.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 51 from workflow 15615 on issue 'SDP-4795' com.opensymphony.workflow.StoreException: Error marking step #18990 finished: root cause: Tried to update an entity that does not exist. at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.markFinished(OfbizWorkflowStore.java:241)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you include all of the stack trace please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2020-07-23 11:19:28,823+0300 http-nio-8080-exec-8 ERROR admin 679x81051x1 1rlsxju 172.19.119.144,127.0.0.1 /secure/CommentAssignIssue.jspa [c.a.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 51 from workflow 15615 on issue 'SDP-4795' com.opensymphony.workflow.StoreException: Error marking step #18990 finished: root cause: Tried to update an entity that does not exist. at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.markFinished(OfbizWorkflowStore.java:241) at com.opensymphony.workflow.AbstractWorkflow.createNewCurrentStep(AbstractWorkflow.java:917) at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1399) at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:557) at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:842) at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:799) at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:514) at com.atlassian.jira.web.action.issue.CommentAssignIssue.doExecute(CommentAssignIssue.java:161) ... 1 filtered at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63) ... 7 filtered at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ... 48 filtered at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55) ... 8 filtered at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37) ... 4 filtered at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54) ... 3 filtered at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55) ... 8 filtered at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21) ... 62 filtered at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66) ... 1 filtered at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64) ... 39 filtered at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30) ... 5 filtered at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:213) at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136) at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89) at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:204) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:135) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:124) ... 4 filtered at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37) ... 8 filtered at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21) ... 4 filtered at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36) ... 26 filtered at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25) ... 25 filtered at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: org.ofbiz.core.entity.GenericEntityNotFoundException: Tried to update an entity that does not exist. at org.ofbiz.core.entity.GenericDAO.singleUpdate(GenericDAO.java:366) at org.ofbiz.core.entity.GenericDAO.customUpdate(GenericDAO.java:282) at org.ofbiz.core.entity.GenericDAO.update(GenericDAO.java:262) at org.ofbiz.core.entity.GenericDAO.update(GenericDAO.java:232) at org.ofbiz.core.entity.GenericHelperDAO.store(GenericHelperDAO.java:257) at org.ofbiz.core.entity.GenericDelegator.store(GenericDelegator.java:1721) at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.markFinished(OfbizWorkflowStore.java:231) ... 285 more Root cause: org.ofbiz.core.entity.GenericEntityNotFoundException: Tried to update an entity that does not exist. at org.ofbiz.core.entity.GenericDAO.singleUpdate(GenericDAO.java:366) at org.ofbiz.core.entity.GenericDAO.customUpdate(GenericDAO.java:282) at org.ofbiz.core.entity.GenericDAO.update(GenericDAO.java:262) at org.ofbiz.core.entity.GenericDAO.update(GenericDAO.java:232) at org.ofbiz.core.entity.GenericHelperDAO.store(GenericHelperDAO.java:257) at org.ofbiz.core.entity.GenericDelegator.store(GenericDelegator.java:1740) at org.ofbiz.core.entity.GenericDelegator.store(GenericDelegator.java:1721) at com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore.markFinished(OfbizWorkflowStore.java:231) at com.opensymphony.workflow.AbstractWorkflow.createNewCurrentStep(AbstractWorkflow.java:917) at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1399) at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:557) at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:842) at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:799) at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:514) at com.atlassian.jira.web.action.issue.CommentAssignIssue.doExecute(CommentAssignIssue.java:161) ... 1 filtered at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:63) ... 7 filtered at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ... 48 filtered at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55) ... 8 filtered at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:37) ... 4 filtered at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54) ... 3 filtered at com.atlassian.diagnostics.internal.platform.monitor.http.HttpRequestMonitoringFilter.doFilter(HttpRequestMonitoringFilter.java:55) ... 8 filtered at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21) ... 62 filtered at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66) ... 1 filtered at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64) ... 39 filtered at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30) ... 5 filtered at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:213) at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136) at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89) at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:204) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:135) at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:124) ... 4 filtered at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37) ... 8 filtered at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21) ... 4 filtered at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36) ... 26 filtered at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25) ... 25 filtered at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I could not find something much useful. This is the failing method. It seems that on line 3 it is able to find value in DB, but when trying to store it on line 8 with "store" command it is already gone. This is something related with Thread synchronization. This is the reason it sometimes happens and sometimes does not happen. But I don't have any extra information about how to solve it.
public Step markFinished(Step step, int actionId, Date finishDate, String status, String caller) throws StoreException {
try {
GenericValue gv = this.gd.findByPrimaryKey("OSCurrentStep", UtilMisc.toMap("id", new Long(step.getId())));
gv.set("actionId", new Integer(actionId));
gv.set("finishDate", new Timestamp(finishDate.getTime()));
gv.set("status", status);
gv.set("caller", caller);
this.gd.store(gv);
SimpleStep theStep = (SimpleStep)step;
theStep.setStatus(status);
theStep.setFinishDate(finishDate);
theStep.setActionId(actionId);
theStep.setCaller(caller);
return theStep;
} catch (GenericEntityException var8) {
throw new StoreException("Error marking step #" + step.getId() + " finished", var8);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your attention!
I still think that problems 1 and 2 may both affect the error occurrence.
I'm not sure, but are you a developer of Worklog Pro?
If yes, thank you very much for that plugin!
And may I ask one more question please?
That's about problem 2. I create a JSON that is authorized from ''admin", but set Name (in the journal) as name of assignee that work for issue. And that nore marked as "edited", like the original Name was "admin".
It's russian language, but I hope the picture with interface will make it a bit more clear:
On red label there is "admin - date"
May that "updating" the note to change the Name cause the problem with Thread? Like the note is not yet published, but trying to update the name?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes and I'm happy to hear that you like our add-on.
I'm not sure I got your issue correctly? Don't you want it to be shown as "Edited by admin", that is the red part?
If it is not too long, can you share your code, at least the section related with WorklogPRO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I don't want it also, but even if it stay that way - may that occure the problem with "entity that doesn't exist"?
I'm sorry for difficult explanation, haven't practiced English for a long time.
The main purpose of that code - auto time deduction on every transition (except one).
It get assignee of original issue (that was before the transition), get previous status (that came from - for comment), difference in time between statuses for time spent and get group value as attribute of that note.
def authString = "admin:password".getBytes().encodeBase64().toString()
def body_req = '''{
"issueKey": "'''+issKey+'''",
"workStart": "'''+startDate+'''",
"timeSpent": "'''+differenceInSeconds+'''",
"authorUserKey": "'''+userKey+'''",
"comment": "Время в статусе '''+statusName+'''",
"adjustEstimate": "auto",
"workLogAttributes": [
{
"attrTypeId": "'''+groupAttrType.getID()+'''",
"attrValue": "'''+current_group+'''"
}
]
}'''
URL url = new URL("https://myjira.net/rest/com.deniz.jira.worklog/1.0/worklog")
def connection = url.openConnection() as HttpURLConnection
connection.setRequestMethod( "POST" )
connection.setRequestProperty( "Authorization", "Basic ${authString}" )
connection.doOutput = true
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8")
connection.getOutputStream().write(body_req.getBytes("UTF-8"))
connection.connect()
def postRC = connection.getResponseCode();
if(postRC.equals(200))
{
log.info(connection.getInputStream().getText());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If worklog author is different than current user, WorklogPRO always marks the worklog as edited by current author. Currently only way to get rid of edited indicator is making authorUserKey equal to the user in your authString, and I don't think it is possible for your use case.
Your stack trace doesn't show anything related with WorkloPRO, and I don't think above code will cause a problem with issue transition code. My interpretation of above stack trace is, an issue transition is failing, not adding a comment or worklog. Issue transition failing because someone/some code is already completing the transition of issue. Since you are getting an error on issue transition page (??) this problem is occurring on the request thread which is triggered by user transitioning the issue. If there is a way, you may try to remove Thread from post function completely.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
All that time I thought in wrong way, now I'll search into other possible reasons (cause i was pretty sure the problem is somewhere around that).
Thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.