jenkinsci / plasticscm-plugin

A plugin for Jenkins to be able to use Plastic SCM
MIT License
16 stars 31 forks source link

java.io.FileNotFoundException: An error was detected while getting the selector spec #16

Closed oddgames-david closed 5 years ago

oddgames-david commented 5 years ago

java.io.FileNotFoundException: An error was detected while getting the selector spec. This usually happens with old versions of 'cm'. Please ensure the latest version of 'cm' is installed. at com.codicesoftware.plugins.jenkins.PlasticSCMFile.content(PlasticSCMFile.java:110) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:110) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:293) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)

The cm command '/opt/plasticscm5/client/cm checkselectorsyntax --file=/tmp/6bf10055-2409-48b7-a39e-7e4a262a2f98625259501759310358.tmp --spec --machinereadable --fieldseparator=def#_#sep' failed. Retrying after 500 ms... (1)
Jul 06, 2019 2:39:12 PM WARNING com.codicesoftware.plugins.hudson.PlasticTool execute
The cm command '/opt/plasticscm5/client/cm checkselectorsyntax --file=/tmp/6bf10055-2409-48b7-a39e-7e4a262a2f98625259501759310358.tmp --spec --machinereadable --fieldseparator=def#_#sep' failed. Retrying after 500 ms... (2)
Jul 06, 2019 2:39:13 PM WARNING com.codicesoftware.plugins.hudson.PlasticTool execute
The cm command '/opt/plasticscm5/client/cm checkselectorsyntax --file=/tmp/6bf10055-2409-48b7-a39e-7e4a262a2f98625259501759310358.tmp --spec --machinereadable --fieldseparator=def#_#sep' failed. Retrying after 500 ms... (3)
Jul 06, 2019 2:39:13 PM SEVERE com.codicesoftware.plugins.jenkins.PlasticSCMFile getRepObjectSpecFromSelector
The cm command '/opt/plasticscm5/client/cm checkselectorsyntax --file=/tmp/6bf10055-2409-48b7-a39e-7e4a262a2f98625259501759310358.tmp --spec --machinereadable --fieldseparator=def#_#sep' failed after 3 retries
Jul 06, 2019 2:39:13 PM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun finish
game_monster_truck_destruction_android #17 completed: FAILURE
Jul 06, 2019 2:39:13 PM WARNING org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister
Owner[game_monster_truck_destruction_android/17:game_monster_truck_destruction_android #17] was not in the list to begin with: []

Jenkins server can see the 'cm' command, I've tried with and without absolute path. image

Both the agent and the server are using 8.0.16.3282

I've made sure the agent service is run on a user account and the agent can use cm command from command line.

I can create a custom pipeline and use sh steps to manually download the repo without issue.

I've tried all sorts of selectors, smarthbranch, with server, without server etc. image

Watching the temp directory confirms the tmp file gets created:

image

I created the file manually and I'm fairly certain it's working as expected when I run the command manually

image

mig42 commented 5 years ago

Hi @oddgames-david !

Unfortunately, I'm unable to reproduce your issue. Could you set up CLI logging (see https://www.plasticscm.com/documentation/technical-articles/kb-enabling-logging-for-plastic-scm-part-i) and trigger a build? That will give us more information about what's going on inside the Plastic SCM client. Make sure you close existing cm shell processes that Jenkins might be using. A simple kill will be enough.

When you've done that, please contact us at support@codicesoftware.com referencing this issue and attach the generated logs.

Thank you!

Regards, Miguel

oddgames-david commented 5 years ago

Plastic SCM support was able to help me with this and was resolved by doing the following:

Manually copy the "/home/xxx/.plastic/client.conf" file in the "/opt/plasticscm5/client" folder. This way, we will be sure that all the users in this machine will be using the same Plastic configuration (including the user who runs the Jenkins service).

Looks like my jenkins server wasn't configured correctly.