System exception at initialization: You are not authorized! Error code: 0 at Source: UiPath.System.Activities

Hi,

Orchestrator(On Premise) version: 2022.10.4
Studio version: 2023.4.1
Assistant version: 2023.4.1

I am getting to different error messages.
When the robot user executes the process on the studio server it can write to the excel file.

The issue arrises when I run the unattended robot on a different machine then i get the error message:

System exception at initialization: You are not authorized! Error code: 0 at Source: UiPath.System.Activities

and directly after:

Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object. at UiPath.Excel.Activities.ExcelInteropActivity`1.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Things I have done:

  • Checked permission on the directory.

  • Updated dependecies, UiPath.System.Activities dependency from 23.4.3 → 23.4.4 and
    UiPath.Excel.Activities dependency from 2.20.1 → 2.20.2

  • Deleted the nuget the two dependencies above from the nuget folder from the unattended robot server.

  • Added kill process(EXCEL)

Note that the robot is able to delete files(.txt and .png which is part of cleanup flow) from the folder where the problem occurs.

I have triggered this process through an API call and directly through orchestrator, both times i deleted the package from the nuget folder beforehand.

Am i missing something obvious?

I just created a small flow where the robot creates a new .xlsx and .txt file. Then it edited a cell in the Excel file. No issues.

So based on this something has happended with this file somehow. But why does it work from the Studio Server and not where the unattended one resides?
I also tried to do it manually on the unattended server and then it worked.

Im really confused.

Nevermind, I found the issue. The problem was the activity after Excel(Log messages saved the day haha).

The activity that caused the issue was “Get queue items”. I forgot that the migration to modern folder probably changed how the process what executed.

Solution: I gave the unattended user a different role and now it works great!