GitLab Runner no output, no artefacts and always passed

I have my own GitLab Runner running connected. It is an LXD container with gitlab-runner installed and successfully registered. In my Gitlab.com I see the runner connected, status is green.

My .gitlab-ci.yml file is is as simple as possible. It only has

build_job:
  stage: build
  script:
    - echo "This is a simple GitLab CI job"
  artifacts:
    paths:
      - build_output.txt
  only:
    - master

When I commit and push, or retry a job. The job runs very quickly and ends with “passed” status. There is no output and there is also no artifact attached to the successful job.

When I use a command that doesn’t exist, for example the none existing command hiho the job fails.

build_job:
  stage: build
  script:
    - hiho "This is a simple GitLab CI job"
  artifacts:
    paths:
      - build_output.txt
  only:
    - master

There is no information why the job failed. No logging. No trace.

So the symptoms are. Jobs are passed with valid syntax. There is however no logging. Jobs with syntax errors fail also with no logging.

Why is this not working

1 Like

@sugarmoose welcome back to the forum!

Your .gitlab-ci.yml is valid but your script does not create a file.

If you update the script line as below it will work.

  script:
    - echo "This is a simple GitLab CI job" >> build_output.txt

I created a small sample project with this fix to verify it works as expected and the artifact is uploaded.

I hope this helps!

-James H, GitLab Product Manager, Verify:Pipeline Execution

2 Likes