eas build issue on Gitlab CI - Error: Input is required, but stdin is not readable.

Hi there.

We are using the instructions lifted straight from here: Triggering builds from CI - Expo Documentation

eas-build:
  stage: build
  script:
    - npx eas-cli build --platform all --non-interactive --no-wait
  environment:
    name: build
    url: https://expo.io/accounts/xxx/projects/xxx/builds
  only: 
    - master

We are adding bash in a before_script section:

before_script:
  - apk add --no-cache git bash

We are getting this error:

$ npx eas-cli build --platform all --non-interactive --no-wait
    Error: Input is required, but stdin is not readable.

Our build process was working fine previously, but the recent changes to eas-cli (removing the cli options) caused us to rework our process, which is when we started running into this issue.

Any ideas? Running this command directly in a Mac terminal or Windows powershell works fine, so I’m guessing something with the shell, but it’s a little out of my domain.

Hey,
that’s interesting. Sorry for the issue.
You said it was working fine previously. Do you know what versions you were using then and now?
I think we haven’t removed any CLI params for eas build. Can you please elaborate? The only thing we did was to get rid of the CLI params for eas submit, see Release v0.26.0 · expo/eas-cli · GitHub

Yeah, it was a bit strange. We first had issues with eas submit and that’s when we realized we needed to update that for the eas-cli changes. We didn’t touch the eas build job, but while trying to fix the eas submit job, eas build broke. This is the full output for the gitlab job:

Running with gitlab-runner 14.2.0-rc1 (0ac3a46e)
  on docker-auto-scale z3WU8uu-
Resolving secrets
00:00
Preparing the "docker+machine" executor
00:10
Using Docker executor with image node:lts-alpine ...
Pulling docker image node:lts-alpine ...
Using docker image sha256:1d909dafa77f084d299459b7f17600950dd2484dca3c99dba815c987f48c31fe for node:lts-alpine with digest node@sha256:8c94a0291133e16b92be5c667e0bc35930940dfa7be544fb142e25f8e4510a45 ...
Preparing environment
00:01
Running on runner-z3wu8uu--project-21161726-concurrent-0 via runner-z3wu8uu--srm-1631848232-dd7ffc1f...
Getting source from Git repository
00:03
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/xxx/xxx/xxx/.git/
Created fresh repository.
Checking out e2d3df20 as master...
Skipping Git submodules setup
Restoring cache
00:01
Checking cache for master...
Downloading cache.zip from xxx 
Successfully extracted cache
Downloading artifacts
00:01
Downloading artifacts for jest (1598408596)...
Downloading artifacts from coordinator... ok        id=1598408596 responseStatus=200 OK token=hxNXuByA
Executing "step_script" stage of the job script
03:28
Using docker image sha256:1d909dafa77f084d299459b7f17600950dd2484dca3c99dba815c987f48c31fe for node:lts-alpine with digest node@sha256:8c94a0291133e16b92be5c667e0bc35930940dfa7be544fb142e25f8e4510a45 ...
$ apk add --no-cache git bash
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/10) Installing ncurses-terminfo-base (6.1_p20200118-r4)
(2/10) Installing ncurses-libs (6.1_p20200118-r4)
(3/10) Installing readline (8.0.1-r0)
(4/10) Installing bash (5.0.11-r1)
Executing bash-5.0.11-r1.post-install
(5/10) Installing ca-certificates (20191127-r2)
(6/10) Installing nghttp2-libs (1.40.0-r1)
(7/10) Installing libcurl (7.79.0-r0)
(8/10) Installing expat (2.2.9-r1)
(9/10) Installing pcre2 (10.34-r1)
(10/10) Installing git (2.24.4-r0)
Executing busybox-1.31.1-r10.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 26 MiB in 26 packages
$ yarn install --frozen-lockfile
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.14.5" has incorrect peer dependency "@babel/core@^7.13.0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-class-static-block@7.14.5" has incorrect peer dependency "@babel/core@^7.12.0".
warning " > react-native-gifted-chat@0.16.3" has unmet peer dependency "dayjs@*".
warning "sentry-expo > expo-application@2.4.1" has unmet peer dependency "@unimodules/core@*".
warning " > eslint-config-airbnb@18.2.1" has incorrect peer dependency "eslint-plugin-import@^2.22.1".
warning " > eslint-config-airbnb@18.2.1" has incorrect peer dependency "eslint-plugin-jsx-a11y@^6.4.1".
warning " > eslint-config-airbnb@18.2.1" has incorrect peer dependency "eslint-plugin-react@^7.21.5".
warning "eslint-config-airbnb > eslint-config-airbnb-base@14.2.1" has incorrect peer dependency "eslint-plugin-import@^2.22.1".
warning "flow-typed > @octokit/rest > @octokit/plugin-request-log@1.0.4" has unmet peer dependency "@octokit/core@>=3".
warning " > react-test-renderer@17.0.2" has incorrect peer dependency "react@17.0.2".
[4/4] Building fresh packages...
Done in 97.39s.
$ yarn global add expo-cli
yarn global v1.22.5
[1/4] Resolving packages...
warning expo-cli > @expo/dev-tools > graphql-tools@3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
warning expo-cli > @expo/dev-tools > graphql-tools > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > analytics-node > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > @expo/rudder-sdk-node > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > raven > uuid@3.0.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning expo-cli > xdl > webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > webpack-dev-server > webpack-log > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > pacote > @npmcli/run-script > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning expo-cli > pacote > @npmcli/run-script > node-gyp > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning expo-cli > xdl > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning expo-cli > xdl > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning expo-cli > xdl > webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning expo-cli > react-dev-utils > fork-ts-checker-webpack-plugin > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning expo-cli > react-dev-utils > fork-ts-checker-webpack-plugin > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning expo-cli > pacote > @npmcli/run-script > node-gyp > request > har-validator@5.1.5: this library is no longer supported
[2/4] Fetching packages...
warning mini-css-extract-plugin@0.5.0: Invalid bin field for "mini-css-extract-plugin".
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > xdl > @expo/dev-server > @expo/metro-config > metro-react-native-babel-transformer@0.59.0" has unmet peer dependency "@babel/core@*".
[4/4] Building fresh packages...
success Installed "expo-cli@4.11.0" with binaries:
      - expo
      - expo-cli
