hashicorp/packer · error
no TTY available on solaris
Error message
no TTY available on solaris
What it means
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.
Source
Thrown at tty_solaris.go:13
// Copyright IBM Corp. 2024, 2025
// SPDX-License-Identifier: BUSL-1.1
package main
import (
"fmt"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
)
func openTTY() (packersdk.TTY, error) {
return nil, fmt.Errorf("no TTY available on solaris")
}
View on GitHub (pinned to eb36e3c3e4)
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.
Example fix
// before: requesting a TTY on a Solaris host tty, err := openTTY() // err: no TTY available on solaris // after: avoid TTY-dependent paths, e.g. run packer in a Linux container // docker run --rm -v $PWD:/workspace -w /workspace golang:1.22 make dev
Defensive patterns
Strategy: fallback
Validate before calling
if runtime.GOOS == "solaris" {
return errors.New("TTY-dependent features are unsupported on solaris; use a Linux/macOS/Windows host")
} Type guard
func ttySupported() bool { return runtime.GOOS != "solaris" } Try / catch
tty, err := openTTY()
if err != nil && strings.Contains(err.Error(), "no TTY available on solaris") {
tty = fallbackPtyAllocator() // or disable TTY-requiring feature
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/b81bc3a474813e54.
Report an issue: GitHub.