I have recently upgrade my MAC(Monterey OS to 12.3.1) after which I am unable to access lower versions of Terraform. Most of my applications are legacy and are using 0.10.2 version of Terraform. After OS update II ran brew upgrade & tried uninstalling/installing tfswitch but noluck.
Getting the following error
➜ ü terraform --version
fatal error: runtime: bsdthread_register error
/opt/go/src/runtime/panic.go:596 +0x95 fp=0x7ff7bfeffa30 sp=0x7ff7bfeffa10
/opt/go/src/runtime/os_darwin.go:108 +0xa0 fp=0x7ff7bfeffa60 sp=0x7ff7bfeffa30
/opt/go/src/runtime/proc.go:486 +0xa1 fp=0x7ff7bfeffaa0 sp=0x7ff7bfeffa60
runtime.rt0_go(0x7ff7bfeffad8, 0x2, 0x7ff7bfeffad8, 0x0, 0x1000000, 0x2, 0x7ff7bfeffc30, 0x7ff7bfeffc3a, 0x0, 0x7ff7bfeffc44, …)
/opt/go/src/runtime/asm_amd64.s:158 +0x183 fp=0x7ff7bfeffaa8 sp=0x7ff7bfeffaa0
Thanks in advance
Terraform 0.10 is exceptionally old (from Nov 2017 - so nearly 5 years old) and will be totally incompatible with all modern providers & modules. As a result native M1 versions of Terraform & providers from that age just won’t exist. You can probably use the x86 emulation system in MacOS and download things manually.
I would strongly recommend upgrading to using a more modern version.
Thank you Stuart. But apart from using x86 emulation is there any other alternative available…please advise as Client has many Terraform repos that are of 0.10.2 version.
You could probably try compiling the binaries for Terraform & whatever providers you need yourself. I think Go 1.6 was the first version with M1 support. I’ve no idea if it would work though, as the original binaries would have been built with a much older version of Go, and I don’t know if any other changes were needed to support 1.6/M1.
Version 0.10 is completely obsolete so you are basically on your own. I think everyone would strongly suggest upgrading as quickly as you can.
In this particular case it seems like the error is from the old Go runtime doing something that modern the macOS API doesn’t support. In the early days of Go support for macOS I believe the Go runtime was (unknown to the Go team at that point) relying on some implementation details of macOS rather than exclusively on public interfaces, which they gradually fixed over time but perhaps Terraform v0.10 was built with an old enough version fo Go that it still uses some undocumented system interfaces that modern macOS doesn’t support.
If you need to routinely use obsolete Terraform versions then my best suggestion would be to set up a Linux virtual machine on your Mac and use the
linux_amd64 version of Terraform v0.10 instead. Unlike macOS, Linux has a stable system call interface and so software built for older versions of Linux should typically be compatible with newer kernels. (This doesn’t necessarily follow for software built around the C library, but Terraform v0.10 on Linux does not use the C library.)