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

with-docker build failure yarn install #2309

Closed
kylehassett opened this issue Oct 24, 2022 · 6 comments · Fixed by #2335
Closed

with-docker build failure yarn install #2309

kylehassett opened this issue Oct 24, 2022 · 6 comments · Fixed by #2335

Comments

@kylehassett
Copy link

kylehassett commented Oct 24, 2022

What version of Turborepo are you using?

latest as of Oct 23rd 10:09 pm est

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac (M1 max)

Describe the Bug

  • Trying to use turborepo to deploy to google cloud run
  • Using turborepo/examples/with-docker as starting point
  • cd to with-docker root
  • Run the following build command: docker build --progress=plain -t test-turbo-cloud-run-api -f apps/api/Dockerfile .
    • Same failure occurs when following the steps in with-dockers README to the letter.
  • Docker build fails at RUN yarn install with this error...
#21 19.79 [5/5] Building fresh packages...
#21 20.29 error /app/node_modules/turbo: Command failed.
#21 20.29 Exit code: 1
#21 20.29 Command: node install.js
#21 20.29 Arguments:
#21 20.29 Directory: /app/node_modules/turbo
#21 20.29 Output:
#21 20.29 node:internal/errors:863
#21 20.29   const err = new Error(message);
#21 20.29               ^
#21 20.29
#21 20.29 Error: Command failed: node /app/node_modules/turbo/bin/turbo --version
#21 20.29 /app/node_modules/turbo/bin/turbo:13
#21 20.29     throw e;
#21 20.29     ^
#21 20.29
#21 20.29 <ref *1> Error: spawnSync /app/node_modules/turbo-linux-arm64/bin/turbo ENOENT
#21 20.29     at Object.spawnSync (node:internal/child_process:1117:20)
#21 20.29     at spawnSync (node:child_process:857:24)
#21 20.29     at Object.execFileSync (node:child_process:900:15)
#21 20.29     at Object.<anonymous> (/app/node_modules/turbo/bin/turbo:6:28)
#21 20.29     at Module._compile (node:internal/modules/cjs/loader:1159:14)
#21 20.29     at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
#21 20.29     at Module.load (node:internal/modules/cjs/loader:1037:32)
#21 20.29     at Module._load (node:internal/modules/cjs/loader:878:12)
#21 20.29     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:82:12)
#21 20.29     at node:internal/main/run_main_module:23:47 {
#21 20.29   errno: -2,
#21 20.29   code: 'ENOENT',
#21 20.29   syscall: 'spawnSync /app/node_modules/turbo-linux-arm64/bin/turbo',
#21 20.29   path: '/app/node_modules/turbo-linux-arm64/bin/turbo',
#21 20.29   spawnargs: [ '--version' ],
#21 20.29   error: [Circular *1],
#21 20.29   status: null,
#21 20.29   signal: null,
#21 20.29   output: null,
#21 20.29   pid: 67,
#21 20.29   stdout: null,
#21 20.29   stderr: null
#21 20.29 }
#21 20.29
#21 20.29 Node.js v19.0.0
#21 20.29
#21 20.29     at checkExecSyncError (node:child_process:871:11)
#21 20.29     at Object.execFileSync (node:child_process:907:15)
#21 20.29     at validateBinaryVersion (/app/node_modules/turbo/install.js:25:6)
#21 20.29     at /app/node_modules/turbo/install.js:305:5 {
#21 20.29   status: 1,
#21 20.29   signal: null,
#21 20.29   output: [
#21 20.29     null,
#21 20.29     Buffer(0) [Uint8Array] [],
#21 20.29     Buffer(1089) [Uint8Array] [
#21 20.29        47,  97, 112, 112,  47, 110, 111, 100, 101,  95, 109, 111,
#21 20.29       100, 117, 108, 101, 115,  47, 116, 117, 114,  98, 111,  47,
#21 20.29        98, 105, 110,  47, 116, 117, 114,  98, 111,  58,  49,  51,
#21 20.29        10,  32,  32,  32,  32, 116, 104, 114, 111, 119,  32, 101,
#21 20.29        59,  10,  32,  32,  32,  32,  94,  10,  10,  60, 114, 101,
#21 20.29       102,  32,  42,  49,  62,  32,  69, 114, 114, 111, 114,  58,
#21 20.29        32, 115, 112,  97, 119, 110,  83, 121, 110,  99,  32,  47,
#21 20.29        97, 112, 112,  47, 110, 111, 100, 101,  95, 109, 111, 100,
#21 20.29       117, 108, 101, 115,
#21 20.29       ... 989 more items
#21 20.29     ]
#21 20.29   ],
#21 20.29   pid: 49,
#21 20.29   stdout: Buffer(0) [Uint8Array] [],
#21 20.29   stderr: Buffer(1089) [Uint8Array] [
#21 20.29      47,  97, 112, 112,  47, 110, 111, 100, 101,  95, 109, 111,
#21 20.29     100, 117, 108, 101, 115,  47, 116, 117, 114,  98, 111,  47,
#21 20.29      98, 105, 110,  47, 116, 117, 114,  98, 111,  58,  49,  51,
#21 20.29      10,  32,  32,  32,  32, 116, 104, 114, 111, 119,  32, 101,
#21 20.29      59,  10,  32,  32,  32,  32,  94,  10,  10,  60, 114, 101,
#21 20.29     102,  32,  42,  49,  62,  32,  69, 114, 114, 111, 114,  58,
#21 20.29      32, 115, 112,  97, 119, 110,  83, 121, 110,  99,  32,  47,
#21 20.29      97, 112, 112,  47, 110, 111, 100, 101,  95, 109, 111, 100,
#21 20.29     117, 108, 101, 115,
#21 20.29     ... 989 more items
#21 20.29   ]
#21 20.29 }
#21 20.29
#21 20.29 Node.js v19.0.0
#21 20.29 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
#21 ERROR: executor failed running [/bin/sh -c yarn install]: exit code: 1
------
 > [installer  7/10] RUN yarn install:
------
executor failed running [/bin/sh -c yarn install]: exit code: 1

Expected Behavior

Docker container builds successfully, I can deploy to docker hub, then deploy to google cloud run.

To Reproduce

See the description, it contains repro steps.

@rafaeltab
Copy link
Contributor

Take a look at this comment, and my comment afterward.
#2293 (comment)

It seems that the fix was applied incorrectly to the with-docker example (the installer stage doesn't have this fix but the builder step does). If this isn't fixed by the end of the day I'll make a PR for it.

@rmlevangelio
Copy link

@rafaeltab Should we wait for the fix or we should use your approach?

@weyert
Copy link
Contributor

weyert commented Oct 24, 2022

@rmlevangelio You should be able to add RUN apk add --no-cache libc6-compat

@rafaeltab
Copy link
Contributor

They will be almost the same, if you do it yourself just call the command at the installer stage. If you're unsure if you will be able to, you can always wait.

@rmlevangelio
Copy link

Alright thanks @weyert and @rafaeltab 👍

@kylehassett
Copy link
Author

Added RUN apk add --no-cache libc6-compat for installer and it worked!

Thanks for the quick response to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants