devspace icon indicating copy to clipboard operation
devspace copied to clipboard

DevSpace install loop with 4.12.2

Open dsebastien opened this issue 5 years ago • 8 comments

What happened?

After updating my project's dependency from 4.10.0 to 4.12.2, starting devspace sync causes an "install loop". I've tried removing the globally installed DevSpace package, removing/reinstalling my project dependencies, etc but I can't work around the issue.

What did you expect to happen instead?

DevSpace sync starting as usual

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

Install 4.12.2 as a project dependency (not global). Configure and start devspace sync

Local Environment:

  • DevSpace Version: 4.12.2
  • Operating System: Linux (Ubuntu)

Kubernetes Cluster:

  • Cloud Provider: DigitalOcean

Anything else we need to know?

Here's how I start devspace: > npx devspace dev sync --namespace didowi-dev

And here's the console output:

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

Finishing installation of DevSpace CLI
Running: node /home/sebastien/.nvm/versions/node/v12.4.0/lib/node_modules/devspace/index.js finish-install
Download DevSpace CLI release: https://github.com/devspace-cloud/devspace/releases/download/v4.12.2/devspace-linux-amd64

/kind bug

dsebastien avatar May 07 '20 07:05 dsebastien

npx and well as local package installs are generally not recommended and supported. The problem is that the devspace npm package needs to run finish-install to download the actual platform-dependent binary from GitHub (e.g. win 64 bit, linux 32 bit etc). However, to still at least allow local installs, I just opened a PR for this (#1090).

But still, running npx would trigger the binary download repeatedly which is very slow. You should not use npx for devspace unless you only really run it once like in a CI pipeline or so. But even then, just use our official Docker image for the pipeline.

LukasGentele avatar May 07 '20 15:05 LukasGentele

Good to know, thanks Lukas.

I usually prefer local installs to ensure that all team members have the same baseline and only need to install the project dependencies. I can understand why you prefer having the huge binaries global though ;-)

I think I added npx at some point to ensure that the project-local version was used. If I'm not mistaken, the behavior of npx is that, if executed within a project's folder and if the target is in node_modules, then that version is used; otherwise it is downloaded/cached globally then executed.

In my case, npx is only used within some npm scripts.

dsebastien avatar May 07 '20 15:05 dsebastien

Ah okay, I didn't know npx would use local packages if they are available. If that's the case, then using npx is actually not bad in combination with what I just pushed. What I changed is that the binary would be installed into the local folder, so npx would use the locally downloaded binary and not download it again. That would actually sound like it gets the advantages you want (local dependency, versioning in package.json) + no unnecessary downloads.

LukasGentele avatar May 07 '20 15:05 LukasGentele

Should 4.12.5 fix this issue?

dsebastien avatar May 23 '20 15:05 dsebastien

With 4.12.5, it should be possible to run npx devspace commands. There was a small issue in the release which affects windows users but it will also be fixed with the next patch release. It's already in master. Are you able to run npx with devspace now?

LukasGentele avatar May 23 '20 15:05 LukasGentele

FWIW, just found devspace via github explore today, wanted to try it and ended up in this repeating loop. Getting started guide may need to address whatever this issue actually is.

ruckc avatar Aug 31 '21 23:08 ruckc

Same here with devspace v5.17 and node v17.1. Downgrade to node v.16 (LTS) helped.

SergeNarhi avatar Nov 28 '21 05:11 SergeNarhi

I'm using fnm and seeing this error with devspace v5.18 and node v16.13.1. Has anyone gotten this combination working? I've found nvm doesn't play nicely with things like vscode.

Edit: I got this working by manually downloading the binary from the github releases and putting it in my path.

pj avatar Mar 21 '22 15:03 pj