Drone

Drone-runner-kube error without logs

I’m about to use drone runner kube to build an image, using kaniko, but the step always goes wrong without any log. I turn on verbose and debug log, which cannot give any useful information about the error.

Here is my drone config

kind: pipeline
type: kubernetes
name: default

steps:

  - name: test
    image: banzaicloud/drone-kaniko # not works, same with gcr.io/kaniko-project/executor:latest
    # image: node:lts-alpine <- works find
    commands:
    - echo works

Here is the drone pod log in k8s

time="2020-05-16T05:55:33Z" level=debug msg="stage received" stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:55:33Z" level=debug msg="stage accepted" stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:55:33Z" level=debug msg="stage details fetched" build.id=22 build.number=22 repo.id=1 repo.name=template-web-basic repo.namespace=cicd stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:55:34Z" level=debug msg="updated stage to running" build.id=22 build.number=22 repo.id=1 repo.name=template-web-basic repo.namespace=cicd stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:56:03Z" level=trace msg="http: no content returned: re-connect and re-try"
time="2020-05-16T05:56:03Z" level=trace msg="http: no content returned: re-connect and re-try"
time="2020-05-16T05:56:22Z" level=debug msg="updated stage to complete" build.id=22 build.number=22 duration=49 repo.id=1 repo.name=template-web-basic repo.namespace=cicd stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:56:22Z" level=debug msg="poller: request stage from remote server" thread=25
time="2020-05-16T05:56:22Z" level=trace msg="http: context canceled"
time="2020-05-16T05:56:22Z" level=debug msg="done listening for cancellations" build.id=22 build.number=22 repo.id=1 repo.name=template-web-basic repo.namespace=cicd stage.id=22 stage.name=default stage.number=1 thread=25
time="2020-05-16T05:56:43Z" level=trace msg="http: no content returned: re-connect and re-try"

Here is the error screenshot

The reason it does not work is because you have specified commands, which requires a shell inside the image. The Kaniko plugin ultimately comes from a scratch base and does not have a shell. It is therefore not intended to run shell commands. It should instead be configured with settings as shown in the README