Drone

Slack plugin notifications error

I added notifications to my .drone.yml, but I keep getting an error for:

Post : unsupported protocol scheme “”

Not sure what is causing this error. Config looks like:

slack:
image: plugins/slack
channel: MY_CHANNEL
secrets: [ slack_webhook ]
username: drone
template: >
{{#success build.status}}
Build {{build.number}} succeeded - Good job team!
{{else}}
Build {{build.number}} failed - fix me please! :poop:
{{/success}}
when:
status: [ success, failure ]

Thanks in advance.

This error message is the result of the secret not being passed to the plugin. The webhook must be a valid url, and when the webhook secret is not passed to the plugin, the webhook url is blank.

Post : unsupported protocol scheme ""

The most common root cause for this, with regards to the slack plugin, is forgetting to enable the secret for pull requests as mentioned in this thread. Secrets are not passed to pull requests by default, for security reasons.

If this is not the case, please see the following section of the docs that demonstrate all the information we will need to see to further help you troubleshoot, which you can post back to this thread.
http://docs.drone.io/secrets-not-working/#still-having-trouble

Pull request seems to be enabled for this secret:

slack_webhook
Events: push, tag, deployment, push, pull_request
SkipVerify: false
Conceal: false

Let me try to wrap it in quotes to see if that works.

I think we need the following additional information:

  • what version of drone server are you running?
  • what version of drone cli are you running?
  • exact command you used to create the secret (with only the secret redacted)

The reason is that the CLI output you posted looks like from an old version of the CLI. Using a very old version of the CLI with a new version of the server could result in secrets not being properly created.

If you are using drone 0.7 or 0.8 please ensure you are using the correct CLI install instructions and download links http://docs.drone.io/cli-installation/

Okay got this working, so I copied the examples listed in the documentation and I think the culprit is an erroneous space in the declarations. This may be an issue when using newline \ syntax and using the up arrow key or it’s adding = signs after the variable flags.

Thanks for the help and I’m glad we got this figured out, just hate the time spent - my bad.

Yay, drone though - totally like the product, KUDOS!!

I tried and get the same error:

- name: slack
  image: plugins/slack
  settings:
    webhook:
      from_secret: slack-wh
    channel: portal-integration

The webhook url is correctly copied in secret named “slack-wh” - I used web interface to create the secret.

Result is

2019/07/10 11:46:32 Post : unsupported protocol scheme ""

I activated traces and see:
{"kind":"secret","level":"trace","msg":"secret: encrypted: no matching secret","name":"slack-wh","time":"2019-07-10T11:46:05Z"}

But the secret is here !

drone secret ls xxxxxx

slack-wh 
Pull Request Read:  false
Pull Request Write: false

Drone v1.1.0:
image: docker.io/drone/drone:1.1.0

And I know understand that I didn’t activated “pull-request” authorization… Sorry for that