Spectrum Technology Platform

 View Only
  • 1.  Problem starting Spectrum 2023.1.0 with cron job in Linux

    Posted 08-28-2023 12:07

    We have long used a cron job to test if Spectrum server is running and start Spectrum if necessary. 

    It has worked for many versions, including 2020.1.0. It no longer works in 2023.1.0 (I don't know about 2022.1.0 -- we never installed that version). 

    Imagine a bash script that contains 

    . ./setup
    ./server.start

    I can execute the script from a terminal and it runs fine, i.e., Spectrum starts successfully. 

    If I try to execute the same script from crontab, Spectrum does not start. The errors spectrum-server.log indicate that some variables are not populated correctly. E.g.,

    Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'archiveEnabled'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${spectrum.audit.archive.enabled}]

    andWARN  [ProductDataJAXRSService] Configured deployment directory /apps/Spectrum/server/bin/${spectrum.import.dir} doesn't exist

    I realize there are infinite RHEL 7 and Spectrum 2023.1.0 configuration details that can cause issue. But maybe someone else has experienced something similar and can point me in the right direction?

    I have an open ticket with Precisely support but wanted to crowdsource possible solutions, too.



    ------------------------------
    Dave Carlson
    ------------------------------


  • 2.  RE: Problem starting Spectrum 2023.1.0 with cron job in Linux

    Employee
    Posted 08-29-2023 02:41

    Hi Dave,

    Within spectrum container property file located at /apps/Spectrum/server/conf, what value you see for below properties?

    spectrum.audit.archive.enabled

    and 

    spectrum.import.dir

    Regards

    Anoop



    ------------------------------
    Anoop Kumar
    Precisely Software Inc.
    Troy
    ------------------------------



  • 3.  RE: Problem starting Spectrum 2023.1.0 with cron job in Linux

    Posted 08-29-2023 07:59

    spectrum.audit.archive.enabled=true

    and

    spectrum.import.dir=../import



    ------------------------------
    Dave Carlson
    ------------------------------



  • 4.  RE: Problem starting Spectrum 2023.1.0 with cron job in Linux

    Employee
    Posted 08-29-2023 08:08

    Hi Dave,

    These values are correct. To be more precise, change spectrum.import.dir to provide absolute path rather than relative.

    As per error, data type being passed is string for 'archiveEnabled' in cron job. Can you check that? 

    is it written in bash or some other script? I believe it's needed to be debug 



    ------------------------------
    Anoop Kumar
    Precisely Software Inc.
    Troy
    ------------------------------



  • 5.  RE: Problem starting Spectrum 2023.1.0 with cron job in Linux

    Posted 08-29-2023 09:37

    I set spectrum.import.dir to an absolute path in conf/spectrum-container.properties and got the same result:

    [ProductDataJAXRSService] Configured deployment directory /apps/Spectrum/server/bin/${spectrum.import.dir} doesn't exist

    For some reason, when I run my startup script with a cron job the configuration variables are not getting set.

    I'm not sure what you are asking about 'archiveEnabled' and data type being passed. 

    To simplify matters, I created a simplified startup script, shown below. This works when called by a cron job for Spectrum version 2020.1.0. This works when called manually from the terminal. But if it is called by a cron job, then Specrum won't start properly:

    #!/bin/bash                           
    cd /apps/Spectrum/server/bin
    . ./setup
    ./server.start

    The cron entry looks like:

    59 * * * *  /apps/Spectrum/auto_start_test.sh



    ------------------------------
    Dave Carlson
    ------------------------------



  • 6.  RE: Problem starting Spectrum 2023.1.0 with cron job in Linux

    Employee
    Posted 08-29-2023 10:54

    Hi Dave,

    Open a case with us to discuss it.



    ------------------------------
    Anoop Kumar
    Precisely Software Inc.
    Troy
    ------------------------------