Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devspace init fails without a useful message #2813

Open
FredM opened this issue Mar 6, 2024 · 1 comment
Open

devspace init fails without a useful message #2813

FredM opened this issue Mar 6, 2024 · 1 comment
Labels
devspace kind/bug Something isn't working

Comments

@FredM
Copy link

FredM commented Mar 6, 2024

Similar issue: #2217

What happened?
Getting "fatal exit status 1" error when trying to initialize a project that uses an Helm chart located elsewhere:

$ devspace init --debug

     %########%
     %###########%       ____                 _____
         %#########%    |  _ \   ___ __   __ / ___/  ____    ____   ____ ___
         %#########%    | | | | / _ \\ \ / / \___ \ |  _ \  / _  | / __// _ \
     %#############%    | |_| |(  __/ \ V /  ____) )| |_) )( (_| |( (__(  __/
     %#############%    |____/  \___|  \_/   \____/ |  __/  \__,_| \___\\___|
 %###############%                                  |_|
 %###########%


16:02:05 info Detecting programming language...

? Select the programming language of this project c# (dotnet)

? How do you want to deploy this project?

? Do you already have a Helm chart for this project? Yes

? Which Helm chart do you want to use? Use a chart from another git repository (e.g. you have an infra repo)

? Please specify the git repo that contains the chart (e.g. https://git.org.tld/team/project.git) git@<my-organization-project-helm-repo>.git

? On which git branch is your Helm chart? (e.g. main, master, stable) main

? In which folder is your Helm chart within this other git repo? (e.g. ./chart) ./helm

16:02:31 info Cloning external repo `git@XXX.git` containing to retrieve Helm chart
Cloning into '.devspace/chart-repo'...
remote: Enumerating objects: 34, done.
remote: Counting objects: 100% (34/34), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 34 (delta 4), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (34/34), 12.05 KiB | 12.05 MiB/s, done.
Resolving deltas: 100% (4/4), done.

? Do you want to develop this project with DevSpace or just deploy it?  [Use arrows to move, type to filter] I want to develop this project and my current working dir contains the source code
16:02:39 fatal exit status 1
devspace render
github.com/loft-sh/devspace/cmd.(*InitCmd).render
        /Users/runner/work/devspace/devspace/cmd/init.go:817
github.com/loft-sh/devspace/cmd.(*InitCmd).initDevspace
        /Users/runner/work/devspace/devspace/cmd/init.go:358
github.com/loft-sh/devspace/cmd.(*InitCmd).Run
        /Users/runner/work/devspace/devspace/cmd/init.go:162
github.com/loft-sh/devspace/cmd.NewInitCmd.func1
        /Users/runner/work/devspace/devspace/cmd/init.go:94
github.com/spf13/cobra.(*Command).execute
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:1040
github.com/spf13/cobra.(*Command).Execute
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:968
github.com/loft-sh/devspace/cmd.Execute
        /Users/runner/work/devspace/devspace/cmd/root.go:151
main.main
        /Users/runner/work/devspace/devspace/main.go:17
runtime.main
        /Users/runner/hostedtoolcache/go/1.20.13/x64/src/runtime/proc.go:250
runtime.goexit
        /Users/runner/hostedtoolcache/go/1.20.13/x64/src/runtime/asm_amd64.s:1598
error rendering deployment
github.com/loft-sh/devspace/cmd.(*InitCmd).initDevspace
        /Users/runner/work/devspace/devspace/cmd/init.go:360
github.com/loft-sh/devspace/cmd.(*InitCmd).Run
        /Users/runner/work/devspace/devspace/cmd/init.go:162
github.com/loft-sh/devspace/cmd.NewInitCmd.func1
        /Users/runner/work/devspace/devspace/cmd/init.go:94
github.com/spf13/cobra.(*Command).execute
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:1040
github.com/spf13/cobra.(*Command).Execute
        /Users/runner/work/devspace/devspace/vendor/github.com/spf13/cobra/command.go:968
github.com/loft-sh/devspace/cmd.Execute
        /Users/runner/work/devspace/devspace/cmd/root.go:151
main.main
        /Users/runner/work/devspace/devspace/main.go:17
runtime.main
        /Users/runner/hostedtoolcache/go/1.20.13/x64/src/runtime/proc.go:250
runtime.goexit
        /Users/runner/hostedtoolcache/go/1.20.13/x64/src/runtime/asm_amd64.s:1598

What did you expect to happen instead?
Any useful message to explain what crashed exactly: the helm chart malformed, a write access error, a strange project structure ...? But the current message does not give any clue.

How can we reproduce the bug?
Since the message is really not helpful, I can only say that I have an existing dotnet project and another repo with the associated helm chart (still in development).

My devspace.yaml:

version: v2beta1

dev:
  app:
    imageSelector: image
    ports:
      - port: 5186

The content is partial since it crashed in the middle of dumping it.

Local Environment:

  • DevSpace Version: 6.3.12
  • Operating System: Windows on WSL2
  • ARCH of the OS: AMD64

Kubernetes Cluster:

  • Cloud Provider: local for now
  • Kubernetes Version: v1.28.2

Anything else we need to know?
The log file contains the exact same error message.

I also tested pointing to the folder of the Helm chart on my local but got the same result.

This was a POC to test devspace and see whether it could help with local development to not burden more the developers but bring the local and prod stacks closer.

@FredM FredM added the kind/bug Something isn't working label Mar 6, 2024
@lizardruss
Copy link
Collaborator

@FredM DevSpace isn't able to render your helm chart for some reason. devspace init is attempting to render it so that it can prompt you with a list of images.

A quick way to debug would be to re-run devspace init --reconfigure and when asked "Do you want to develop this project with DevSpace or just deploy it?", answer with "I just want to deploy this project". Once you have the generated devspace.yaml, you can run devspace deploy --render --debug and that should show you a more descriptive error.

Once the error is fixed and the chart can be rendered correctly, you can re-run devspace init --reconfigure to generate a new devspace.yaml with the develop option selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devspace kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants