{"record":{"id":"6da3b0e654793fec","repo":"apache/beam","slug":"not-supported-on-platform","errorCode":null,"errorMessage":"not supported on platform","messagePattern":"not supported on platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"sdks/go/pkg/beam/util/syscallx/syscall.go","lineNumber":27,"sourceCode":"//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package syscallx provides system call utilities that attempt to hide platform\n// differences. Operations return ErrUnsupported if not implemented on the\n// given platform. Consumers of this package should generally treat that\n// error specially.\npackage syscallx\n\nimport (\n\t\"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors\"\n)\n\n// ErrUnsupported is the error returned for unsupported operations.\nvar ErrUnsupported = errors.New(\"not supported on platform\")\n","sourceCodeStart":9,"sourceCodeEnd":28,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/util/syscallx/syscall.go#L9-L28","documentation":"syscallx.ErrUnsupported is the sentinel error returned by syscallx helpers (hook, PhysicalMemorySize, FreeDiskSpace, SetProcessMemoryCeiling) when the underlying operation is not available on the current platform. Callers are expected to compare with errors.Is / == against this sentinel and degrade gracefully instead of failing. It signals 'unsupported', not 'failed'.","triggerScenarios":"Calling any syscallx function on a platform lacking the corresponding syscall — e.g. SetProcessMemoryCeiling or PhysicalMemorySize on a platform using syscall_default.go, which unconditionally returns ErrUnsupported.","commonSituations":"Running Beam Go workers on unsupported OS/arch combinations (e.g. non-Linux containers, darwin, windows) where the harness init tries to apply a memory rlimit from the --memory_limit flag; disk-space probing on filesystems that don't report statfs data.","solutions":["Compare the result against syscallx.ErrUnsupported and ignore it: `if err := syscallx.SetProcessMemoryCeiling(m, m); err != nil && !errors.Is(err, syscallx.ErrUnsupported) { log }`.","If the memory ceiling matters for your job, run on a platform where the syscall is implemented (Linux) or use container-level memory limits (docker/cgroup) instead.","Check that the correct syscall_*.go build-tag file is being compiled for your GOOS/GOARCH; a missing implementation file funnels everything to syscall_default.go.","Treat the message as informational: it is not a pipeline failure; the harness continues without the limit."],"exampleFix":"// before\nif err := syscallx.SetProcessMemoryCeiling(memLimit, memLimit); err != nil {\n    return err // fails on unsupported platforms\n}\n\n// after\nif err := syscallx.SetProcessMemoryCeiling(memLimit, memLimit); err != nil && !errors.Is(err, syscallx.ErrUnsupported) {\n    return err // real failures only\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := syscallx.SetProcessMemoryCeiling(m, m); err != nil && !errors.Is(err, syscallx.ErrUnsupported) {\n    return fmt.Errorf(\"setting memory ceiling: %w\", err)\n}\n// ErrUnsupported: continue with container/cgroup limits instead","preventionTips":["Always test syscallx errors against the ErrUnsupported sentinel before treating them as failures.","Set memory/disk limits at the container level so per-process syscalls are optional.","Test pipelines on all target GOOS/GOARCH combinations to know which helpers are no-ops there."],"tags":["go","syscall","platform","apache-beam"],"backgroundTag":"unsupported-platform","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}