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

Go Panic in LinkConfigController when attempting to add bridge #8626

Closed
ruifung opened this issue Apr 22, 2024 · 1 comment · Fixed by #8627
Closed

Go Panic in LinkConfigController when attempting to add bridge #8626

ruifung opened this issue Apr 22, 2024 · 1 comment · Fixed by #8627
Assignees

Comments

@ruifung
Copy link

ruifung commented Apr 22, 2024

Bug Report

Description

When attempting to add a bridge using the following config fragment, it fails to add a bridge and logs a go panic message to console.

machine:
  nodeLabels:
    role: worker
  network:
    interfaces:
      - interface: eth0
        dhcp: true
      - interface: eth1
        dhcp: false
      - interface: br0
        dhcp: false
        bridge:
          interfaces:
            - eth1

Logs

 user: warning: [2024-04-22T06:23:22.338896757Z]: [talos] controller failed {"component": "controller-runtime", "controller": "network.LinkConfigController", "error": "controller \"network.LinkConfigController\" panicked: runtime error: invalid memory address or nil pointer
 dereference\n\ngoroutine 502 [running]:\nruntime/debug.Stack()\n\t/toolchain/go/src/runtime/debug/stack.go:24 +0x5e\ngit.luolix.top/cosi-project/runtime/pkg/controller/runtime/internal/rruntime.(*Adapter).runOnce.func2()\n\t/.cache/mod/github.com/cosi-project/runtime@v0.4.1/pkg/
 controller/runtime/internal/rruntime/run.go:67 +0x58\npanic({0x2bc4b60?, 0x526cd90?})\n\t/toolchain/go/src/runtime/panic.go:770 +0x132\ngit.luolix.top/siderolabs/talos/internal/app/machined/pkg/controllers/network.SetBridgeMaster(0xc001b3b500, {0x367f010?, 0xc000813820?})\n\t/src/
 internal/app/machined/pkg/controllers/network/network.go:133 +0x58\ngit.luolix.top/siderolabs/talos/internal/app/machined/pkg/controllers/network.(*LinkConfigController).processDevicesConfiguration(0..

Environment

  • Talos version:
Client:                                                                                                                                 Tag:         v1.7.0                                                                                                             SHA:         70fb41ff                                                                                                   
        Built:
        Go version:  go1.22.2
        OS/Arch:     windows/amd64
Server:
        NODE:        pathweb-worker-1.servers.home.yrf.me
        Tag:         v1.7.0
        SHA:         70fb41ff
        Built:
        Go version:  go1.22.2
        OS/Arch:     linux/amd64
        Enabled:     RBAC
  • Kubernetes version:
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.3
  • Platform: metal-amd64 (Proxmox)
@DmitriyMV DmitriyMV self-assigned this Apr 22, 2024
@DmitriyMV
Copy link
Member

Hello! Thanks for the bug report. Fix is coming in shortly.

smira pushed a commit to smira/talos that referenced this issue May 1, 2024
Since we are returning interfaces in config, we have to return something typed for method chaining to work. Otherwise,
it simply doesn't know what method to call because there is no type information. We also don't want to change
the default config behavior, so we don't try to check for `nil` after calling `.STP()`.

Closes siderolabs#8626

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
(cherry picked from commit d460328)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2024
smira pushed a commit to smira/talos that referenced this issue Jul 22, 2024
Since we are returning interfaces in config, we have to return something typed for method chaining to work. Otherwise,
it simply doesn't know what method to call because there is no type information. We also don't want to change
the default config behavior, so we don't try to check for `nil` after calling `.STP()`.

Closes siderolabs#8626

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
(cherry picked from commit d460328)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants