Skip to content

Commit

Permalink
chore(action): on dagger error check of kernel module
Browse files Browse the repository at this point in the history
- this specific problem can be difficult to diagnose
- add check for missing kernel module
- into general error add link to dagger troubleshooting guide

Signed-off-by: AtomicFS <vojtech.vesely@9elements.com>
  • Loading branch information
AtomicFS committed Dec 2, 2024
1 parent 319583c commit 6c677ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"iasl",
"ifdtool",
"inargs",
"iptable",
"iucode",
"kbuild",
"kconfig",
Expand Down
26 changes: 21 additions & 5 deletions action/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"log/slog"
"os"
"path/filepath"
"regexp"
"runtime"
"strings"

"dagger.io/dagger"
Expand Down Expand Up @@ -189,12 +191,26 @@ func Setup(ctx context.Context, client *dagger.Client, opts *SetupOpts, dockerfi
slog.String("suggestion", "try this: https://archive.docs.dagger.io/0.9/235290/troubleshooting/#dagger-pipeline-is-unable-to-resolve-host-names-after-network-configuration-changes"),
slog.Any("error", err),
)
} else {
slog.Error(
message,
slog.Any("error", err),
)
}
if strings.Contains(err.Error(), "timed out waiting for session params") && runtime.GOOS == "linux" {
// On Linux, check if 'iptable_nat' kernel module is loaded
content, err := os.ReadFile("/proc/modules")
if err != nil {
pattern := regexp.MustCompile(`^iptable_nat`)
if pattern.FindString(string(content)) == "" {
slog.Error(
message,
slog.String("suggestion", "dagger requires the 'iptable_nat' Linux kernel module in order to function properly, https://docs.dagger.io/troubleshooting#dagger-restarts-with-a-cni-setup-error"),
slog.Any("error", err),
)
}
}
}
slog.Error(
message,
slog.String("suggestion", "something is wrong with dagger, please check dagger troubleshooting guide at: https://docs.dagger.io/troubleshooting"),
slog.Any("error", err),
)
}

return container, err
Expand Down

0 comments on commit 6c677ec

Please sign in to comment.