{"record":{"id":"ac65f32d34577d49","repo":"wavetermdev/waveterm","slug":"unsupported-wsh-platform-s-s","errorCode":null,"errorMessage":"unsupported wsh platform: %s-%s","messagePattern":"unsupported wsh platform: (.+?)-(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/util/shellutil/shellutil.go","lineNumber":349,"sourceCode":"\t\treturn ZshExtendedHistoryPattern.MatchString(line), nil\n\t}\n\n\treturn false, nil\n}\n\nfunc GetLocalWshBinaryPath(version string, goos string, goarch string) (string, error) {\n\text := \"\"\n\tif goarch == \"amd64\" {\n\t\tgoarch = \"x64\"\n\t}\n\tif goarch == \"aarch64\" {\n\t\tgoarch = \"arm64\"\n\t}\n\tif goos == \"windows\" {\n\t\text = \".exe\"\n\t}\n\tif !wavebase.SupportedWshBinaries[fmt.Sprintf(\"%s-%s\", goos, goarch)] {\n\t\treturn \"\", fmt.Errorf(\"unsupported wsh platform: %s-%s\", goos, goarch)\n\t}\n\tbaseName := fmt.Sprintf(\"wsh-%s-%s.%s%s\", version, goos, goarch, ext)\n\treturn filepath.Join(wavebase.GetWaveAppBinPath(), baseName), nil\n}\n\n// absWshBinDir must be an absolute, expanded path (no ~ or $HOME, etc.)\n// it will be hard-quoted appropriately for the shell\nfunc InitRcFiles(waveHome string, absWshBinDir string) error {\n\t// ensure directories exist\n\tzshDir := filepath.Join(waveHome, ZshIntegrationDir)\n\terr := wavebase.CacheEnsureDir(zshDir, ZshIntegrationDir, 0755, ZshIntegrationDir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbashDir := filepath.Join(waveHome, BashIntegrationDir)\n\terr = wavebase.CacheEnsureDir(bashDir, BashIntegrationDir, 0755, BashIntegrationDir)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/util/shellutil/shellutil.go#L331-L367","documentation":"GetLocalWshBinaryPath computes the platform-specific wsh binary name (wsh-<version>-<goos>-<goarch>[.exe]) but first verifies the goos-goarch pair is in wavebase.SupportedWshBinaries; if not, it returns this error. The wsh binary is only built for a fixed matrix of platforms.","triggerScenarios":"Calling GetLocalWshBinaryPath when the resolved GOOS/GOARCH pair (overridable via environment/target vars) is not in the supported map — e.g. freebsd, openbsd, 386, or riscv64 builds, or a custom GOARCH override in the shell environment.","commonSituations":"Building/running Wave on an unsupported architecture (e.g. linux-386 or freebsd-amd64); environment variables GOOS/GOARCH set to unusual values leaking into the function; attempting remote connections to hosts on unsupported platforms.","solutions":["Check wavebase.ValidateWshSupportedArch(goos, goarch) before calling and handle unsupported hosts differently","Only invoke on supported pairs listed in wavebase.SupportedWshBinaries","Don't set GOOS/GOARCH environment overrides that alter the resolved platform","Build a custom wsh binary and add the platform to SupportedWshBinaries if you genuinely need it"],"exampleFix":"// before\npath, err := shellutil.GetLocalWshBinaryPath()\n// after\nif !wavebase.ValidateWshSupportedArch(runtime.GOOS, runtime.GOARCH) {\n\treturn fmt.Errorf(\"wsh not available for %s-%s\", runtime.GOOS, runtime.GOARCH)\n}\npath, err := shellutil.GetLocalWshBinaryPath()","handlingStrategy":"validation","validationCode":"if !wavebase.ValidateWshSupportedArch(goos, goarch) {\n\treturn fmt.Errorf(\"wsh binary not available for %s-%s\", goos, goarch)\n}\npath, err := shellutil.GetLocalWshBinaryPath()","typeGuard":null,"tryCatchPattern":"path, err := shellutil.GetLocalWshBinaryPath()\nif err != nil {\n\tif strings.Contains(err.Error(), \"unsupported wsh platform\") {\n\t\treturn fmt.Errorf(\"remote host platform not supported by wsh: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Check the SupportedWshBinaries map before connecting to remote hosts","Avoid setting GOOS/GOARCH environment overrides that change platform resolution","Keep the platform matrix in wavebase in sync with shipped wsh binaries","Feature-detect wsh availability instead of assuming it on all hosts"],"tags":["platform-support","wsh","configuration"],"backgroundTag":"unsupported-platform","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}