[Solved] How to use plugins - missing Docker image

I’m trying to use the discord plugin: http://plugins.drone.io/appleboy/drone-discord/

And this is my .docker.yml file:

pipeline:
  build:
    image: microsoft/dotnet
    script:
      - dotnet build

  discord:
    image: appleboy/drone-discord
    secrets: [ discord_webhook_id, discord_webhook_token ]
    message: {{ build.number }} - {{ build.status }}

But when I push this to the repo I get the “Error: missing Docker image” message.

Which version of Drone are you using? I ask because that error message does not coming from the Drone codebase (maybe it is coming from the Docker daemon?). Also can you confirm this is your full yaml file? If not, please post the full configuration.

I don’t know the exact version but I’m getting drone from: http://downloads.drone.io/master/drone.deb
And yes, it is my full yaml config file.

That is a very old distribution that is no longer supported (I believe 0.4 and we are now on 0.8). Did you find a link to that on our websites (if so I need to remove). The current 0.8 documentation is not compatible with version 0.4 which is likely why you are getting errors.

I got that from the digital ocean guide: https://www.digitalocean.com/community/tutorials/how-to-perform-continuous-integration-testing-with-drone-io-on-coreos-and-docker
Haven’t realized it’s so old.

Unfortunately that article is very outdated and Digital Ocean does not keep those articles up-to-date (we have no control over it). I recommend installing using the official docs at https://docs.drone.io

Thanks, I’ll try to install from there. Let’s see if that will fix the plugin issue.

Please also see the official docs for how to create the .drone.yml, because the yaml document you posted above is invalid (the yaml changed from 0.4 to 0.8). For example, there is no script attribute.

The drone docs aren’t very clear to me. I am suppose to create the docker-compose.yaml file and fill it, set the necessary variables and then what? I tried running docker-compose up but I get:

ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

I actually solved that. But running it gives me: INFO: 2018/08/20 19:30:08 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp xxxxxxxx:9000: i/o timeout"; Reconnecting to {xxxxxxxx:9000 <nil>}
This is my config:

version: '2'

services:
  drone-server:
    image: drone/drone:0.8

    ports:
      - 8080
      - 9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
    restart: always
    environment:
      - DRONE_OPEN=true
      - DRONE_HOST=http://xxxxxxxx
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=xxxxxxxx
      - DRONE_GITHUB_SECRET=xxxxxxxx
      - DRONE_SECRET=xxxxxxxx

  drone-agent:
    image: drone/agent:0.8

    command: agent
    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=xxxxxxxx:9000
      - DRONE_SECRET=xxxxxxxx

actually solved that. But running it gives me: INFO: 2018/08/20 19:30:08 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp xxxxxxxx:9000: i/o timeout"; Reconnecting to {xxxxxxxx:9000 <nil>}
This is my config:

You should not change the server address when you configure the agent. The default value in the documentation works as-is, and does not need to be modified.

  drone-agent:
    image: drone/agent:0.8

    command: agent
    restart: always
    depends_on:
      - drone-server
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
-     - DRONE_SERVER=xxxxxxxx:9000
+     - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=xxxxxxxx

Hmmmm, that gives me a bunch of these:

drone-agent_1   | {"time":"2018-08-20T19:40:08Z","level":"debug","message":"request next execution"}
drone-agent_1   | 2018/08/20 19:40:08 grpc error: done(): code: Unknown: rpc error: code = Unknown desc = invalid agent token
drone-agent_1   | {"time":"2018-08-20T19:40:08Z","level":"error","error":"rpc error: code = Unknown desc = invalid agent token","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-08-20T19:40:12Z","level":"debug","message":"request next execution"}
drone-agent_1   | 2018/08/20 19:40:12 grpc error: done(): code: Unknown: rpc error: code = Unknown desc = invalid agent token
drone-agent_1   | {"time":"2018-08-20T19:40:12Z","level":"error","error":"rpc error: code = Unknown desc = invalid agent token","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-08-20T19:41:23Z","level":"debug","message":"request next execution"}
drone-agent_1   | 2018/08/20 19:41:23 grpc error: done(): code: Unknown: rpc error: code = Unknown desc = invalid agent token
drone-agent_1   | {"time":"2018-08-20T19:41:23Z","level":"error","error":"rpc error: code = Unknown desc = invalid agent token","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-08-20T19:41:25Z","level":"debug","message":"request next execution"}
drone-agent_1   | 2018/08/20 19:41:25 grpc error: done(): code: Unknown: rpc error: code = Unknown desc = invalid agent token
drone-agent_1   | {"time":"2018-08-20T19:41:25Z","level":"error","error":"rpc error: code = Unknown desc = invalid agent token","message":"pipeline done with error"}
drone-agent_1   | {"time":"2018-08-20T19:41:26Z","level":"debug","message":"request next execution"}
drone-agent_1   | 2018/08/20 19:41:26 grpc error: done(): code: Unknown: rpc error: code = Unknown desc = invalid agent token
drone-agent_1   | {"time":"2018-08-20T19:41:26Z","level":"error","error":"rpc error: code = Unknown desc = invalid agent token","message":"pipeline done with error"}

this indicates the DRONE_SECRET you are passing to the server and agent do not match. This is a shared secret, and the values must match exactly. Please see the following code if you continue to experience issues:

Oh… lol. I just noticed a small typo :sweat_smile:
It doesn’t throw any errors anymore. How would I go about making the app work on the port 8080, do I change the DRONE_SERVER=drone-server:9000 line?
EDIT: Nope…

port 8080 is for http requests and port 9000 is for grpc requests. While it is possible (under some circumstances) to combine the two, drone does not support this.

Ah, that makes sense. Thank you very much for you help :smiley: