Pipeline step don't get Artifacts correctly when build setup starts
Asked by ??? (??????? AOS ?):

Hello I have problem with pipeline steps,

I'm try to distribute my .aab output with gradle and firebase

My pipeline.yaml has 4 steps to ditribute .aab to firebase

\[step 1\] prepare .gradle

\[step 2\] build debugAAB ( step2 -1 ) / build releaseAAB (step2 - 2) by parallel

\[step 3\] distribute AAB with using gradle and firesbase

\[step 4\] update versionCode for after uploading

I have prob with **step 2** and **step 3**

I have to upload .aab so I added result of debugAAB's process. So **Step2-1**artifacts like this,

![???? 2023-04-24 155751.png](https://community.atlassian.com/t5/image/serverpage/image-id/253494iF29BFFCE27A6226D/image-size/large?v=v2&px=999 "???? 2023-04-24 155751.png")

and It has valid outputs in bfdrtDevDebug directory.

![???? 2023-04-24 155854.png](https://community.atlassian.com/t5/image/serverpage/image-id/253496iE0BEE6C1493080C4/image-size/large?v=v2&px=999 "???? 2023-04-24 155854.png")

BUT on **\[step 3\] , It's gonna empty.** I don't know reason why this happen.

\[step 3\]'s build setup donwload and extract bfdrtDevDebug, but when i using command **ls** to looking devAAB's output well in the directory. But it's empty

![???? 2023-04-24 160230.png](https://community.atlassian.com/t5/image/serverpage/image-id/253497i5A475A805AB7BF33/image-size/large?v=v2&px=999 "???? 2023-04-24 160230.png")![???? 2023-04-24 160306.png](https://community.atlassian.com/t5/image/serverpage/image-id/253498i0F78C63C3CEDAFB6/image-size/large?v=v2&px=999 "???? 2023-04-24 160306.png")

please help me... I don't know why this situation happened.

I realize that each step can use artifacts of previous step. Am i understand wrong?   
why this one can't extract \[step2 -1 \]'s artifacts well? why it's extract result is empty?


Answers:
author: Theodora Boudale
body: Hi [@??? (??????? AOS ?)](/t5/user/viewprofilepage/user-id/4950340),

Can you please move the **ls** command that lists the files in the artifacts folder to the beginning of the script of step 3? (Make it the first command of step 3)

I can see from your screenshots that the artifacts folder is not empty, it gets extracted in the 3rd step and it has a size of 27.2 MB. The only possible reason for this issue that I can think of right now is that perhaps the content of the artifacts directory gets deleted before the **ls** command. I see that you are running **./gradlew --stop** before the ls command, I am unsure if this command does anything that deletes this file.

Adding the **ls** command at the very beginning of the script of step 3 should give us more clarity.

Kind regards,  
Theodora

comments: author: ??? (??????? AOS ?)
body: it is empty now..   
![???? 2023-04-26 165919.png](https://community.atlassian.com/t5/image/serverpage/image-id/253911i88D620DDE1F93788/image-size/large?v=v2&px=999 "???? 2023-04-26 165919.png")


author: Theodora Boudale
body: Hi [@??? (??????? AOS ?)](/t5/user/viewprofilepage/user-id/4950340),

Thank you for the info.

Since the directory is empty at the beginning of the step, we would need to check the full build logs and your configuration in case I am missing something. I am not able to access your repo, but if we have a support ticket, the engineer working on the ticket will be able to access the repo and troubleshooting should be faster.

Would you like me to create a support ticket for you? You can also create it yourself via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. Otherwise, feel free to let me know and I can create it for you.

Kind regards,  
Theodora


Tags: bitbucket-pipelines

cloud