Restarting build with invalid Yaml gets stuck pending

Unable to setup Drone 0.8 with standard settings. With running agent and server - builds are never started. Described the issue in https://stackoverflow.com/questions/46143733/drone-0-8-build-stuck-in-pending-state.

The error at https://i.stack.imgur.com/l1ONU.png already shows that your .drone.yml seems to be invalid, can you paste an example? Looks like it’s lacking an image for some step and this is the error returned by the Docker API.

Our .drone.yml file is the following:

pipeline:
  test:
    image: golang:1.9
    commands:
      - go get -u github.com/golang/dep/cmd/dep
      - go get -u github.com/mitchellh/gox
      - go test -race -coverprofile=coverage.txt -covermode=atomic -coverpkg $(go list ./... | grep -v /vendor/)
    when:
      event: [push, tag]
    
  build:
    image: golang:1.9
    commands:
      - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitRevision=`git describe --tags || git rev-parse HEAD`"
      - gox -os "linux darwin windows" -arch "amd64" -osarch="windows/386" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags "-X main.buildStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'` -X main.gitRevision=`git describe --tags || git rev-parse HEAD`"
    when:
      event: [push, tag]

  latest_image:
    image: plugins/docker
    repo: some/repo
    secrets: [ DOCKER_USERNAME, DOCKER_PASSWORD ]
    tag: [ latest ]
    when:
      branch: master
      event: push

  release_image:
    image: plugins/docker
    repo: some/repo
    secrets: [ DOCKER_USERNAME, DOCKER_PASSWORD ]
    tag: ${DRONE_TAG}
    when:
      event: tag

  notify:
  telegram:
    image: appleboy/drone-telegram
    token: ${TELEGRAM_TOKEN}
    to: someuser

I doubt about this line: image: plugins/docker. However I would expect that an agent first polls the build from the queue (and I see some entries in agent container logs) and only after that analyses Yaml file syntax. So far as I don’t see any agent activity I suppose that this error about wrong image is a bug and the real reason is that agent for some reason does not get the build from the queue. Is access from agent to server GRPC port 9000 sufficient for agent to work?

The error in the screenshot, invalid or missing image, is an error that comes from the yaml parser. It indicates something is wrong with your yaml. In your sampe, I can see there is an issue with the indentation in the notify / telegram section.

Please read http://docs.drone.io/error-invalid-or-missing-image/

Unable to setup Drone 0.8 with standard settings

So from what I can see you have setup drone just fine, but there is an issue with your yalm configuration.

Note that Drone should prevent restarting an errored / invalid yaml file. So that is something we will resolve on the drone end of things. But this should impact you going forward, once you resolve your yaml file.

1 Like

Thank you this resolved the issue.