Answers: <p>As Casey Vega commented: provide the complete path.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-04-17T21:13:49.310Z
Answers: 2020-04-18T03:44:51.463Z
Answers: 2020-04-18T03:44:51.463Z
Answers: Aleksey Tsalolikhin
Body: <p>In the <a href="https://gitlab.com/open-source-ventilator/ventilator" rel="nofollow noreferrer">Open Source ventilator project</a>, we aim to provide those who focus on testing with a ready-to-go flash file for the Arduino controller board.</p>
  
  <p>While the binaries seem to be there, for some reason the CI job can't pickup the artifacts.</p>
  
  <p>What is happening:</p>
  
  <ul>
  <li>a CI/CD pipeline creates two files which can be listed using <code>find</code></li>
  <li>in the next step, this pipeline reports it can't find these artifacts. It says, "no matching files/no files to upload".</li>
  </ul>
  
  <p>What's the error and how to fix/troubleshoot? Why does this job end up as successful?</p>
  
  <p><a href="https://gitlab.com/open-source-ventilator/ventilator/controller_ci/-/blob/master/.gitlab-ci.yml" rel="nofollow noreferrer">CI job definition</a>:</p>
  
  <pre><code>compile:
    stage: build
    tags:
      - docker
    script:
      -  |
  
          git clone -b ci-gh https://github.com/mattd3v/Open-Source-Ventilator.git
          cd Open-Source-Ventilator/OpenSourceVentilator/
          arduino-cli compile --warnings all --fqbn arduino:avr:uno -o osv-controller-uno.bin OpenSourceVentilator.ino
          find .
    artifacts:
      paths:
      - ./osv-controller-uno.bin.hex
      - ./osv-controller-uno.bin.elf
  </code></pre>
  
  <p><a href="https://gitlab.com/open-source-ventilator/ventilator/controller_ci/-/jobs/507996642" rel="nofollow noreferrer">Pipeline output</a>:</p>
  
  <pre><code>.
  ./test
  ./test/RMVS_TestCaseData.xlsx
  ./OpenSourceVentilator.ino
  ./osv-controller-uno.bin.hex
  ./osv-controller-uno.bin.elf
  ./README.md
  
  section_end:1586713988:build_script
  [0Ksection_start:1586713988:after_script
  [0;msection_end:1586713990:after_script
  [0Ksection_start:1586713990:archive_cache
  [0K[0K[36;1m Saving cache[0;m
  [0;msection_end:1586713991:archive_cache
  [0K section_start:1586713991:upload_artifacts_on_success
  [0K [0K [36;1m
  
  Uploading artifacts for successful job[0;m
  [0;m[32;1m
  Uploading artifacts...[0;m
  
  [0;33m WARNING: ./osv-controller-uno.bin.hex: no matching files[0;m 
  [0;33m WARNING: ./osv-controller-uno.bin.elf: no matching files[0;m 
  
  [31;1mERROR: No files to upload                         [0;m 
  section_end:1586713993:upload_artifacts_on_success
  [0K[32;1mJob succeeded
  [0;m
  </code></pre>
  
Comments: CC BY-SA 4.0
Comments: 2020-04-13T21:28:50.150Z
Comments: I assume the runner uses the root of the build dir. I would try `- Open-Source-Ventilator/OpenSourceVentilator/osv-controller-uno.bin.hex`
Comments: casey vega
Tags: <continuous-integration><gitlab><linux>
Title: How comes a GitLab CI/CD job cant' find its artifacts?
UserDisplayName: Ta Mu
ThreadText: # How comes a GitLab CI/CD job cant' find its artifacts?
  
  (Asked by: username_0 on 2020-04-13)
  
  In the [Open Source ventilator project](https://gitlab.com/open-source-ventilator/ventilator), we aim to provide those who focus on testing with a ready-to-go flash file for the Arduino controller board.
  
  While the binaries seem to be there, for some reason the CI job can't pickup the artifacts.
  
  What is happening:
  
  * a CI/CD pipeline creates two files which can be listed using `find`
  * in the next step, this pipeline reports it can't find these artifacts. It says, "no matching files/no files to upload".
  
  What's the error and how to fix/troubleshoot? Why does this job end up as successful?
  
  [CI job definition](https://gitlab.com/open-source-ventilator/ventilator/controller_ci/-/blob/master/.gitlab-ci.yml):
  
  ```
  compile:
    stage: build
    tags:
      - docker
    script:
      -  |
  
          git clone -b ci-gh https://github.com/mattd3v/Open-Source-Ventilator.git
          cd Open-Source-Ventilator/OpenSourceVentilator/
          arduino-cli compile --warnings all --fqbn arduino:avr:uno -o osv-controller-uno.bin OpenSourceVentilator.ino
          find .
    artifacts:
      paths:
      - ./osv-controller-uno.bin.hex
      - ./osv-controller-uno.bin.elf
  
  ```
  
  [Pipeline output](https://gitlab.com/open-source-ventilator/ventilator/controller_ci/-/jobs/507996642):
  
  ```
  .
  ./test
  ./test/RMVS_TestCaseData.xlsx
  ./OpenSourceVentilator.ino
  ./osv-controller-uno.bin.hex
  ./osv-controller-uno.bin.elf
  ./README.md
  
  section_end:1586713988:build_script
  [0Ksection_start:1586713988:after_script
  [0;msection_end:1586713990:after_script
  [0Ksection_start:1586713990:archive_cache
  [0K[0K[36;1m Saving cache[0;m
  [0;msection_end:1586713991:archive_cache
  [0K section_start:1586713991:upload_artifacts_on_success
  [0K [0K [36;1m
  
  Uploading artifacts for successful job[0;m
  [0;m[32;1m
  Uploading artifacts...[0;m
  
  [0;33m WARNING: ./osv-controller-uno.bin.hex: no matching files[0;m 
  [0;33m WARNING: ./osv-controller-uno.bin.elf: no matching files[0;m 
  
  [31;1mERROR: No files to upload                         [0;m 
  section_end:1586713993:upload_artifacts_on_success
  [0K[32;1mJob succeeded
  [0;m
  
  ```
  
  **Tags:** continuous-integration, gitlab, linux
  
  > **Comments:**
  > **username_1**: I assume the runner uses the root of the build dir. I would try `- Open-Source-Ventilator/OpenSourceVentilator/osv-controller-uno.bin.hex`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-04-17. Score: 1
  
  As username_1 commented: provide the complete path.
  
  
  ---
  
  