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

[bug] omnictl error during config merge #683

Open
1 task done
danktec opened this issue Oct 14, 2024 · 8 comments · Fixed by #686
Open
1 task done

[bug] omnictl error during config merge #683

danktec opened this issue Oct 14, 2024 · 8 comments · Fixed by #686
Labels
bug Something isn't working

Comments

@danktec
Copy link

danktec commented Oct 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

omnictl config merge ~/.config/omni/config/omniconfig.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe441fb]

goroutine 1 [running]:
github.com/siderolabs/omni/client/pkg/omnictl/config.(*Config).Merge(0x0, {0x7ffd1db8d6e2?, 0x1?})
	/src/client/pkg/omnictl/config/config.go:164 +0x19b
github.com/siderolabs/omni/client/pkg/omnictl.init.func8(0xc000418d00?, {0xc0003fa7b0, 0x1, 0x141b93c?})
	/src/client/pkg/omnictl/config.go:193 +0x74
github.com/spf13/cobra.(*Command).execute(0x21bd620, {0xc0003fa780, 0x1, 0x1})
	/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0x21bed20)
	/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(0x142d702?)
	/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041 +0x13
main.main()
	/src/cmd/omnictl/main.go:25 +0x171

Expected Behavior

No error

Steps To Reproduce

omnictl -v
omnictl version v0.42.3 (API Version: 1)

linux-amd64

What browsers are you seeing the problem on?

No response

Anything else?

No response

@danktec danktec added the bug Something isn't working label Oct 14, 2024
@alongwill
Copy link
Member

@danktec what is OMNICONFIG set to? Can you include the file contents too please?

DmitriyMV added a commit to DmitriyMV/omni that referenced this issue Oct 14, 2024
Checking for file-not-exist error is not enough.

Fixes siderolabs#683

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
@DmitriyMV
Copy link
Member

DmitriyMV commented Oct 14, 2024

Greetings! Yeah, thats a bug which should be fixes by this PR, but it actually hides some other error.

@DmitriyMV
Copy link
Member

Not exactly closed, since we don't know the underlying error.

@DmitriyMV DmitriyMV reopened this Oct 14, 2024
@danktec
Copy link
Author

danktec commented Oct 14, 2024

cat ~/.config/omni/config/omniconfig.yaml
contexts:
    default:
        url: https://[tenant].omni.siderolabs.io
        auth:
            siderov1:
                identity: dan@tenant.com
context: default

@mrkhachaturov
Copy link

mrkhachaturov commented Oct 28, 2024

Getting the same error.
omnictl is installed on Ubuntu
omnictl version v0.43.3 (API Version: 1)
omniconfig.yaml placed in this path ~/.config/omni/config/omniconfig.yaml.
Configuration is correct; the same works correctly on macOS

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x102b51b]

goroutine 1 [running]:
github.com/siderolabs/omni/client/pkg/omnictl/config.(*Config).Merge(0x0, {0x7ffc3f18b624?, 0x1?})
        /src/client/pkg/omnictl/config/config.go:164 +0x19b
github.com/siderolabs/omni/client/pkg/omnictl.init.func8(0xc0004f8600?, {0xc0004e0680, 0x1, 0x16849e6?})
        /src/client/pkg/omnictl/config.go:193 +0x74
github.com/spf13/cobra.(*Command).execute(0x264db60, {0xc0004e0650, 0x1, 0x1})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0x264f260)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(0x1697c9d?)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041 +0x13
main.main()
        /src/cmd/omnictl/main.go:25 +0x171

If someone following this post to install and configure omnictl just use this command:
export OMNICONFIG=~/.config/omni/config/omniconfig.yaml

@DmitriyMV
Copy link
Member

@mrkhachaturov Something is wrong. The stacktrace you show is from omnictl 0.42.0. Could you double check pls?

@mrkhachaturov
Copy link

mrkhachaturov commented Oct 28, 2024

@mrkhachaturov Something is wrong. The stacktrace you show is from omnictl 0.42.0. Could you double check pls?

rkadmin@runner:~$ omnictl -v
omnictl version v0.43.3 (API Version: 1)
rkadmin@runner:~$ mkdir -p ~/.config/omni/config
rkadmin@runner:~$ nano omniconfig.yaml
rkadmin@runner:~$ cp omniconfig.yaml ~/.config/omni/config
rkadmin@runner:~$ omnictl config merge ./omniconfig.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x102b51b]

goroutine 1 [running]:
github.com/siderolabs/omni/client/pkg/omnictl/config.(*Config).Merge(0x0, {0x7ffdfb988465?, 0x1?})
        /src/client/pkg/omnictl/config/config.go:164 +0x19b
github.com/siderolabs/omni/client/pkg/omnictl.init.func8(0xc000500700?, {0xc0004e2690, 0x1, 0x16849e6?})
        /src/client/pkg/omnictl/config.go:193 +0x74
github.com/spf13/cobra.(*Command).execute(0x264db60, {0xc0004e2660, 0x1, 0x1})
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0x264f260)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(0x1697c9d?)
        /go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041 +0x13
main.main()
        /src/cmd/omnictl/main.go:25 +0x171
rkadmin@runner:~$

@mrkhachaturov
Copy link

mrkhachaturov commented Oct 28, 2024

@mrkhachaturov Something is wrong. The stacktrace you show is from omnictl 0.42.0. Could you double check pls?

This issue arises when you follow the instruction to Install and Configure Omnictl.

We must first define the OMNICONFIG path.
When I define export OMNICONFIG=~/.config/omni/config/omniconfig.yaml, everything worked as expected.

The merge functionality is also working after defining OMNICONFIG

I have made PR to include this in documantation.

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

Successfully merging a pull request may close this issue.

4 participants