Drone-cli [drone exec] invalid state - won't execute ANY commands

Hey everyone,

I’ve been working on a new pipeline for the past few days and I’ve been using the drone cli to help debug until its ready. Today I was finishing up the last issue i’ve encountered, which is similar to whats happening now. Essentially, one of the final steps would just be skipped. The step in question uses a private image hosted on github so I figured that may be the issue so i began commenting out lines and making the step simpler to figure out the issue. Well, nothing worked, every line from that step was commented out and the pipeline STILL didn’t work, which is a step backwards.

Well, lo and behold, I’m at a point where drone exec can’t even run a 1 step, 1 command pipeline using alpine that simply echos hello world. All it does is pull the image.

I’ve reinstalled drone and docker several times, reconfigured docker, checked my environment variables. I’m at my wits end so any advice is appreciated.

More context:
drone-cli was installed with brew, no other drone components are installed
docker was also installed with brew

hello world pipeline:

kind: pipeline
type: docker
name: default

steps:
- name: test
  image: alpine
  commands:
  - echo hello
  - echo world

hello world output:

2022/11/09 18:06:36 proto: duplicate proto type registered: PluginSpec
2022/11/09 18:06:36 proto: duplicate proto type registered: PluginPrivilege
No stage specified, assuming 'default'
[test:1] latest: Pulling from library/alpine
[test:2] Digest: sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad
[test:3] Status: Image is up to date for alpine:latest

docker config:

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": true
  }
}

Hello @lharalambus

That is definitely frustrating.

I just tried your pipeline with version 1.6.1 of the Drone CLI which worked for me

2022/11/10 10:38:56 proto: duplicate proto type registered: PluginSpec
2022/11/10 10:38:56 proto: duplicate proto type registered: PluginPrivilege
No stage specified, assuming 'default'
[test:1] latest: Pulling from library/alpine
[test:2] Digest: sha256:bc41182d7ef5ffc53a40b044e725193bc10142a1243f395ee852a8d9730fc2ad
[test:3] Status: Image is up to date for alpine:latest
[test:4] + echo hello
[test:5] hello
[test:6] + echo world
[test:7] world

Version 1.6.1 of the Drone CLI was recently released and it contains many updates.

Could you try installing 1.5.0 and see if you see any different output? Release v1.5.0 · harness/drone-cli · GitHub

1 Like

Thanks for the help.

I was using 1.6.1 as well and downgraded like you asked. Unfortunately it still didn’t work, but this time it fortunately gave me an error, so a lead to follow.

In short, my docker file sharing settings were incorrect which somehow caused the issue. Located @ /Users/$user/Library/Group Containers/group.com.docker/settings.json on MacOS

The weird thing is docker by itself worked as configured, only adding drone on top caused the issues. I guess I have to chalk this up to me being a macos newbie and not knowing where all the settings are.

Thanks for the help, I really appreciate it!