apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

Wipeout workspace before cloning repo to get jenkinsfiles #1151

Open jstastny-cz opened 3 months ago

jstastny-cz commented 3 months ago

Recently there started to appear a failure during scm checkout when pipeline job tried to get the Jenkinsfiles to run:

ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/apache/incubator-kie-kogito-pipelines.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:165)
    at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:71)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)
    at hudson.model.ResourceController.execute(ResourceController.java:101)
    at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Command "git reset --hard" returned status code 128:
stdout: 
stderr: error: unable to read sha1 file of .asf.yaml (40a66c4ceaad54437a2c106b228eb8b4931ff807)
error: unable to read sha1 file of .ci/actions/action-junit-report/action.yml (7f889000d9fd3b5e92d0ad2aef0e985d934aa6e0)

Workaround is to perform this step with extension

Wipe out repository & force clone - Delete the contents of the workspace before building, ensuring a fully fresh workspace.

Which in DSL should be the option wipeOutWorkspace()

jstastny-cz commented 3 months ago

There seem to be problems in DSL docs, mentioning wipeOutWorkspace which does not work, using wipeWorkspace instead seems better - raising as apache/incubator-kie-kogito-pipelines#1192, please leave the ticket open, I'll close myself after verification.