Pipeline failing because an artifact is not being persisted

QPV
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2023

I have the following failing step:
```

+ yarn install
2
yarn install v1.22.19
3
[1/4] Resolving packages...
4
error Package "" refers to a non-existing file '"/opt/atlassian/pipelines/agent/build/app/vendor/symfony/ux-turbo/assets"'.
5
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
```
It was executed in parallel to a `composer install` step that downloads symfony/ux-turbo, among others.
I changed the pipeline so that these two steps are not parallel, with Composer running first and then Yarn. The Composer step is configured to persist the vendor directory and I can see it listed when doing `ls -lR` at the end like the troubleshooting guide says, but the Yarn step still fails with the same error.
What is happening? Maybe cache is leaking between runs of the pipeline?

2 answers

0 votes
QPV
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 4, 2023

Hi Theodora.

This is the output for Build teardown on the first step:

You already have a 'composer' cache so we won't create it again
Searching for files matching artifact pattern vendor/**

Searching for test report files in directories named [test-results, failsafe-reports, test-reports, TestResults, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.

And the artifacts definition:

artifacts:
- vendor/**

Thank you.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 4, 2023

Hi @QPV,

I think the issue may be with the path in the artifacts definition.

The output you posted in your question mentions the path

/opt/atlassian/pipelines/agent/build/app/vendor/symfony/ux-turbo/assets

So, the vendor directory is inside the app directory in the $BITBUCKET_CLONE_DIR.

Can you try the following definition instead?

artifacts:
- app/vendor/**

Or, in case you need everything under app, you can use the following:

artifacts:
- app/**

Kind regards,
Theodora

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 3, 2023

Hi @QPV and welcome to the community!

Parallel steps cannot consume artifacts generated by steps in the same parallel set, so making the steps not parallel was correct.

Regarding the failure after you made this change:

1. Can you please open the build log of the step that generates the artifacts, expand the Build teardown section, and let us know what you see there?

This section mentions details about artifacts upload, so if there is any error it should be printed there.

2. What is the exact artifacts definition in your bitbucket-pipelines.yml file? Are you using a path relative to $BITBUCKET_CLONE_DIR?

An artifact definition accepts only paths relative to the $BITBUCKET_CLONE_DIR (this is the path in the Docker container where the repo gets cloned, /opt/atlassian/pipelines/agent/build/)

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events