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

Error "stty: 'standard input': Inappropriate ioctl for device" encountered in v3.20.2. #70

Closed
mochiya-hemmi opened this issue Oct 5, 2023 · 5 comments · Fixed by #73
Assignees
Labels
bug Something isn't working

Comments

@mochiya-hemmi
Copy link

I am using an interactive shell in the Build Steps and Events below.

  • build_as_root
  • run_as_root
  • post-start
  • pre-destroy

In Lando up to v3.18.0, read and stty commands were executed without problems.
However, after upgrading to v3.20.2, the read command no longer works, and the following error occurs when executing the stty command.

stty: 'standard input': Inappropriate ioctl for device

Could you please fix this or provide an option to allow an interactive shell that can be configured in the .lando.yml file?

I would like to express my sincere respect to the development team.
Thank you so much.

@mochiya-hemmi mochiya-hemmi added the bug Something isn't working label Oct 5, 2023
@pirog
Copy link
Member

pirog commented Oct 5, 2023

@mochiya-hemmi can you provide your landofile so we can attempt to debug?

@mochiya-hemmi
Copy link
Author

mochiya-hemmi commented Oct 5, 2023

@pirog
Thank you for your reply.
Below are the landofile and dependent shell scripts related to this issue.

./.lando.yml

name: drupal10
recipe: drupal10
config:
  php: 8.2
  via: apache:2.4
  webroot: web
  drush: false
  database: mysql:8.0
  xdebug: false
services:
  appserver:
    ssl: true
    build_as_root:
      - bash /app/.lando-scripts/build_as_root.bash
    run_as_root:
      - bash /app/.lando-scripts/run_as_root.bash
events:
  post-start:
    - bash /app/.lando-scripts/post-start.bash
  pre-destroy:
    - bash /app/.lando-scripts/pre-destroy.bash

./.lando-scripts/build_as_root.bash

#!/bin/bash
stty -ixon
if [[ ! -d "$LANDO_WEBROOT" ]]; then
    install -o www-data -g www-data -m 0777 -d "$LANDO_WEBROOT"
fi
read -p ' Do you want to update apt? (yes/no) [yes]: '
case "$REPLY" in
'' | yes)
    apt update --yes
    apt upgrade --yes
    apt dist-upgrade --yes
    apt full-upgrade --yes
    apt clean --yes
    apt autoremove --yes
    apt autoclean --yes
    ;;
esac

./.lando-scripts/run_as_root.bash

#!/bin/bash
stty -ixon
read -p ' Do you want to update composer? (yes/no) [yes]: '
case "$REPLY" in
'' | yes) composer self-update ;;
esac

./.lando-scripts/post-start.bash

#!/bin/bash
stty -ixon
if [[ ! -f /app/composer.json ]]; then
    read -p ' Do you want to do a clean install of Drupal? (yes/no) [yes]: '
    case "$REPLY" in
    '' | yes) composer create drupal/recommended-project /tmp/drupal10 &&
        rsync -ahr /tmp/drupal10/ . &&
        rm -fr /tmp/drupal10 ;;
    esac
fi
if [[ ! -f /app/vendor/drush/drush/drush ]]; then
    read -p ' Do you want to do a install of Drush? (yes/no) [yes]: '
    case "$REPLY" in
    '' | yes) composer require drush/drush ;;
    esac
fi

./.lando-scripts/pre-destroy.bash

#!/bin/bash
stty -ixon
while :; do
    read -p ' Destructive processing is performed. This process cannot be undone.
 Are you sure you want to run it? (DESTROY): '
    case "$REPLY" in
    DESTROY) exit ;;
    esac
done

@pirog pirog self-assigned this Oct 6, 2023
@pirog
Copy link
Member

pirog commented Oct 6, 2023

@mochiya-hemmi i can replicate this and can also confirm that its something Lando is doing. will try to get a fix in for the next release.

FWIW in Lando 4 i think most build steps will be run as part of a Dockerfile image build eg they will be non-interactive by default. However there will still be various places for interactivity and the kind of things you are doing above.

pirog added a commit that referenced this issue Oct 6, 2023
@pirog pirog linked a pull request Oct 6, 2023 that will close this issue
pirog added a commit that referenced this issue Oct 6, 2023
pirog added a commit that referenced this issue Oct 6, 2023
pirog added a commit that referenced this issue Oct 6, 2023
@pirog
Copy link
Member

pirog commented Oct 6, 2023

more info here and probably why this one slipped through the cracks. it does not seem like this scenario is possible to test on GHA actions/runner#241

not the end of the world but it would be great!

pirog added a commit that referenced this issue Oct 6, 2023
@pirog pirog closed this as completed in #73 Oct 6, 2023
pirog added a commit that referenced this issue Oct 6, 2023
…nts when using dc2

* #70: add breaking test conditions

* #70: add breaking test conditions part 2

* #70: add breaking test conditions part 3

* #70: add breaking test conditions part 4

* #70: make sure dc2 is properly allocatted tty

* #70: make sure dc2 is properly allocatted tty part 2

* #70: changelog
@mochiya-hemmi
Copy link
Author

@pirog
Wow! You're the best!
I was updated Lando to v3.20.4 and was able to confirm that it works properly.
AMAZING!

pirog added a commit that referenced this issue Oct 10, 2024
…nts when using dc2

* #70: add breaking test conditions

* #70: add breaking test conditions part 2

* #70: add breaking test conditions part 3

* #70: add breaking test conditions part 4

* #70: make sure dc2 is properly allocatted tty

* #70: make sure dc2 is properly allocatted tty part 2

* #70: changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants