Service not run in multi-pipeline build

Hi Everyone,

I’m running into an issue with a service not running in a multi-pipeline build. The service in question is in the third pipeline in the .drone.yml file. A service in the first pipeline runs fine. My .drone.yml is summarised below:

---
kind: pipeline
type: docker
name: docker-image

steps:
  - name: build
    image: docker:dind
    volumes:
      - name: dockersock
        path: /var/run
    commands:
      # some docker build and push commands (runs successfully)

# this service runs fine
services:
  - name: docker
    image: docker:dind
    privileged: true
    volumes:
      - name: dockersock
        path: /var/run

volumes:
  - name: dockersock
    temp: {}

---
kind: pipeline
type: docker
name: build

steps:
  - name: build
    image: # tagged image from previous pipeline
    commands:
      # random build commands, complete successfully

depends_on:
  - docker-image

---
kind: pipeline
type: docker
name: test

# this service doesn't run
services:
  - name: gotify
    image: gotify/server

steps:
  - name: test
    image: # image from the first pipeline again
    commands:
      # random test commands, which depend on the gotify service running and so fail

depends_on:
  - docker-image

The service runs fine when the pipeline is run locally with drone exec --pipeline test and also with only that pipeline in the .drone.yml file. When the third pipeline is running, the stage shows in the build. However, no logs are shown (just “Loading…”). The logs are also blank when the build completes.

This feels like it’s probably a bug, but I’m a drone novice so it’s definitely possible I’m doing something wrong.

Thanks in advance!

Hey looks like the build was completed, but logs didn’t show up; you may check this thread for a similar issue - Drone logs are cut off

Thanks!

Hi,

That doesn’t seem to be the case here. The logs for the gotify service are not truncated, they are non-existent. Also, the tests in the main pipeline job fail, which they would not do if the gotify service was running (they pass locally both when run manually and via drone exec).

I re-ran the job and watched the running containers on the drone runner host (via watch -n 2 docker ps -a). At no point during the execution of the test pipeline was there a gotify container running. Here is a snapshot of the output:

CONTAINER ID   IMAGE                                                COMMAND                   CREATED              STATUS                          PORTS                                       NAMES
c0036876169f   <my-image>:latest                                    "/bin/sh -c 'echo \"$…"   14 seconds ago       Up 10 seconds                                                               drone-8Oq83qtETFKUkJgjr8r3
67cda0da2910   <my-image>:latest                                    "/bin/sh -c 'echo \"$…"   14 seconds ago       Up 9 seconds                                                                drone-y1kl63qXjaNQWkM7l9dB
43d9ab6d7b2d   drone/git:latest                                     "/usr/local/bin/clone"    About a minute ago   Exited (0) About a minute ago                                               drone-BsQiWBaKvWUallavfKSp
9b0146675beb   drone/git:latest                                     "/usr/local/bin/clone"    About a minute ago   Exited (0) About a minute ago                                               drone-rexijuWPQLgwBsgJvOmk
f5139dedb4b3   drone/drone-runner-docker:1                          "/bin/drone-runner-d…"    18 hours ago         Up 18 hours 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp                       drone-runner_drone-runner_1

You can see here the two containers corresponding to the running test and build jobs, the exited clone containers and the runner, but nothing else. During the earlier pipeline execution, I could see the extra docker service container running.

I also watched the logs from the main drone service (on another machine) and the runner, but there was no output during my pipeline execution.

At this point I’m at a loss for what to try next.