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

[turborepo] turbo prune exit code: 101 #3355

Closed
digoburigo opened this issue Jan 18, 2023 · 10 comments
Closed

[turborepo] turbo prune exit code: 101 #3355

digoburigo opened this issue Jan 18, 2023 · 10 comments
Labels
area: prune turbo prune kind: bug Something isn't working owned-by: turborepo

Comments

@digoburigo
Copy link

What version of Turborepo are you using?

1.7.0

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

pnpm

What operating system are you using?

Mac

Describe the Bug

Suddenly the step in Dockerfile that envolves turborepo RUN turbo prune --scope=web --docker, started to output this error:

ERROR [builder 8/8] RUN turbo prune --scope=web --docker                                     0.3s
------
 > [builder 8/8] RUN turbo prune --scope=web --docker:
#0 0.309 thread 'main' panicked at 'Failed to execute turbo.: Os { code: 8, kind: Uncategorized, message: "Exec format error" }', crates/turborepo-lib/src/shim.rs:377:14
#0 0.309 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------
failed to solve: executor failed running [/bin/sh -c turbo prune --scope=web --docker]: exit code: 101

Expected Behavior

Build normally

To Reproduce

I don't know how to reproduce because it's random. I don't change anything in the code. The only thing I made was keeping building de Dockerfile with docker compose (I don't know if it's related). Can someone help?

Reproduction Repo

No response

@digoburigo digoburigo added area: turborepo kind: bug Something isn't working labels Jan 18, 2023
@prabhjotsinghchadha
Copy link

I am getting exact same error.
I am using 1.7.0 version of turbo
Package Manager = NPM
OS = Mac
Bug is same as you have mentioned above

@digoburigo
Copy link
Author

I resolved this issue for me by checking if my .dockerignore it's in the root folder containing the right files to ignore.
I will leave this issue open for now for more dicussion.

@prabhjotsinghchadha
Copy link

I resolved this issue for me by checking if my .dockerignore it's in the root folder containing the right files to ignore. I will leave this issue open for now for more dicussion.

Can you please tell me which file you added in .dockerignore? If it's common then I will also try it on my system.

@digoburigo
Copy link
Author

digoburigo commented Jan 18, 2023

In my case I have a monorepo using pnpm workspaces

(NOTE: if you use pnpm wokspaces check if all apps and packages are declared in pnpm-workspace.yaml)

On root folder of project .dockerignore, with the following content

node_modules/
.vercel
.next
.env.local
.env.production
.env.dev
.env.*

dev.Dockerfile
prod.Dockerfile
Dockerfile
README.md
node_modules
npm-debug.log

@prabhjotsinghchadha
Copy link

No, It didn't work. I am also using turborepo with npm, and added the necessary files to .dockerignore.

@untungso
Copy link

I have the same setup, with 1.7.0 and NPM still no luck

@arugurjar
Copy link

This solution might help: #2198

@ridafkih
Copy link

ridafkih commented Jan 21, 2023

@digoburigo This solved it for me, and I think the critical piece here is the exclusion of node_modules. For those with nested node_modules folder, make sure to add **/node_modules to the list.

Exec format error is likely originating from the dependencies being built for another architecture than is being provided. If for some reason your node_modules is being pulled over from your host machine and trying to be run there, it'll cause this issue.

@prabhjotsinghchadha
Copy link

I have the same setup, with 1.7.0 and NPM still no luck

I am able to run after downgrading docker in dockerfile
"RUN npm -g install turbo@1.6.3"

@chris-olszewski
Copy link
Member

Closing as this is issues are probably related to copying node_modules into the Docker container which can result in the wrong turbo binary being installed for the OS/arch. See this esbuild doc page for a good explanation of why this causes failures for those using npm or pnpm.

If you encounter this, please verify that you aren't copying node_modules from the host and open a new issue. If you can provide a reproduction it will be beneficial as it is very likely an issue with your specific configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: prune turbo prune kind: bug Something isn't working owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

9 participants