![]() |
| |||||||
Automation Anywhere Server & Enterprise Post messages and questions related to Automation Anywhere Server or Automation Anywhere Enterprise here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
|
We recently switched over to server version and I'm getting intermitent results from tasks now. I've uploaded the task for reference. Statement 85 is a simple rename on a file. Statement 94 is a copy for that renamed file to a new location. The task records errors in a log and it shows an error at statement 94, being unable to copy the file. The reason is its expecting the file to be named according to the rename in stmt 84, but this statement doesn't appear to execute and it doesn't record an error. You'll see a message box at stmt 83 and another at 92. I get both of these messages. The rename isn't conditional, so it should just run, but I don't get a renamed file. I had this problem with this script last week and wound up "fixing it" by deleting and re-adding the line. That hasn't helped this time. I've reboot, stopped my anti-virus and shut down unnecessary applications. any ideas would be appreciated. |
| |||
|
Hello, To get the path of the folder where the file is stored (inside 'Loop for each file in a folder') use the system variable $CurrentDirectory$. The text format of task would appear something like this, Start Loop " Each File in $LocalPath$" Rename Files "$CurrentDirectory$\$FileName$.$Extension$" to "$FileName$_DEL_NOTE.$Extension$" Copy Files "$CurrentDirectory$\$FileName$_DEL_NOTE.$Extension $" to "$NetworkPath$\$SellingYear$\$SellingSeason$\" End Loop Hence, in 'Rename Files' and 'Copy Files' you need to replace variable, $LocalPath$ with $CurrentDirectory$. Hope that helps. |
| |||
|
ok - well I guess I have several thoughts about that. 1) I re-downloaded the task from the server with the exact same code and it performs properly now. 2) If the variable $LocalPath$ didn't contain the correct value then the file wouldn't be found and the task should encounter an error, post a log entry in its error log and terminate. It doesn't do that. It just ignores the statement. I know it hits this statment because of the various things I've done to debug it. I see it hitting the statements just prior to and subsequent to the rename. 3) I use this method, rename and then copy with this $LocalPath$ variable in other tasks, so I know this is a valid technique, unless your stating that there is something special about the rename function itself or something unreliable about the engine interpreting this code. This is the only task I have that encounters this problem and even its fixed now by visually identical code. I can do the rename manually, so I know its not a windows rights problem. Any other ideas? |
| |||
|
Hello, This is very strange as we have never heard or seen such type of behaviour before. However, let us investigate. Is it possible due to some reason the Rename Files command taking little long to rename the file and meanwhile the task executed Copy Files command and hence the error. To check this you can insert 'Loop while File does not exists' command after Rename Files command and inside loop block you can log the status say 'File not renamed' in a text file. Once, the file would be renamed the task will come out of the loop to execute the next statements in task after 'End Loop'. You can then log the status as 'File renamed' then put 'Copy Files' command. The text format of task would appear something like this, Rename Files "$LocalPath$\$FileName$.$Extension$" to "$FileName$_DEL_NOTE.$Extension$" Loop While File Does Not Exist("$LocalPath$\$FileName$_DEL_NOTE.$Extension$ "") Log to File: File isn't renamed. in "C:\temp.txt" End Loop Log to File: File is now renamed. in "C:\temp.txt" Copy Files "$LocalPath$\$FileName$_DEL_NOTE.$Extension$" to "$NetworkPath$\$SellingYear$\$SellingSeason$\" Also, if you could give us the path you have specified in variable, $LocalPath$ then we can reproduce the similar scenario at our end and could suggest the viable solution. Hope that helps. |
| |||
|
Yes - it is strange as the tool has been generally reliable. The path in $LocalPath$ is \\imagewh\media\Delivery_Note\Unprocessed. You'll see its the path used in the major loop. I'd thought about the timing an bit, which is why I'd inserted the 50ms delay. Also, in my "debug" mode I stop for messages which involves a stop of several seconds - more than enough time to complete the command. I've created an exe for this and used it the last several days. It has worked fine, so I will leave this alone for now. Should the issue re-occur I'll try the looping strategy, but I think we'll both agree that it shouldn't be necessary. |
| |||
|
ok - so there is something decidedly broken about the engine running the new server version of AA. I've changed this task to loop while the rename executes. I've uploaded the new task and the error log. When this fails now I get a windows error. Error: Access violation at 0x7C92ABD5 (tried to write to 0x00030F64), program terminated. I use these methods in numerous other Automations, so something here is broken. Task and Error Log attached for your reference. I ran this exact same exe a few days ago and it ran fine. What's next. |
| |||
|
I tried breaking this down to the smallest part. Here is a test script that has 3 statements, begin debug, rename a file with explicit names and end debug. This simple rename doesn't work and doesn't write an error into the error log.
|
| |||
|
Hello, We tried to reproduce the scenario at our end but it did not reproduce. We need to look into your machine so that we can resolve the issue quickly. Can you please send your contact number and the convenient time to reach you at Automation Anywhere - Open A Support Case |
![]() |
| Thread Tools | |
| Display Modes | |
| |