Automic Workload Automation

 View Only
  • 1.  No such file or directory when exporting

    Posted Apr 07, 2025 02:54 AM

    Greetings all

    We have a script that runs the following function:

    :  SET &EXPORT_RETURN# = EXPORT(&OBJECT_NAME#,&FULL_PATH_AND_NAME#)

    where a number of objects will be exported.

    The export works for some of the objects, but experiencing the following error for a few of the objects:

    '/applic/uc4/BLOB/EXPORT/AZD_USER_EXPORT_20250407163556_CHG00393382_EDH_1441388/DEDHPYRGCPJI26.XML'. Error message: '0000000002 No such file or directory'.

    The object DEDHPYRGCPJI26 does exist, and our workaround now is to manually export the object, delete it, then import it back in again.

    We are on 24.3.

    Anyone facing the same issue?



    ------------------------------
    Peter Wong
    AWA Administrator
    ------------------------------


  • 2.  RE: No such file or directory when exporting

    Posted Apr 08, 2025 03:52 AM

    Hi Peter,

    I haven't seen this error. Do you use the ON_ERROR method to retrieve the detailed error message? If not, can you please insert the statements to display the message.

    regards,
    Peter



    ------------------------------
    Automic Certified Professional/Expert & Broadcom Knight

    For AUTOMIC trainings please check https://www.qskills.de/qs/workshops/automic/
    ------------------------------



  • 3.  RE: No such file or directory when exporting

    Posted Apr 08, 2025 06:25 PM

    Hi Peter,

    Good to hear from you again. Hope all is well with you.

    We read a VARA to obtain the file names to be exported. Then we export each individual file.

    :SET &OBJECT_HANDLE# = PREP_PROCESS_VAR(&EXPORT_UNIQUE_LISTVARA#)
    :PROCESS &OBJECT_HANDLE#
    :  SET &FULL_OBJECT_NAME# = GET_PROCESS_LINE(&OBJECT_HANDLE#,1)
    : P "Full line name &FULL_OBJECT_NAME#"
    :  SET &OBJECT_NAME# = STR_RTRIM(&FULL_OBJECT_NAME#)
    :  SET &FULL_PATH_AND_NAME# = '&UC4_EXPORT_PATH#&OBJECT_NAME#.XML'
    : P "Full path and name &FULL_PATH_AND_NAME#"
    :  SET &EXPORT_RETURN# = EXPORT(&OBJECT_NAME#,&FULL_PATH_AND_NAME#)

    :  PUT_VAR &EXPORT_UNIQUE_LISTVARA#,&OBJECT_NAME#,&EXPORT_RETURN#
    !:  PUT_VAR &EXPORT_UNIQUE_LISTVARA#,&OBJECT_NAME#,&EXPORT_RETURN#
    :  PRINT Object &OBJECT_NAME# exported. Return Code &EXPORT_RETURN#
    :ENDPROCESS

    This is a sample of the error:

    2025-04-07 16:36:04 - U00020408 Full line name DEDHPYRGCPC005
    2025-04-07 16:36:04 - U00020408 Full path and name /applic/uc4/BLOB/EXPORT/AZD_USER_EXPORT_20250407163556_CHG00393382_EDH_1441388/DEDHPYRGCPC005.XML
    2025-04-07 16:36:04 - U00021721 EXPORT, counter '0000000001': Object: 'DEDHPYRGCPC005' exported.
    2025-04-07 16:36:04 - U00021723 Error writing file: '/applic/uc4/BLOB/EXPORT/AZD_USER_EXPORT_20250407163556_CHG00393382_EDH_1441388/DEDHPYRGCPC005.XML'. Error message: '0000000002 No such file or directory'.
    2025-04-07 16:36:04 - U00020408 Object DEDHPYRGCPC005 exported. Return Code 0000000000021723

    I know this will be tricky to replicate.

    Note that the vara contains a list of files to be exported.

    SOme of the files can be exported without any issue.

    A few of these files fail to be exported until you export the object manually, then import them back in.



    ------------------------------
    Peter Wong
    AWA Administrator
    ------------------------------



  • 4.  RE: No such file or directory when exporting

    Posted 27 days ago

    Hello Peter, Good day!! 

    I see your code & report excerpt. Return Code is 21723. 
    Document says - 21723=Target file exists and is write-protected
    I don't think the SCRIPT / EXPORT function is complaining about OBJECT NOT PRESENT. 

    Couple of queries - 
    1. Do you use multiple unix server for your Automation engine ? 
       - if so, did you check all of your Automation Engine boxes has the same file permissions for the path that you are using to place the XML exports ?
    2. Is there a chance you try to EXPORT same object multiple times & you expect the previous EXPORT should be replaced with recent XML one ? 
        If so - have you checked the permissions of the existing file that the EXPORT function is trying to OVERWRITE on OS level ? 
    3. When UC4 SCRIPT object does the EXPORT function, what permissions are enforced on the OS level. 
        When you export the object manually what permission is enforced ? 
        



    ------------------------------
    Regards,
    Prosenjit
    ------------------------------



  • 5.  RE: No such file or directory when exporting

    Posted 26 days ago

    I have a similar problem and have an open ticket on it - awaiting feedback now. 

    Short story, export 3 Hostgroups, sed line commands to alter and save, import them back in. Worked for a few years, as we upgraded versions - I think it was v21.0.5 or so, it stopped working and getting errors pasted below. Breaking the one job into 3 jobs; 1 per step. If I rerun the job multiple times it will eventually export all 3 files successfully (rarely all 3 in one run). The sed always works. Then same for import; execute multiple times and it will eventually find and import the 3 files (again rarely all 3 in one run). I make no changes to the files or permissions but it will eventually work. The job worked fine in earlier versions 11.x and 12.x; I believe it went bad in v21.x. 

     U00020692 Runtime error in object  ~objectdir/object name~    Error message: '0000000002 No such file or directory



  • 6.  RE: No such file or directory when exporting

    Posted 25 days ago

    Hi Prosenjit - thanks for reaching out.

    1. We use 4 Linux servers for our Automation Engine

      Good call, we will check, but note that these jobs have been running without issue on 21.0.5 without issue, we only notice this happening after the upgrade to v24.3.
    2. We do try to export multiple times, but each artefacts from each run is archived and moved out of the export directory before the next run.
    3. When the export is done, it is on a directory that has 777 permissions (same across 4 automation engines).  Export is done using the same UNIX user.


    ------------------------------
    Peter Wong
    AWA Administrator
    ------------------------------