Cannot start the batch server

From a Sage X3 v12p31 instance, Administration > Batch Server.

Question: Any idea where I should start to investigate for why this specific error would keep reoccurring?

Context:

From my observation log, it keeps happening at morning, every week.

From Diagnosis, it seems like the Batch Server OS process is alive, but the Syracuse does not acknowledge it and treated as Stopped state. Because there is still an orphan Batch Server OS process, it cannot be started.

I know the resolution from this post as temporary extreme measure with a full restart at night:  The batch server is stopped… but it’s running! (Version 11, patch 14) 

Getting this error since Sage X3 pu9.

EDIT: Additional forum posts of same issue:

-  69 sessions of Type Batch in Session Management and Batch Server in Starting state with no Diagnosis results 

-  (Missing Forum Thread) 

Parents
  • 0

    Ensure that you are performing batch server maintenance often. Normally abnormally large trace files, and large amount of trace files has this effect on the Batch Server functionality.    

    Batch Server Maintenance

    This should be done weekly, but depends on the number of transactions within the folder. To perform the maintenance, stop the Batch Server and Accounting Task and then either copy (files to be copied to storage location not within the Sage X3 folder schema) or delete the following files:

    In the Sage X3 Runtime folder ("..\Runtime\tmp"):

    • psadxnnnn.bat & .res
    • RQTnnnn.bat & .pid
    • serveur.bat & .pid
    • cmdnnnn.dat files
    • Don't delete serveur.ent and serveur.out files (Unix and Linux only)

    In the X3 Batch Server TRA folders ("..\X3\SRV\TRA"):

    • RTZ the "serveur.tra" file if larger than 1MB
    • Delete/Copy old RQTnnnn.tra files

    In each endpoints TRA folder ("..\FOLDER\TRA"):

    • RTZ the "ACCENTRY.tra" file if it's bigger than 1MB
    • Delete/Copy old *.tra files

    In each endpoints tmp folders ("..\FOLDER\tmp")

    • RTZ the "espion.tra" and "transac.tra" files if they are larger than 1MB
    • Delete/Copy old temporary files
Reply
  • 0

    Ensure that you are performing batch server maintenance often. Normally abnormally large trace files, and large amount of trace files has this effect on the Batch Server functionality.    

    Batch Server Maintenance

    This should be done weekly, but depends on the number of transactions within the folder. To perform the maintenance, stop the Batch Server and Accounting Task and then either copy (files to be copied to storage location not within the Sage X3 folder schema) or delete the following files:

    In the Sage X3 Runtime folder ("..\Runtime\tmp"):

    • psadxnnnn.bat & .res
    • RQTnnnn.bat & .pid
    • serveur.bat & .pid
    • cmdnnnn.dat files
    • Don't delete serveur.ent and serveur.out files (Unix and Linux only)

    In the X3 Batch Server TRA folders ("..\X3\SRV\TRA"):

    • RTZ the "serveur.tra" file if larger than 1MB
    • Delete/Copy old RQTnnnn.tra files

    In each endpoints TRA folder ("..\FOLDER\TRA"):

    • RTZ the "ACCENTRY.tra" file if it's bigger than 1MB
    • Delete/Copy old *.tra files

    In each endpoints tmp folders ("..\FOLDER\tmp")

    • RTZ the "espion.tra" and "transac.tra" files if they are larger than 1MB
    • Delete/Copy old temporary files
Children
  • 0 in reply to Regard Hulsbos

    Hi Mr. Regard,

    Other than building a batch/bash script to manually archive the files by regex from the OS level, is there a way I can set it automatically from Sage X3?

    I am currently using one `AHISTO` (using `ABATCH`) recurring task in X3 folder to resolve "X3 Batch Server TRA folders" issue with 7 day shelf life daily scheduled purge.

    There were reservations on deleting "each endpoints TRA folder" and "each endpoints tmp folders" on concerns of losing the audit data needed by the finance team for cross-validation work.

    - Are the content of the file in `TRA` folder important or is it safe to delete in most cases?

    - The `tmp` folder I will discuss with the development team as there was a customization pointing to a folder path in `tmp` folder. 

    Curious if there is others I can use from Sage X3 default other than building own custom script.

  • 0 in reply to chunheng

    I normally schedule time on a Sunday evening where no Batch Tasks execute, and have a PowerShell script that runs as a Windows Task during that time to archive the TRA and tmp files. For certain industries Auditing is critical, that is why we archive those files instead of deleting them. I have attached the PowerShell script file below:

     

    # FIRST CREATE THE NEW DIRECTORIES
    $newFolder = (Get-Date).ToString("yyyy_MM_dd") 
    $SEEDTRA = "D:\Sage\Sage X3 Logs\SEED\TRA\" + $newFolder
    $SEEDTMP = "D:\Sage\Sage X3 Logs\SEED\tmp\" + $newFolder
    $X3X3SRVTRA = "D:\Sage\Sage X3 Logs\SRV\TRA\" + $newFolder
    
    # CREATE ALL THE NEW DIRECTORIES
    New-Item -Path $SEEDTRA -ItemType Directory
    New-Item -Path $SEEDTMP -ItemType Directory
    New-Item -Path $X3X3SRVTRA -ItemType Directory
    
    # MOVE ALL OLD LEGACY FILES
    Get-ChildItem -Path "D:\Sage\X3V12\folders\SEED\TRA" | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-2)} | Move-Item -Destination $SEEDTRA
    Get-ChildItem -Path "D:\Sage\X3V12\folders\SEED\tmp" | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-2)} | Move-Item -Destination $SEEDTMP
    Get-ChildItem -Path "D:\Sage\X3V12\folders\X3\SRV\TRA" | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-2)} | Move-Item -Destination $X3X3SRVTRA
    
    # COPY PRIMARY TRACE FILES - SEED
    Copy-Item "D:\Sage\X3V12\folders\SEED\TRA\ACCENTRY.tra" -Destination $SEEDTRA
    Clear-Content "D:\Sage\X3V12\folders\SEED\TRA\ACCENTRY.tra"
    
    
    # COPY PRIMARY TRACE FILES - X3X3SRVTRA
    Copy-Item "D:\Sage\X3V12\folders\X3\SRV\TRA\serveur.tra" -Destination $X3X3SRVTRA
    Clear-Content "D:\Sage\X3V12\folders\X3\SRV\TRA\serveur.tra"
     

    TRA FOLDER

    The content of the TRA folder is all trace files and should only ever be used for that. Everything that appears as a log or that has log output will generate a file in the TRA folder. It is especially useful to keep the files if you normally debug or generate trace file from external imports, as it makes troubleshooting easier.

    tmp FOLDER

    The content of the tmp folder is used by the Runtime and other Sage X3 components. The most mentionable usages are:

    • Temporary caching of files uploaded through the UI
    • Temporary processing files, espion.tra and transac.tra
    • Temporary execution files from the workflow

    While using the tmp folder for custom development outputs is technically fine, I personally consider it "best practice" to create a new "Sage X3 Storage Area" for any custom developments. It ensures that there is no chances of possible file replacements/deletion and also separates custom development from standard folder outputs.