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 exits with a stack trace when selecting "Use other registry" #2916

Open
rofrano opened this issue Nov 21, 2024 · 0 comments
Open
Assignees
Labels
kind/bug Something isn't working

Comments

@rofrano
Copy link

rofrano commented Nov 21, 2024

What happened?

When using devspace init and pressing [enter] to accept the default for every question except to answer: "Use other registry" to the question "If you were to push any images, which container registry would you want to push to?", DevSpace exits with a stack trace.

Here is the complete session:

$ devspace init


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


info Detecting programming language...

? Select the programming language of this project python

? How do you want to deploy this project? 

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

? 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

? How should DevSpace build the container image for this project? Use this existing Dockerfile: ./Dockerfile

? If you were to push any images, which container registry would you want to push to? Use other registry

panic: regexp: Compile(`^(?!-)[a-z0-9-]{1,63}(\.[a-z0-9-]{1,63})*$`): error parsing regexp: invalid or unsupported Perl syntax: `(?!`

goroutine 1 [running]:
regexp.MustCompile({0x10a93752f, 0x2a})
	regexp/regexp.go:313 +0xb4
github.com/loft-sh/devspace/pkg/util/survey.(*survey).Question(0x20?, 0xc0002a0000)
	github.com/loft-sh/devspace/pkg/util/survey/survey.go:45 +0x3e
github.com/loft-sh/devspace/pkg/util/log.(*StreamLogger).Question(0xc00061d200, 0xc0002a0000)
	github.com/loft-sh/devspace/pkg/util/log/stream_logger.go:537 +0x18e
github.com/loft-sh/devspace/pkg/devspace/configure.(*manager).AddImage(0xc000364d80, {0x10a8cfe5e, 0x3}, {0x0, 0x0}, {0xc000b14d50, 0x4}, {0x10a8e1611, 0xc})
	github.com/loft-sh/devspace/pkg/devspace/configure/image.go:174 +0xdf5
github.com/loft-sh/devspace/cmd.(*InitCmd).initDevspace(0xc0002aa000, {0x10b63b6a8, 0x10cba9e08}, {0x10b6333f8, 0xc000c088b0})
	github.com/loft-sh/devspace/cmd/init.go:424 +0x18e3
github.com/loft-sh/devspace/cmd.(*InitCmd).Run(0xc0002aa000, {0x10b63b6a8, 0x10cba9e08})
	github.com/loft-sh/devspace/cmd/init.go:162 +0x379
github.com/loft-sh/devspace/cmd.NewInitCmd.func1(0xc000382608?, {0x10cba9e08?, 0x4?, 0x10a8d0742?})
	github.com/loft-sh/devspace/cmd/init.go:94 +0x47
github.com/spf13/cobra.(*Command).execute(0xc000382608, {0x10cba9e08, 0x0, 0x0})
	github.com/spf13/[email protected]/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000434008)
	github.com/spf13/[email protected]/command.go:1068 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:992
github.com/loft-sh/devspace/cmd.Execute()
	github.com/loft-sh/devspace/cmd/root.go:151 +0x1be
main.main()
	github.com/loft-sh/devspace/main.go:17 +0x2a

What did you expect to happen instead?

I expected DevSpace to prompt me for the name of the registry.

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

Here are the minimal steps:

mkdir demo
cd demo
touch app.py
touch Dockerfile
devspace init

Answers to the questions:

  • Select the programming language of this project python
  • How do you want to deploy this project? helm
  • Do you already have a Helm chart for this project? No
  • Do you want to develop this project with DevSpace or just deploy it? I want to develop this project and my current working dir contains the source code
  • How should DevSpace build the container image for this project? Use this existing Dockerfile: ./Dockerfile
  • If you were to push any images, which container registry would you want to push to? Use other registry

At this point you will get the stack trace as in my description above:

My devspace.yaml: (Sorry, devppace init did not get far enough to create one.

version: ...
...

Local Environment:

  • DevSpace Version: [use devspace --version]: devspace version 6.3.14
  • Operating System: windows | linux | mac: Mac & Linux
  • ARCH of the OS: AMD64 | ARM64 | i386: AMD64 & ARM64

Kubernetes Cluster:

  • Cloud Provider: google | aws | azure | other: k3d
  • Kubernetes Version: [use kubectl version]:
$ kubectl version

Client Version: v1.31.3
Kustomize Version: v5.4.2
Server Version: v1.30.4+k3s1

Anything else we need to know?

This happens on both my Intel Mac and Apple Silicon Mac both natively and when developing in Linux Docker containers so it doesn't seem to have anything do with the OS environment.

@rofrano rofrano added the kind/bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants