'User not authorized' when trying to complete reassigned task

Hey everyone,

I’ve run into an issue. I have a BPM process that can be seen here:

At step1, the owner of the task is “starter”, then on step2, the owner changes to “team_leader”. Both are users that belong to the same group, have all permissions in place, however, I can’t complete step2, I get a “user not authorized” error…

I have looked at the cockpit and I see that the task is properly assigned. What am I doing wrong? I need the task to move past this step… Not sure what other details I can provide.

Thanks in advance for any help.

Hi @allanrojas,

do you try to complete step2 in same browser? Could you try to complete it in incognito mode?

Cheers
Askar.

Just did, same error :frowning:

ok, could you attach your process defintion please?

I lost you there, is this something I export from the cockpit ? or how do I do it?

Hi @allanrojas,

I am talking about your .bpmn.xml file,

Cheers,
Askar

review_client_observations.bpmn (14.3 KB)

Oh, sorry, here it is. There are html forms and java delegates used in it. We populate the “starter” and “team_leader” variables at the beginning in the first delegate.

Hi @allanrojas,

what will be print out if, you attach a start listener and print out starter and team_leader variable values at that user task?

Could you please try to look up user ID of any team leader in the database, et it on the user task and try to complete, would that work? You can execute folowing query to lookup user id in database SELECT * FROM ACT_ID_USER .

May be you could also take a look here to see if it heps to understand assignment process beter:

Cheers,
Askar

I have done the listener and “starter” and “team_leader” have proper values. I can also verify this in the Cockpit. Perhaps I need to explain this better:

  • I have 2 users. UserA and UserB, both belong to the same Group.
  • UserA starts a task process.
  • At some point, the task gets assigned to UserB. (I do this by changing the “Assignee” property of the task as can be seen in the screenshot above)
  • I can see that the reassignment is successful, since the task disappears from UserA’s tasklist and appears in UserB’s tasklist.
  • When UserB presses the “complete” button to move the flow to the next step, he gets the “User Not Authorized” error.

I must be missing something. Perhaps the re-assignment must be done in the Java delegate? Or I’m missing a call to something like identityService.setAuthenticatedUserId() ?

One little update,

  • If UserA has the task, but I go into Camunda and “unclaim”
  • Then login as UserB, go to unnassigned tasks, and “claim”
  • I get the same error “user not authorized” if I try to complete the task.
  • If UserA goes and claims the task again, he can complete it.

Any other ideas?

Hi @allanrojas,

there should be exception in log available I assume, could you attach it please?

Cheers,
Askar.

How do I see the camunda system logs? I can’t seem to find an option if I login as an admin. I saw how to retrieve the Java logs here, but not sure if that’s what you mean:

https://docs.camunda.org/manual/7.4/reference/rest/history/job-log/get-job-log-stacktrace/

@allanrojas,

you need to take a look in your application server logs folder. Which distribution are you using?

Cheers,
Askar.

camundalogs.txt (15.7 KB)

Here are the logs dated today, all I did in the system was the test as described above. Curious that the logs don’t show the “user not authorized” error, but show the calls made by the process ID, perhaps I need to enable more verbosity somewhere?

@allanrojas

are you sure this is log file from application serve? Looks more like HTTP server access log to me. Could you take a look in application server (Tomcat or Wildfly or whatever your distribution is running on)

Cheers,
Askar.