delve: vscode remote container - dlv test: could not launch process: not an executable file

Hi 😃

Calling dlv test inside a devcontainer gives me the following output:

$ dlv test
could not launch process: not an executable file

It does not happen outside the devcontainer…

  1. What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.8.2
Build: $Id: dbb493ec14d1e7753504d016b1e1ef1665b75b16 $
  1. What version of Go are you using? (go version)?
go version go1.18 linux/arm64
  1. What operating system and processor architecture are you using?

Host => MacOS M1 - darwin/arm64:

$ uname -a
Darwin manifesto-pro 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

Remote Container => lima VM with docker linux/arm64:

$ uname -a
Linux 1ccbe7b2c827 5.10.103-0-virt #1-Alpine SMP Tue, 08 Mar 2022 10:06:11 +0000 aarch64 GNU/Linux

$ cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
  1. What did you do?

I tried to debug my tests for a k8s operator created with the operator-sdk in vscode inside a devcontainer. I clicked the debug test button over the test function

  1. What did you expect to see?

I expected to see the debugger attach to my test session.

  1. What did you see instead?

A MacOS PopUp showing:

could not launch process: not an executable file

Like in this issue: https://github.com/golang/vscode-go/issues/114#issuecomment-1086793455

(I already looked for misconfigured GOOS/GOARCH settings)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Here is a hacky workaround inotifywait script for quickly testing my hypothesis - turns out it’s the permissions…

By changing the execution bit on every new file containing debug it works now.

#!/bin/bash

inotifywait -r -m /workspace -e create |
    while read dir action file; do
        echo "The file '$file' appeared in directory '$dir' via '$action'"
        if [[ "$file" == *"debug"* ]]; then
          chmod +x $dir$file
        fi
    done