devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.37k stars 361 forks source link

`devspace dev` command is not working because url download link for `devspacehelper` cannot be found #2395

Closed thatGreekGuy96 closed 2 years ago

thatGreekGuy96 commented 2 years ago

What happened?
Trying to run the devspace dev command for a project I'm working on and I am getting the following error.

[done] √ Deployed helm chart (Release revision: 1)                        
[done] √ Successfully deployed quickstart with helm                       
[warn]   Couldn't start UI server: download ui: download ui tar ball: Couldn't find ui in github release v5.18.5 at url https://github.com/loft-sh/devspace/releases/tag/v5.18.5
[0:ports] Port-Forwarding: Waiting for containers to start...
[0:sync] Waiting for containers to start...
[0:ports] DevSpace is waiting, because Pod quickstart-56fc889d5-r6hk2 has status: ContainerCreating
[0:ports] DevSpace is waiting, because Pod quickstart-56fc889d5-r6hk2 has status: ContainerCreating
[0:sync] Starting sync...
[0:ports] Port forwarding started on 3000:3000 (user-andy-config-validation/quickstart-56fc889d5-r6hk2)
[fatal]  start sync: start sync: download devspace helper: find download URL: couldn't find devspacehelper in github release v5.18.5 at url https://github.com/loft-sh/devspace/releases/tag/v5.18.5

What did you expect to happen instead?
Would expect the devspace dev command to work.

How can we reproduce the bug? (as minimally and precisely as possible)
I was trying to run the quickstart example in devspace/examples/quickstart

My devspace.yaml:

version: v1beta11
vars:                                # `vars` specifies variables which may be used as ${VAR_NAME} in devspace.yaml
- name: IMAGE
  value: loftsh/javascript:latest
deployments:                         # `deployments` tells DevSpace how to deploy this project
- name: quickstart
  helm:                              # This deployment uses `helm` but you can also define `kubectl` deployments or kustomizations
    componentChart: true             # We are deploying the so-called Component Chart: https://devspace.sh/component-chart/docs
    values:                          # Under `values` we can define the values for this Helm chart used during `helm install/upgrade`
      containers:
      - image: ${IMAGE}              # Use the value of our `${IMAGE}` variable here (see vars above)
        command: ["sleep", "infinity"]
dev:                                 # `dev` only applies when you run `devspace dev`
  ports:                             # `dev.ports` specifies all ports that should be forwarded while `devspace dev` is running
  - imageSelector: ${IMAGE}          # Select the Pod that runs our `${IMAGE}`
    forward:
    - port: 3000                     # lets you access your application via localhost:3000 on your local machine
  sync:                              # `dev.sync` configures a file sync between our Pods in k8s and your local project files
  - imageSelector: ${IMAGE}          # Select the Pod that runs our `${IMAGE}`
    excludeFile: .gitignore          # Exclude everything defined in .gitignore
  terminal:                          # `dev.terminal` tells DevSpace to open a terminal as a last step during `devspace dev`
    imageSelector: ${IMAGE}          # Select the Pod that runs our `${IMAGE}`
    command: ["./devspace_start.sh"] # With this optional `command` we can tell DevSpace to run a script when opening the terminal⏎ 

Local Environment:

Anything else we need to know?
I dug a bit into the devspace source code and it looks as though the way this devspacehelper download works is that we're fetching the html body of https://github.com/loft-sh/devspace/releases/tag/v5.18.5 and doing a regex search for the download link? The issue seems to occur because that regex search is not returning anything.

JamesHutchisonCarta commented 2 years ago

We're seeing the same thing. It looks like Assets is lazy loaded (now?) and that may have broke this. Does anyone have a workaround?

The new URL would be: https://github.com/loft-sh/devspace/releases/expanded_assets/v5.18.5

Would this be a better alternative? https://docs.github.com/en/rest/releases/assets#list-release-assets

bagulm123 commented 2 years ago

Hi @thatGreekGuy96, Looks like the links are broken. We will need to change the url in code to point to new url. Meanwhile, could you please try running the command like this - DEVSPACE_INJECT_LOCAL=true devspace dev ? This will try to skip the downloading of helper from container. If that still fails, you may need to download the devspacehelper binary manually to below location - ~/.devspace/devspacehelper/latest/ I haven't tried this on my local but looking at code, it seems it should work.

thatGreekGuy96 commented 2 years ago

Hi @mahendrabagul thanks for the suggestion! DEVSPACE_INJECT_LOCAL=true devspace dev didn't work but downloading the binary and putting it in the folder you specified did! Many thanks.

FabianKramm commented 2 years ago

@thatGreekGuy96 the problem is that you probably have installed DevSpace via brew, which doesn't have the helper included in the binary directly, which is why the helper is lazy loaded. Unfortunately, Github has changed their release urls and that means that the lazy loading is not working anymore and causes problems for DevSpace v5 brew installations. The workaround by @mahendrabagul should work though