Nil Pointer Dereference in Watcher Executor -> dereference panic.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Read pkg/watcher/executor.go and start at TriggerImport, following the connectors.NewClient error path before mc.UploadArtifact is called. Reproduce the issue with an invalid or expired context and a watched-file change, then verify the watcher handles the client failure without a nil-pointer panic.
Written by the indexing model from the issue text.
Description
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, 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.
- Dominant language
- Go
- Stars
- 52
- Forks
- 67
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microcks/microcks-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microcks/microcks-cli#536 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
microcks/microcks-cli#535 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
microcks/microcks-cli#534 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microcks/microcks-cli#511 ·
-
component/cli kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microcks/microcks-cli#503 · 4 comments ·
All issues in microcks/microcks-cli
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100