Skip to content

Static route operator periodically crashes with panic: panic called with nil argument #130

Closed

Description

@FilatovM

The static route operator periodically terminates with:

panic: panic called with nil argument
The failure appears to be related to the route manager goroutine.

Suspected cause
main.go starts the route manager with:

go func() {
panic(routeManager.Run(stopChan))
}()

However, RouteManager.Run() can return nil.

In pkg/routemanager/routemanager.go:

case update, ok := <-updateChan:
if !ok {
return nil
}

case <-stopChan:
return nil

The updateChan is supplied by netlink.RouteSubscribe(). If the netlink subscription terminates, the channel can be closed and Run() consequently returns nil.

The caller then effectively executes:

panic(nil) that leads to ---> panic: panic called with nil argument

Related issue
There is another instance where panic(nil) can be called, but it's less probable issue:

if !crdFound {
params.logger.Info("CRD not found: staticroutes.static-route.ibm.com")
panic(err)
}
At this point err can be nil, because the preceding discovery call has already checked err != nil.

Expected behavior
The operator should never execute panic(nil).

For the route manager, an unexpected termination of the netlink subscription should either:

  • return a meaningful error and let the existing process-restart mechanism handle it,
  • or preferably reconnect/restart the netlink subscription without terminating the whole operator.

For the missing CRD case, the operator should panic/return a meaningful error such as:

CRD not found: staticroutes.static-route.ibm.com
rather than panic(nil).

Activity

  1. self-assigned this
    on Oct 10, 2026
  2. Tamas-Biro1 commented on Oct 10, 2026

    @Tamas-Biro1
    Member

    @FilatovM thanks for this issue. I took a look at it and did a draft PR to fix: #133 I am still testing it. Thanks!

  3. Tamas-Biro1 commented on Oct 12, 2026

    @Tamas-Biro1
    Member

    Closing this issue, as the mentioned PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions