BSak657434 (Community Member) asked a question.

Scans no longer working in CI

Hi,

 

Our scans have stopped working in our pipeline. I see the following error when I add export DEBUG=1 before scanning:

java.lang.SecurityException: Unacceptable config file directory path: ?/.srcclr

at com.sourceclear.agent.services.ConfigServiceImpl.<init>(ConfigServiceImpl.java:247)

at com.sourceclear.agent.services.ConfigServiceImpl.<init>(ConfigServiceImpl.java:227)

at com.sourceclear.agent.MainModule.configService(MainModule.java:59)

at com.sourceclear.agent.MainModule_ConfigServiceFactory.configService(MainModule_ConfigServiceFactory.java:33)

at com.sourceclear.agent.MainModule_ConfigServiceFactory.get(MainModule_ConfigServiceFactory.java:25)

at com.sourceclear.agent.MainModule_ConfigServiceFactory.get(MainModule_ConfigServiceFactory.java:8)

at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)

at com.sourceclear.agent.DaggerMainApp.configService(DaggerMainApp.java:99)

at com.sourceclear.agent.Main.start(Main.java:68)

at com.sourceclear.agent.Main.main(Main.java:101)

How do I resolve this issue?


  • MBretl008962 (Community Member)

    HI @DMartinez137494 (Community Member)​ ,

     

    Yes, I was able to contact support and got a workaround. The workaround is to set the Java user.home property to a writeable location, which in case of Jenkins is ${WORKSPACE}.

     

    So in my Jenkins pipeline for my SCA stage, I have the following:

    environment {

    JAVA_OPTS="-Duser.home=${WORKSPACE}"

    }

     

    So the user is still '?', however, the SourceClear directory is now ${WORKSPACE}/.srcclr

     

    Hope that helps.

     

    Best Regards,

     

    --Mark

    Expand Post
    Selected as Best
  • MBretl008962 (Community Member)

    I also have ran into this issue with running the https://download.sourceclear.com/ci.sh script in Jenkins through a docker container. It was working on Wednesday, November 27, 2019 and first noticed failures on December 2nd, 2019. Seems as though the SourceClear Agent was upgraded (with its JRE) and now has a Java Security exception stating the '?/.srcclr' is an invalid path.

     

    Before the upgrade, it was working:

    14:08:07 Scan Date & Time Nov 25 2019 10:07PM GMT

    14:08:07 Account type ENTERPRISE

    14:08:07 Scan engine 3.4.17 (latest 3.4.17)

    14:08:07 Analysis time 25 seconds

    14:08:07 User ?

     

    So my guess is that the SourceClear Agent uses the user home directory to define the path for '.srcclr' and since the user is '?' the path we get is '?/.srcclr' and now Java doesn't like that path. When launching a container in a Jenkins pipeline step, the current user is mapped from the host, however, is set without a username and home directory.

     

    I have tried to use the SRCCLR_CONFIG environment variable, but nothing changed, Does anyone know how to change the path to the '.srcclr' directory?

     

    --Mark

    Expand Post
    • MBretl008962 (Community Member)

      Can't seem to edit my own post....

       

      Fails using Scan Engine version 3.4.18

    • akapur (Veracode, Inc.)

      Hi,

       

      Sorry for missing this one out as I was on PTO. Please send an email to support@veracode.com if this problem still persists and we will be happy to assist.

       

      Regards,

      Aditi

       

      Expand Post
  • DMartinez137494 (Community Member)

    Did you happen to solve this issue?

    I am having this error for over a week and am frustrated because I do not know who to solve it.

     

    I also have a Jenkins job that runs on OpenShift and it uses a Docker image with the srcclr CLI installed on it. When trying to perform the scan, I get the error "java.lang.SecurityException: Unacceptable config file directory path: ?/.srcclr"

     

    How can one change or set the config file path? Where are the guidelines for creating a config file manually?

     

    I would really appreciate you help on this @Software Composition Analysis Group (Archived)​ 

     

    Kind regards,

    David.

     

     

    Expand Post
    • MBretl008962 (Community Member)

      HI @DMartinez137494 (Community Member)​ ,

       

      Yes, I was able to contact support and got a workaround. The workaround is to set the Java user.home property to a writeable location, which in case of Jenkins is ${WORKSPACE}.

       

      So in my Jenkins pipeline for my SCA stage, I have the following:

      environment {

      JAVA_OPTS="-Duser.home=${WORKSPACE}"

      }

       

      So the user is still '?', however, the SourceClear directory is now ${WORKSPACE}/.srcclr

       

      Hope that helps.

       

      Best Regards,

       

      --Mark

      Expand Post
      Selected as Best

Topics (3)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.