Skip to content
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

docs/terminals.md: add troubleshooting #2985

Merged
merged 1 commit into from
Jun 3, 2021

Conversation

kolyshkin
Copy link
Contributor

Explain where the "/dev/tty: no such device or address" error is coming
from, and provide ways to solve the issue.

For more background, see #2970

```

from runc, it means it can't open a terminal (because there isn't one). This
can happen in case stdin (and possibly also stdout and stderr) are redirected,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
can happen in case stdin (and possibly also stdout and stderr) are redirected,
can happen when stdin (and possibly also stdout and stderr) are redirected,


from runc, it means it can't open a terminal (because there isn't one). This
can happen in case stdin (and possibly also stdout and stderr) are redirected,
or on some environments that lack a tty (such as GitHub Actions runners).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
or on some environments that lack a tty (such as GitHub Actions runners).
or in some environments that lack a tty (such as GitHub Actions runners).

can happen in case stdin (and possibly also stdout and stderr) are redirected,
or on some environments that lack a tty (such as GitHub Actions runners).

The solution to this is *not* use a terminal for the container, i.e. have
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The solution to this is *not* use a terminal for the container, i.e. have
The solution to this is to *not* use a terminal for the container, i.e. have


The solution to this is *not* use a terminal for the container, i.e. have
`terminal: false` in `config.json`. If the container really needs a terminal
(as some programs require it), you can provide one, using one of the following
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(as some programs require it), you can provide one, using one of the following
(some programs require one), you can provide one, using one of the following

(as some programs require it), you can provide one, using one of the following
methods.

One way to do so is to use `ssh -tt` option. The second `t` forces a terminal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
One way to do so is to use `ssh -tt` option. The second `t` forces a terminal
One way is to use `ssh` with the `-tt` flag. The second `t` forces a terminal


One way to do so is to use `ssh -tt` option. The second `t` forces a terminal
allocation even if there's no local one -- and so it is required when stdin is
not a terminal (known `ssh` implementations only look for a terminal on stdin).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
not a terminal (known `ssh` implementations only look for a terminal on stdin).
not a terminal (some `ssh` implementations only look for a terminal on stdin).

allocation even if there's no local one -- and so it is required when stdin is
not a terminal (known `ssh` implementations only look for a terminal on stdin).

Another way is to run runc under `script` utility, like this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Another way is to run runc under `script` utility, like this
Another way is to run runc under the `script` utility, like this

$ script -e -c 'runc run <container>'
```

Note that older versions of `script` are known to have issues.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a bit more detail about what kinds of issues?

@kolyshkin kolyshkin requested a review from cyphar June 2, 2021 15:55
Explain where the "/dev/tty: no such device or address" error is coming
from, and provide ways to solve the issue.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin
Copy link
Contributor Author

Addressed review comments, thanks @cyphar

Copy link
Contributor Author

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed review comments, thanks @cyphar

@kolyshkin
Copy link
Contributor Author

I'm not sure what's happening but it seems that GitHub comments system is having issues. I see review comments being repeated, and I don't see the replies that I left.

@kolyshkin
Copy link
Contributor Author

Can you provide a bit more detail about what kinds of issues?

I think the biggest issue for me was that script from CentOS 7 always returned
exit code of 0, even if the program running in it was not. This made our tests
always succeed :) and was fixed in #2745
(by replacing script with ssh -tt).

There was some occasional lockups as well, but I am not sure if this was script.
Looking into util-linux's git log for script sources, were were some races, so
maybe it was script.

Anyway, since this description is so vague, I have removed this "beware of bugs"
statement entirely.

Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@mrunalp mrunalp merged commit c8653a2 into opencontainers:master Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants