-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure during tofu call : fork/exec /usr/bin/tenv: inappropriate ioctl for device #305
Comments
Same error, but in another setup. I am getting it from OS: Fedora 41
|
The breaking change was introduced If you export it as false, everything works > export TENV_DETACHED_PROXY=false
> pre-commit run -a
OpenTofu fmt.............................................................Passed
OpenTofu validate........................................................Passed
OpenTofu docs............................................................Passed
OpenTofu validate with tflint............................................Passed
check yaml...............................................................Passed
detect aws credentials...................................................Passed
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed The question is: is it the expected behaviour? Should we start to export it as |
This behavior change was a feature of version 4.0.0 as a result of #255. I do wonder if this has been checked for the proper impact as all of our pipelines on Azure DevOps are now also having the same issue. Our agents run on Ubuntu 22:04 |
Sorry, we will need a better handling to allow tenv to detect properly if the detached proxy behavior is needed... |
It can be done by simply checking for environment variable |
Also can confirm that setting |
The fact that it was a major version release is indicative of potentially breaking changes. |
#308 should hopefully fix this -- assuming that I'm correct in that |
Whilst I do understand that a Major release can contain breaking changes @tspearconquest the release notes do not seem to reflect or indicate these changes are breaking. I noticed a while back this was the same for another release as well. It would be greatly appriciated if the release notes give a upgrade notice of these breaking changes. As currently we need to dig through the issue's / pr's to see what has been changed.
For Azure DevOps I can confirm that this is not a default variable being set. |
Thanks for confirming. I've opened a PR to add a check for the CI variable. Could you let me know if Azure DevOps has any variable set by default that could be checked? |
Did some investigation of my own in the mean time - https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#agent-variables-devops-services I found 2 AZURE_ variables; one of which I believe is used also by the Azure CLI and so could potentially be set in non-CI environments, and the other which I'm not certain is always set. However, I also found PIPELINE_WORKSPACE which is always set and is certain to be only set in a pipeline, so I've now added that to my patch alongside the CI variable. |
I confirm that Gitlab CI has the $CI variable set to true. |
Hi, unfortunately this fix wasn't sufficient for Azure DevOps after all. I'm getting this error when setting PIPELINE_WORKSPACE to a path (as Azure DevOps does, and I failed to notice/test, instead assuming a boolean check of the variable would be sufficient):
I set it in a manual run as below to produce the above:
Please accept my apologies. |
Please reopen while I work on a better fix |
Hi @kvendingoldo I'm having some trouble; Go is not my specialty and I'm pretty novice at it. I think the issue is caused from |
I'm having a similar issue to this main issue, getting I'm on tenv 4.1.0 |
@tspearconquest it sounds reasonable for me, and I do this in some of my projects. @dvaumoron how it looks for you? |
I think for such case we can have an other method to handle env var presence without assuming a boolean value, i can do that change later today |
Great, thanks. Meantime I will look into the pre-commit environment for a
variable to check, although it sounds like we're getting "into the weeds"
with this mechanism and it might be better to rethink how to detect if
there is a TTY and whether to use that or detach; which is the root cause
of the original change and the current ongoing reports.
…On Fri, Dec 27, 2024, 8:12 AM Denis Vaumoron ***@***.***> wrote:
I think for such case we can have an other method to handle env var
presence without assuming a boolean value, i can do that change later today
—
Reply to this email directly, view it on GitHub
<#305 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATRTFZ2SMUSAK263ZYHTDET2HVN5TAVCNFSM6AAAAABUCZQUWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRTG42DAMJZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
https://rderik.com/blog/identify-if-output-goes-to-the-terminal-or-is-being-redirected-in-golang/ this looks promising for possibly detecting a TTY. WDYT? Found this while googling for a way to detect the presence of a TTY. |
Great, thanks, I will use that on top level proxy ( |
@tspearconquest , @ego93 , @ThibaultNocchi , @dyegoe , @iam-take , @mykyta-martsevyi can you test https://github.com/tofuutils/tenv/releases/tag/v4.2.0-beta1 ? With information on which environement |
I'm away for the holidays, I'll be back to work on Thursday :) |
@dvaumoron I have tested it on Azure DevOps with the default host pool given by Microsoft. and this works. Also it works for our self-hosted docker containers. (Ubuntu 22:04) Tested on: Below a very quick example Azure DevOps pipeline to test this: trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: |
export TENV_AUTO_INSTALL=true
Version="v4.2.0-beta1"
echo "Installing Tenv with version $Version"
curl -O -L "https://github.com/tofuutils/tenv/releases/download/$Version/tenv_${Version}_amd64.deb"
sudo dpkg -i "tenv_${Version}_amd64.deb"
tenv --version
echo "Installing example version of Terraform"
tenv tf use 1.9.8
terraform init
displayName: 'TENV Test'
|
@dvaumoron > env | grep -i tenv
TENV_AUTO_INSTALL=true
TENV_ROOT=/home/dyego/.config/tenv
> tenv version
tenv version v4.2.0-beta1
> pre-commit run -a
OpenTofu fmt.............................................................Failed
- hook id: tofu_fmt
- exit code: 1
Failure during tofu call : fork/exec /home/dyego/.local/bin/tenv: inappropriate ioctl for device
Failure during tofu call : fork/exec /home/dyego/.local/bin/tenv: inappropriate ioctl for device
Failure during tofu call : fork/exec /home/dyego/.local/bin/tenv: inappropriate ioctl for device
OpenTofu validate........................................................Passed
OpenTofu docs............................................................Passed
OpenTofu validate with tflint............................................Passed
check yaml...............................................................Passed
detect aws credentials...................................................Passed
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed If |
@dyegoe , i don't understand yet why it does not work with |
@dvaumoron
pre-commit 4.0.1 Like with @dyegoe result if I set |
Tested v4.2.0-beta1 and its working fine for Jenkins. Hope the issue with pre-commit can be isolated soon and fixed to get this out to everyone. Thanks for the efforts on this! |
moved issue with pre-commit to a separate ticket: #328 |
It's all good for me in Gitlab CI without any added environment variable. |
Question: Why is the original When I run:
I am left with three processes running:
This complexity of trying to "proxy" stdout/stdin and the signals is unnecessary on macOS/Linux/others where replacing the process wholesale will allow it to correctly capture signals and doesn't require anything special. |
I used the go standard library |
Right, and that package creates a sub-process and sets up pipes for stdout/stdin, which is what the issue is. Instead you would want to use: https://pkg.go.dev/syscall#Exec On Linux/macOS/FreeBSD/others and do something special on Windows only... This way you don't create a separate sub-process that is part of the process group, and don't need to do all the extra work of proxying stdin/stdout and it just replaces the process. |
Describe the bug
After new version (v4.0.0) released my github actions have started failing during installation and running tofu
To Reproduce
Steps to reproduce the behavior:
Just try to install tenv v4.0.0 and run
tenv tofu install && tofu version
Reverted to v3.2.11 and it works again
Expected behavior
Expect to install and run tofu without any errors
Screenshots

Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: