Cannot invoke workflow documentworkflow action publishBranch: action not allowed or undefined

Hi,

I am facing below error on frequent basis, we have our own authoring and from there through api we create content, while doing that some time we face this issue,

18.01.2024 10:39:29 ERROR Hippo JCR Quartz Job Scheduler_Worker-2 [ScheduleWorkflowTask$WorkflowJob.execute:132] Execution of scheduled workflow operation publish on /content/documents/myapp/xyz failed
org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publishBranch: action not allowed or undefined
        at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:302) ~[hippo-repository-workflow-14.5.0.jar:14.5.0]
        at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:278) ~[hippo-repository-workflow-14.5.0.jar:14.5.0]
        at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.triggerAction(DocumentWorkflowImpl.java:493) ~[hippo-repository-workflow-14.5.0.jar:14.5.0]
        at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publishBranch(DocumentWorkflowImpl.java:456) ~[hippo-repository-workflow-14.5.0.jar:14.5.0]
        at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:337) ~[hippo-repository-workflow-14.5.0.jar:14.5.0]
        at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_342]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_342]
        at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:382) ~[hippo-repository-engine-14.5.0.jar:14.5.0]
        at com.sun.proxy.$Proxy238.publish(Unknown Source) ~[?:?]
        at org.onehippo.repository.documentworkflow.task.ScheduleWorkflowTask$WorkflowJob.execute(ScheduleWorkflowTask.java:127) [hippo-repository-workflow-14.5.0.jar:14.5.0]
        at org.hippoecm.repository.quartz.RepositoryJobJob.execute(RepositoryJobJob.java:50) [hippo-repository-engine-14.5.0.jar:14.5.0]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.2.jar:?]
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?]

Can you please help me, we are using 14.5.0.
Thanks,
Manish

This means the user performing the publish action doesn’t have the authorization to publish, or the document is not in a state that allows a transition to the publish state.

@kumamanish You need to provide more context to this problem.
From the error above, we can only know that the logged-in user does not have permission to publish or the document is not corrupted state like @jasper.floor said.

Hi @Quang_Tran ,
Sorry, I am late, sharing context with you.
We are creating one document(name as my-document) from our authoring UI that conatins multiple compound(c1, c2, c3, c4, c5). We have created some default documents(prelems) by pointing to compounds(that is common to all).

Now from ui, we have to publish it.

Flow is:

  1. Prelems-documents will be created( If user is not happy with default data they can update it at authoring ui level itself so in that case a new prelem-document will be created with new data).
  2. After that, publish will be invoked at document level, here based on our requirements first prelems-documents will be published(created at 1 step) and then document will be published. it means atleast total 5+1 = 6 call for publish job.

