cancel
Showing results for 
Search instead for 
Did you mean: 

Could not execute code stage because exception thrown by code stage: Access to the path is denied.

DilipK
Level 3
Hi Team,

I have code stage which will create an xml format and  save in common shared folder. It works well in test environment and in prod it failed with the below error msg.

Could not execute code stage because exception thrown by code stage: Access to the path(shared folder) is denied.

Note : This code was working almost an year now but now I m facing this issue. Weird.


System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();
string Formatted_XML="";
Formatted_XML = XDocument.Parse(XML).ToString ();
xdoc.LoadXml(Formatted_XML);
xdoc.Save(File_Name);

steps taken:

1)Indeed I checked the access to the path " the bot has all the access to save the file in shared folder" but did not work
2)I cleared all the temp files and restarted the machine by using login agent but did not work 
3)Both user have access to the same VDI? Does it cause the issue .. However I tried to work only on the bot  machine even though the same problem
What could be the other issues causing this error? Please share your insights on this.

Regards,
Dilip K

------------------------------
Dilip K
Consultant
HCL Technologies
UTC
------------------------------
4 REPLIES 4

Hi Dilip

How is the shared folder stored in your bot is it for example T:\my folder\my files\

Does your bot access the folder fine if your run it manually but cant access if its run through the scheduler? 

If so then change your folder address to look like this \\my folder\my files\ and try running it from the scheduler again and this should hopefully resolve the issue. If not then check the level of access hasnt changed to the folder your are trying to access.

Hope this helps 🙂

------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------

ERROR: Internal : Could not execute code stage because exception thrown by code stage: Access to the path 'M:\case_data\p\scp\capture\buddyOnly\XXXXXX_01012021055444.xml'(time stamp now is enabled at end of the file name) is denied

M:\case_data\p\scp\capture\buddyOnly\ is the default path folder which is stored in environment variable 

The bot is not able to access the file either manually or scheduler

Do you want me to change the folder structure to  M:\\case_data\p\scp\capture\buddyOnly\ ?

Regards,
Dilip K


------------------------------
Dilip K
Consultant
HCL Technologies
UTC
------------------------------

Hi dilip

If you remove the drive letter completely so it looks like this \\case_data\p\scp\capture\buddyOnly\

------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------

Hi ,

There was some problem in bot account  and after the windows updates ,the error is gone. Thanks for all your help

------------------------------
Dilip K
Consultant
HCL Technologies
UTC
------------------------------