Gitlab-CI job fails with no output or log file

Not a whole lot of detail to give, I don’t know what log files to check out since nothing is displayed on the web ui and no log files exist in /var/opt/gitlab/gitlab-ci/builds/

Here is the .gitlab-ci.yml file:

stages:
  - packer:engineering
  - terraform-plan:engineering
  - terraform-apply:engineering
  - recycle:engineering
  - packer:production
  - terraform-plan:production
  - terraform-apply:production
  - recycle:production

variables:
  engineering_terraform_bucket: vandelay-engineering-terraform
  engineering_terraform_path: infrastructure/terraform/common/website
  production_terraform_bucket: vandelay-terraform
  production_terraform_path: infrastructure/terraform/common/website
  GIT_SUBMODULE_STRATEGY: normal
  GIT_STRATEGY: clone

packer:engineering:
  image: docker.vandelay.engineering/costanza/ci/packer-ansible:latest
  stage: packer:engineering
  script:
    - git submodule update --remote
    - cd infrastructure
    - packer build packer/website.engineering.json
  variables:
    AWS_ACCESS_KEY_ID: $engineering_packer_key
    AWS_SECRET_ACCESS_KEY: $engineering_packer_secret
  only:
    - master

terraform-plan:engineering:
  image: docker.vandelay.engineering/costanza/ci/terraform:0.10.2
  stage: terraform-plan:engineering
  script:
    - git submodule update --remote
    - cd ${engineering_terraform_path}
    - terraform init -input=false -backend-config bucket=${engineering_terraform_bucket}
    - terraform plan -input=false -var-file=engineering.tfvars -out engineering.plan
  variables:
    TF_WORKSPACE: engineering
    AWS_ACCESS_KEY_ID: $engineering_terraform_key
    AWS_SECRET_ACCESS_KEY: $engineering_terraform_secret
  artifacts:
    paths:
      - ${engineering_terraform_path}/engineering.plan
    expire_in: 5m
  only:
    - master

terraform-apply:engineering:
  image: docker.vandelay.engineering/costanza/ci/terraform:0.10.2
  stage: terraform-apply:engineering
  script:
    - git submodule update --remote
    - cd ${engineering_terraform_path}
    - terraform init -input=false -backend-config bucket=${engineering_terraform_bucket}
    - terraform apply engineering.plan
  variables:
    TF_WORKSPACE: engineering
    AWS_ACCESS_KEY_ID: $engineering_terraform_key
    AWS_SECRET_ACCESS_KEY: $engineering_terraform_secret
  dependencies:
    - terraform-plan:engineering
  only:
    - master

recycle:engineering:
  image: docker.vandelay.engineering/costanza/instance-recycler:latest
  stage: recycle:engineering
  script:
    - recycle-instances --asg website
  variables:
    AWS_ACCESS_KEY_ID: $engineering_terraform_key
    AWS_SECRET_ACCESS_KEY: $engineering_terraform_secret
  only:
    - master

packer:production:
  image: docker.vandelay.engineering/costanza/ci/packer-ansible:latest
  stage: packer:production
  script:
    - git submodule update --remote
    - cd infrastructure
    - packer build packer/website.production.json
  variables:
    AWS_ACCESS_KEY_ID: $production_packer_key
    AWS_SECRET_ACCESS_KEY: $production_packer_secret
  only:
    - master

terraform-plan:production:
  image: docker.vandelay.engineering/costanza/ci/terraform:0.10.2
  stage: terraform-plan:production
  script:
    - ls -alh
    - git submodule update --remote
    - cd ${production_terraform_path}
    - terraform init -input=false -backend-config bucket=${production_terraform_bucket}
    - terraform plan -input=false -var-file=production.tfvars -out production.plan
    - >-
      curl
      -X POST https://hooks.slack.com/services/ -d '
      {
      "channel": "#deploy",
      "username": "GitlabCI",
      "text": "The latest build for `website` is ready for deployment at <'"$CI_PROJECT_URL"'/pipelines/'"$CI_PIPELINE_ID"'>",
      "icon_emoji": ":clippy:"
      }
      '
      -H "Content-Type: application/json"
  variables:
    CI_DEBUG_TRACE: "true"
    TF_WORKSPACE: production
    AWS_ACCESS_KEY_ID: $production_terraform_key
    AWS_SECRET_ACCESS_KEY: $production_terraform_secret
  artifacts:
    paths:
      - ${production_terraform_path}/production.plan
    expire_in: 1h
  only:
    - master

terraform-apply:production:
  image: docker.vandelay.engineering/costanza/ci/terraform:0.10.2
  stage: terraform-apply:production
  script:
    - git submodule update --remote
    - cd ${production_terraform_path}
    - terraform init -input=false -backend-config bucket=${production_terraform_bucket}
    - terraform apply production.plan
  variables:
    TF_WORKSPACE: production
    AWS_ACCESS_KEY_ID: $production_terraform_key
    AWS_SECRET_ACCESS_KEY: $production_terraform_secret
  dependencies:
    - terraform-plan:production
  only:
    - master
  when: manual
  allow_failure: false

recycle:production:
  image: docker.vandelay.engineering/costanza/instance-recycler:latest
  stage: recycle:production
  script:
    - recycle-instances --asg website
  variables:
    AWS_ACCESS_KEY_ID: $production_terraform_key
    AWS_SECRET_ACCESS_KEY: $production_terraform_secret
  only:
    - master

In the middle of the day the terraform-plan:oho stopped working. Things go from pending to failed quite quickly but then fail with a duration of 0 seconds.

Where should I start looking for further troubleshooting?

This is working when I split out .gitlab-ci.yml across two separate projects and run half the stages in each project.

We’re having the same problem. Support opened an issue for us - https://gitlab.com/gitlab-org/gitlab-runner/issues/3017

I have the same problem - not using docker, just shell runner.
I dont remember what version I had previouslt - definitely lower than 10.3. The problem started when I upgraded to 10.3.3
Test passes/fails fine, but when I retry it, it fails immediately with no log.
Today I noticed that manual deply job always fails, so effectively I can’t deploy anymore.

It looks like the problem is when triggered the job manually by running or re-trying.

Do you have any artifacts in the previously run, dependent jobs? If you do, and the artifact has already expired (even if you aren’t using it in the later jobs), the job will fail immediately with no output.

It’s related to this:
https://docs.gitlab.com/ee/administration/job_artifacts.html#validation-for-dependencies

Yes I did, thanks. This error is confising as hell as the error message doesn’t say anything about artifacts.
I assume if I set dependencies:[] explicitly it would not get that error anymore?

I’m not sure. We turned of the validation to confirm that was the issue, then changed the expiration of our artifacts to be long enough that it won’t be an issue for us anymore.

They’re working on adding useful error messages in https://gitlab.com/gitlab-org/gitlab-ce/issues/41111

Hey All, I also encountering same Issue while running gitlab CI for different statges. when I run some stage manually I see a blank output and job fails. May I know if some one solved this issue?

I am now encountering the same problem but randomly… if I save the yml it fails step 3, even if I rerun, then I save the same yml again (not even actually edit it - just open for edit and save) and it fails step 4 instead, no outputs, no information, no nothing useful at all just doesnt work (it did 4 weeks ago last time I was making any changes and nothing but nothing is supposed to be different from my side) and again rerun is ok.
Frankly doing brain surgery with plasticine spoons is not good