During this operations we found this log :
15.05.2024 11:41:46 ERROR Hippo JCR Quartz Job Scheduler_Worker-1 [ScheduleWorkflowTask$WorkflowJob.execute:132] Execution of scheduled workflow operation publish on /content/documents/myapp/my-document failed org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publishBranch: action not allowed or undefined at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:302) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:278) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.triggerAction(DocumentWorkflowImpl.java:493) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publishBranch(DocumentWorkflowImpl.java:456) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:337) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at sun.reflect.GeneratedMethodAccessor415.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_342] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_342] at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:382) ~[hippo-repository-engine-14.5.0.jar:14.5.0] at com.sun.proxy.$Proxy238.publish(Unknown Source) ~[?:?] at org.onehippo.repository.documentworkflow.task.ScheduleWorkflowTask$WorkflowJob.execute(ScheduleWorkflowTask.java:127) [hippo-repository-workflow-14.5.0.jar:14.5.0] at org.hippoecm.repository.quartz.RepositoryJobJob.execute(RepositoryJobJob.java:50) [hippo-repository-engine-14.5.0.jar:14.5.0] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.2.jar:?] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?] 15.05.2024 11:41:46 ERROR Hippo JCR Quartz Job Scheduler_Worker-2 [ScheduleWorkflowTask$WorkflowJob.execute:132] Execution of scheduled workflow operation publish on /content/documents/myapp/my-document failed org.hippoecm.repository.api.WorkflowException: Cannot invoke workflow documentworkflow action publishBranch: action not allowed or undefined at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:302) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.scxml.SCXMLWorkflowExecutor.triggerAction(SCXMLWorkflowExecutor.java:278) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.triggerAction(DocumentWorkflowImpl.java:493) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publishBranch(DocumentWorkflowImpl.java:456) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at org.onehippo.repository.documentworkflow.DocumentWorkflowImpl.publish(DocumentWorkflowImpl.java:337) ~[hippo-repository-workflow-14.5.0.jar:14.5.0] at sun.reflect.GeneratedMethodAccessor415.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_342] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_342] at org.hippoecm.repository.impl.WorkflowManagerImpl$WorkflowInvocationHandler.invoke(WorkflowManagerImpl.java:382) ~[hippo-repository-engine-14.5.0.jar:14.5.0] at com.sun.proxy.$Proxy238.publish(Unknown Source) ~[?:?] at org.onehippo.repository.documentworkflow.task.ScheduleWorkflowTask$WorkflowJob.execute(ScheduleWorkflowTask.java:127) [hippo-repository-workflow-14.5.0.jar:14.5.0] at org.hippoecm.repository.quartz.RepositoryJobJob.execute(RepositoryJobJob.java:50) [hippo-repository-engine-14.5.0.jar:14.5.0] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.3.2.jar:?] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.3.2.jar:?]

It is intermittent, by using same prelems some time able to publish documents some time not.

As you have mentioned : User does not have permission to publish or document is not in a state that allows a transition to the publish state.
Reverting : We have a admin user that has used for authoring ui to cms communication, now how we can ensure that document was not at ready state?.

I need your help on this, please ask if you need more info.

Do you see any other exceptions before or after this error? Things like NoSuchItemStateExcpetion?

No @jasper, do I need to enable to some specific logs?, please help me on same.
This we are getting during any item publish, below is the request payload we have used to publish items. Correct me if we are doing in a wrong manner.

{
    "name": "hippo:request",
    "primaryType": "hipposched:workflowjob",
    "mixinTypes": [],
    "properties": [
        {
            "name": "hipposched:repositoryJobClass",
            "type": "String",
            "multiple": false,
            "values": [
                "org.onehippo.repository.documentworkflow.task.ScheduleWorkflowTask$WorkflowJob"
            ]
        },
        {
            "name": "hipposched:attributeValues",
            "type": "String",
            "multiple": true,
            "values": [
                "50478c97-f815-48e2-9958-61be7295f57e",
                "publish"
            ]
        },
        {
            "name": "hipposched:attributeNames",
            "type": "String",
            "multiple": true,
            "values": [
                "hipposched:subjectId",
                "hipposched:methodName"
            ]
        }
    ],
    "nodes": [
        {
            "name": "hipposched:triggers",
            "primaryType": "hipposched:triggers",
            "mixinTypes": [],
            "properties": [],
            "nodes": [
                {
                    "name": "default",
                    "primaryType": "hipposched:simpletrigger",
                    "mixinTypes": [
                        "mix:lockable"
                    ],
                    "properties": [
                        {
                            "name": "hipposched:startTime",
                            "type": "Date",
                            "multiple": false,
                            "values": [
                                "2024-05-27T07:53:00.741Z"
                            ]
                        },
                        {
                            "name": "hipposched:nextFireTime",
                            "type": "Date",
                            "multiple": false,
                            "values": [
                                "2024-05-27T07:53:00.741Z"
                            ]
                        }
                    ],
                    "nodes": []
                }
            ]
        }
    ]
}

Thanks,

Sorry, I don’t have any more insight to offer. If you need more help I suggest reaching out to our PS department.