devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Commands no longer work in 5.17.0

Open Quasarman opened this issue 2 years ago • 3 comments

What happened?

While upgrading to 5.17.0 I noticed that commands are no longer working. When trying to run a command from the devspace web interface I get command is not found. exit status 127 Connection closed.

I did upgrade from 5.14.4 and to the best of my knowledge I adapted everything described by the new schema version (v1beta10 -> v1beta11). I did not notice anything changing with respect to the commands.

What did you expect to happen instead?

Commands to run normally as they did before.

How can we reproduce the bug? (as minimally and precisely as possible)

  1. Use version 5.17.0
  2. Add commands as below
  3. Start devspace
  4. Try to run the command from the devspace web interface
  5. Command should fail

My devspace.yaml:

version: v1beta11
...
commands:
  - name: api-load-fixtures
    command: gradlew :runLoadFixtures
  - name: db-flush
    command: gradlew :runFlushDatabase
...

Local Environment:

  • DevSpace Version: 5.17.0
  • Operating System: windows
  • ARCH of the OS: AMD64 Kubernetes Cluster:
  • Cloud Provider: other
  • Kubernetes Version: 1.21.4

Anything else we need to know?

I tried prefixing the commands with ./ since the gradlew script resides in the project root directory on the same level as the devspace.yaml file. Also wrapping the command with "" did not resolve the issue. I also tried upgrading to 5.18.5 to see if this would fix the issue but then custom build commands for images no longer seem to work when they are a path to a custom script, see my last comment on: #1918.

/kind bug

Quasarman avatar Jun 29 '22 07:06 Quasarman

@Quasarman thanks for creating this issue! It actually seems like the error message comes from somewhere else (like gradlew not installed), could you try with a simple echo Hello World command and see if that works?

FabianKramm avatar Jun 29 '22 09:06 FabianKramm

Sure thing the echo Hello World works. So does python --version and any other command where the executable is in my PATH variable. What does not work how ever is path/to/custom-script as a command.

Was the something changes with the way devspace searches for local scripts/executables? Or is it no longer possible to call local scripts? Because as I mentioned I am also unable to specify a path to a local script that I want to execute.

In my case gradlew resides in the same directory as from there devspace is called. Previously this was working. image

Thanks for the quick reply!

Quasarman avatar Jun 29 '22 10:06 Quasarman

Update I have managed to fix it by using sh gradlew for the command. I tried a bit around with different commends and noticed that ls -la show me the current directory (the one where the gradlew file is also located. But I failed with every attempt to just invoke this file by using the path to it. But still I think this behavior is not intended.

Quasarman avatar Jun 29 '22 16:06 Quasarman