This might be a bug of pipes in after-scripts on self hosted runners.
I have a step in my bitbucket pipeline as follows:
- step: name: Build and Testruns-on: - self.hosted - k8scaches: - mavenscript: - mvn clean installafter-script: - pipe: atlassian/checkstyle-report:0.3.1 variables: DEBUG: "true"services: - dockerartifacts: - target/surefire-reports/** - target/checkstyle-result.xml - target/*.jar
`mvn clean install` ran as expected. I could see the jar file, surefire-reports/ and checkstyle-result.xml were generated in "/tmp/8b5a4a4f-f711-583f-95bd-*********/build/target/" directory, I could also see it's mounted to "/opt/atlassian/pipelines/agent/build" within the docker:dind container, but the "checkstyle-report" pipe failed to access "/tmp/8b5a4a4f-f711-583f-95bd-*********/build".
From the `docker container run ***` command, the build seems to be mounted to "/opt/atlassian/pipelines/agent/build" in the checkstyle-report container, but the workdir was set to $(pwd) (i.e. "/tmp/8b5a4a4f-f711-583f-95bd-*********/build") which didn't exist for sure.
Below are the logs of after script:
<span>--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \</span><span>--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \</span><span>--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \</span><span>--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \</span><span>--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report \</span><span>--workdir=$(pwd) \</span><span>--label=org.bitbucket.pipelines.system=true \</span><span>--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \</span><span>--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \</span><span>--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \</span><span>--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \</span><span>--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \</span><span>--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \</span><span>--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \</span><span>--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \</span><span>--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \</span><span>--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \</span><span>--env=BITBUCKET_PARALLEL_STEP_COUNT="$BITBUCKET_PARALLEL_STEP_COUNT" \</span><span>--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \</span><span>--env=CI="$CI" \</span><span>--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \</span><span>--env=BITBUCKET_PARALLEL_STEP="$BITBUCKET_PARALLEL_STEP" \</span><span>--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \</span><span>--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \</span><span>--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \</span><span>--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \</span><span>--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \</span><span>--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \</span><span>--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \</span><span>--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \</span><span>--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \</span><span>--env=DOCKER_HOST="tcp://host.docker.internal:2375" \</span><span>--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \</span><span>--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report" \</span><span>--env=CHECKSTYLE_REPORT_ID="checkstyle-1" \</span><span>--env=CHECKSTYLE_RESULT_PATTERN=".*/checkstyle-result.xml$" \</span><span>--env=DEBUG="true" \</span><span>--env=REPORT_FAIL_SEVERITY="info" \</span><span>--env=BITBUCKET_EXIT_CODE="$BITBUCKET_EXIT_CODE" \</span><span>--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \</span><span>bitbucketpipelines/checkstyle-report:0.3.1</span><span>Unable to find image 'bitbucketpipelines/checkstyle-report:0.3.1' locally</span><span>0.3.1: Pulling from bitbucketpipelines/checkstyle-report</span><span>e7c96db7181b: Pulling fs layer</span><span>f910a506b6cb: Pulling fs layer</span><span>b6abafe80f63: Pulling fs layer</span><span>c66155a2e96a: Pulling fs layer</span><span>c66155a2e96a: Waiting</span><span>f910a506b6cb: Download complete</span><span>e7c96db7181b: Verifying Checksum</span><span>e7c96db7181b: Download complete</span><span>e7c96db7181b: Pull complete</span><span>f910a506b6cb: Pull complete</span><span>c66155a2e96a: Verifying Checksum</span><span>c66155a2e96a: Download complete</span><span>b6abafe80f63: Verifying Checksum</span><span>b6abafe80f63: Download complete</span><span>b6abafe80f63: Pull complete</span><span>c66155a2e96a: Pull complete</span><span>Digest: sha256:ce5e8b7e249979ec3fb8e731bc3a26ccaee32e280996dcbaacf1f76eb2924f30</span><span>Status: Downloaded newer image for bitbucketpipelines/checkstyle-report:0.3.1</span><span>Exception in thread "main" java.lang.RuntimeException: /tmp/8b5a4a4f-f711-583f-95bd-*********/build not found</span><span>at se.bjurr.violations.lib.ViolationsApi.inFolder(ViolationsApi.java:45)</span><span>at com.atlassian.bitbucket.pipelines.checkstyle.report.Main.main(Main.java:95)</span><span>After script<br><br>pipe: atlassian/checkstyle-report:0.3.11m 0s<br><br>+ docker container run \</span>
<span>--volume=/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build \</span>
<span>--volume=/usr/local/bin/docker:/usr/local/bin/docker:ro \</span>
<span>--volume=/opt/atlassian/pipelines/agent/ssh:/opt/atlassian/pipelines/agent/ssh:ro \</span>
<span>--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes \</span>
<span>--volume=/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report:/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report \</span>
<span>--workdir=$(pwd) \</span>
<span>--label=org.bitbucket.pipelines.system=true \</span>
<span>--env=BITBUCKET_STEP_TRIGGERER_UUID="$BITBUCKET_STEP_TRIGGERER_UUID" \</span>
<span>--env=BITBUCKET_REPO_FULL_NAME="$BITBUCKET_REPO_FULL_NAME" \</span>
<span>--env=BITBUCKET_GIT_HTTP_ORIGIN="$BITBUCKET_GIT_HTTP_ORIGIN" \</span>
<span>--env=BITBUCKET_PROJECT_UUID="$BITBUCKET_PROJECT_UUID" \</span>
<span>--env=BITBUCKET_REPO_IS_PRIVATE="$BITBUCKET_REPO_IS_PRIVATE" \</span>
<span>--env=BITBUCKET_WORKSPACE="$BITBUCKET_WORKSPACE" \</span>
<span>--env=BITBUCKET_REPO_OWNER_UUID="$BITBUCKET_REPO_OWNER_UUID" \</span>
<span>--env=BITBUCKET_BRANCH="$BITBUCKET_BRANCH" \</span>
<span>--env=BITBUCKET_REPO_UUID="$BITBUCKET_REPO_UUID" \</span>
<span>--env=BITBUCKET_PROJECT_KEY="$BITBUCKET_PROJECT_KEY" \</span>
<span>--env=BITBUCKET_PARALLEL_STEP_COUNT="$BITBUCKET_PARALLEL_STEP_COUNT" \</span>
<span>--env=BITBUCKET_REPO_SLUG="$BITBUCKET_REPO_SLUG" \</span>
<span>--env=CI="$CI" \</span>
<span>--env=BITBUCKET_REPO_OWNER="$BITBUCKET_REPO_OWNER" \</span>
<span>--env=BITBUCKET_PARALLEL_STEP="$BITBUCKET_PARALLEL_STEP" \</span>
<span>--env=BITBUCKET_STEP_RUN_NUMBER="$BITBUCKET_STEP_RUN_NUMBER" \</span>
<span>--env=BITBUCKET_BUILD_NUMBER="$BITBUCKET_BUILD_NUMBER" \</span>
<span>--env=BITBUCKET_GIT_SSH_ORIGIN="$BITBUCKET_GIT_SSH_ORIGIN" \</span>
<span>--env=BITBUCKET_PIPELINE_UUID="$BITBUCKET_PIPELINE_UUID" \</span>
<span>--env=BITBUCKET_COMMIT="$BITBUCKET_COMMIT" \</span>
<span>--env=PIPELINES_JWT_TOKEN="$PIPELINES_JWT_TOKEN" \</span>
<span>--env=BITBUCKET_STEP_UUID="$BITBUCKET_STEP_UUID" \</span>
<span>--env=BITBUCKET_CLONE_DIR="$BITBUCKET_CLONE_DIR" \</span>
<span>--env=BITBUCKET_DOCKER_HOST_INTERNAL="$BITBUCKET_DOCKER_HOST_INTERNAL" \</span>
<span>--env=DOCKER_HOST="tcp://host.docker.internal:2375" \</span>
<span>--env=BITBUCKET_PIPE_SHARED_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes" \</span>
<span>--env=BITBUCKET_PIPE_STORAGE_DIR="/opt/atlassian/pipelines/agent/build/.bitbucket/pipelines/generated/pipeline/pipes/atlassian/checkstyle-report" \</span>
<span>--env=CHECKSTYLE_REPORT_ID="checkstyle-1" \</span>
<span>--env=CHECKSTYLE_RESULT_PATTERN=".*/checkstyle-result.xml$" \</span>
<span>--env=DEBUG="true" \</span>
<span>--env=REPORT_FAIL_SEVERITY="info" \</span>
<span>--env=BITBUCKET_EXIT_CODE="$BITBUCKET_EXIT_CODE" \</span>
<span>--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \</span>
<span>bitbucketpipelines/checkstyle-report:0.3.1</span>
<span>Unable to find image 'bitbucketpipelines/checkstyle-report:0.3.1' locally</span>
<span>0.3.1: Pulling from bitbucketpipelines/checkstyle-report</span>
<span>e7c96db7181b: Pulling fs layer</span>
<span>f910a506b6cb: Pulling fs layer</span>
<span>b6abafe80f63: Pulling fs layer</span>
<span>c66155a2e96a: Pulling fs layer</span>
<span>c66155a2e96a: Waiting</span>
<span>f910a506b6cb: Download complete</span>
<span>e7c96db7181b: Verifying Checksum</span>
<span>e7c96db7181b: Download complete</span>
<span>e7c96db7181b: Pull complete</span>
<span>f910a506b6cb: Pull complete</span>
<span>c66155a2e96a: Verifying Checksum</span>
<span>c66155a2e96a: Download complete</span>
<span>b6abafe80f63: Verifying Checksum</span>
<span>b6abafe80f63: Download complete</span>
<span>b6abafe80f63: Pull complete</span>
<span>c66155a2e96a: Pull complete</span>
<span>Digest: sha256:ce5e8b7e249979ec3fb8e731bc3a26ccaee32e280996dcbaacf1f76eb2924f30</span>
<span>Status: Downloaded newer image for bitbucketpipelines/checkstyle-report:0.3.1</span>
<span>Exception in thread "main" java.lang.RuntimeException: /tmp/8b5a4a4f-f711-583f-95bd-*********/build not found</span>
<span>at se.bjurr.violations.lib.ViolationsApi.inFolder(ViolationsApi.java:45)</span>
<span>at com.atlassian.bitbucket.pipelines.checkstyle.report.Main.main(Main.java:95)</span>
Update: After I upgrade pipelines runner to 1.287, the above issue seems to have resolved.
It looks like you're new here. Sign in or register to get started.