{"record":{"id":"b81bc3a474813e54","repo":"hashicorp/packer","slug":"no-tty-available-on-solaris","errorCode":null,"errorMessage":"no TTY available on solaris","messagePattern":"no TTY available on solaris","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tty_solaris.go","lineNumber":13,"sourceCode":"// Copyright IBM Corp. 2024, 2025\n// SPDX-License-Identifier: BUSL-1.1\n\npackage main\n\nimport (\n\t\"fmt\"\n\n\tpackersdk \"github.com/hashicorp/packer-plugin-sdk/packer\"\n)\n\nfunc openTTY() (packersdk.TTY, error) {\n\treturn nil, fmt.Errorf(\"no TTY available on solaris\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/tty_solaris.go#L1-L15","documentation":"openTTY is the platform-specific TTY opener for Solaris in this Packer build. Solaris has no implemented terminal-allocation helper, so the function unconditionally returns the error \"no TTY available on solaris\". Any code path that needs to allocate a TTY (typically for interactive commands or communicate plugins requiring a pseudoterminal) cannot run on Solaris builds of Packer.","triggerScenarios":"Calling openTTY() on a Solaris build — i.e. any feature that requests a TTY via the packersdk.TTY interface (e.g. commands/components requiring an interactive terminal) — always returns this error since the Solaris implementation is a stub. tty_solaris.go:12-15.","commonSituations":"Running Packer on Solaris/illumos where a component or plugin requires TTY allocation (e.g. ssh with request_pty or interactive sudo); using a Solaris binary after workflows developed on Linux/macOS where the TTY path silently succeeds; CI agents on Solaris hitting an interactive-provisioner feature.","solutions":["Run Packer on a supported platform (Linux, macOS, Windows) where TTY allocation is implemented, and drive the Solaris machine remotely via a builder/communicator.","Avoid features that require a TTY on the Solaris host: disable request_pty / interactive prompts in the relevant provisioner/communicator config.","If you must build from Solaris, run packer inside a Linux container/VM on the Solaris host.","Upstream: implement a Solaris TTY helper (e.g. via posix_openpt/pty wrapper) and add a tty_solaris.go implementation, or contribute a build tag change if not applicable."],"exampleFix":"// before: requesting a TTY on a Solaris host\ntty, err := openTTY() // err: no TTY available on solaris\n// after: avoid TTY-dependent paths, e.g. run packer in a Linux container\n// docker run --rm -v $PWD:/workspace -w /workspace golang:1.22 make dev","handlingStrategy":"fallback","validationCode":"if runtime.GOOS == \"solaris\" {\n    return errors.New(\"TTY-dependent features are unsupported on solaris; use a Linux/macOS/Windows host\")\n}","typeGuard":"func ttySupported() bool { return runtime.GOOS != \"solaris\" }","tryCatchPattern":"tty, err := openTTY()\nif err != nil && strings.Contains(err.Error(), \"no TTY available on solaris\") {\n    tty = fallbackPtyAllocator() // or disable TTY-requiring feature\n}","preventionTips":["Gate TTY-requiring configuration (request_pty, interactive prompts) behind runtime.GOOS checks.","Run packer from a supported OS; drive Solaris machines remotely instead.","Document platform constraints in CI agent provisioning so jobs don't land on Solaris runners.","Track upstream for a Solaris TTY implementation before enabling such features there."],"tags":["solaris","tty","platform-limitation","unsupported-platform"],"backgroundTag":"no-tty-available","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}