Done in 48.11s.
$ expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD
[03:14:02] 
Success. You are now logged in as xxx.
$ npx eas-cli build --platform all --non-interactive --no-wait
    Error: Input is required, but stdin is not readable.
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1

Originally the npx command that executes eas-cli was just eas build but since the docs were updated to just use npx instead of installing eas-cli we decided to modify our stuff to match.

My local Windows machine is on eas-cli/0.27.1 win32-x64 node-v14.16.0. The gitlab runs npx, so I would assume it’s on the same, but the Linux flavor. Previously, I believe we were on 0.24.1 or 0.25, but I’m not sure. Our first gitlab eas submit broke on Sep 8, 2021 2:46pm CDT and since our gitlab ci/cd stuff was doing yarn global add eas-cli at the time, I would assume we were on the last release before the cli options for submit were removed.

I’m guessing here but I think it has to do with the fact that you are now executing eas-cli via npx. I’m not 100% sure but it might be sandboxed. What’s going on here is that you’re logging in with expo and npx eas-cli can access your session secret. Error: Input is required, but stdin is not readable. probably comes from the login prompt.

Generally, you don’t need to install expo-cli and login to your Expo account with it. Generate an EXPO_TOKEN (see Triggering builds from CI - Expo Documentation) and run the build like this:
EXPO_TOKEN=blahblah npx eas-cli build --platform all --non-interactive --no-wait (or even better, set the env var in your CI).

I also agree that the error message is not helpful at all. We’ll try to fix it soon.

2 Likes

If using token won’t help try running build locally, with the interactive shell you should get a better error message or some prompt will show up instead