You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sequenceDiagram
participant Watcher
participant Executor
participant Client as connectors.NewClient
Watcher->>Executor: TriggerImport(entry)
Executor->>Client: NewClient(*globalClientOpts)
Note over Client: Fails (e.g. invalid context)
Client-->>Executor: nil, err
Note over Executor: Logs error, but DOES NOT return!
Executor->>Executor: mc.UploadArtifact(entry.FilePath, entry.MainArtifact)
Note over Executor: Panic: nil pointer dereference (mc is nil)
Loading
Description
In pkg/watcher/executor.go, the TriggerImport function instantiates the Microcks client using connectors.NewClient. If this fails (e.g., due to an invalid context or server address), it prints an error message but continues execution instead of returning early. It subsequently calls mc.UploadArtifact(), causing a nil pointer dereference panic.
Impact
The watcher daemon crashes with a stack trace instead of handling the connection/context resolution failure gracefully.
Steps to Reproduce
Configure a watch entry with an invalid or expired context.
Modify the watched file to trigger an fsnotify event.
The watch manager invokes TriggerImport, which prints [ERROR] Cannot connect to Microcks client... and immediately panics with a segmentation fault.
Describe the bug
Diagram
sequenceDiagram participant Watcher participant Executor participant Client as connectors.NewClient Watcher->>Executor: TriggerImport(entry) Executor->>Client: NewClient(*globalClientOpts) Note over Client: Fails (e.g. invalid context) Client-->>Executor: nil, err Note over Executor: Logs error, but DOES NOT return! Executor->>Executor: mc.UploadArtifact(entry.FilePath, entry.MainArtifact) Note over Executor: Panic: nil pointer dereference (mc is nil)Description
In
pkg/watcher/executor.go, theTriggerImportfunction instantiates the Microcks client usingconnectors.NewClient. If this fails (e.g., due to an invalid context or server address), it prints an error message but continues execution instead of returning early. It subsequently callsmc.UploadArtifact(), causing a nil pointer dereference panic.Impact
The watcher daemon crashes with a stack trace instead of handling the connection/context resolution failure gracefully.
Steps to Reproduce
TriggerImport, which prints[ERROR] Cannot connect to Microcks client...and immediately panics with a segmentation fault.