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: Command "git rev-parse --show-toplevel" failed with code ENOENT" in watch mode #2430

Closed
eysi09 opened this issue Jun 8, 2021 · 7 comments · Fixed by #2503 or #2508
Closed
Assignees
Labels

Comments

@eysi09
Copy link
Collaborator

eysi09 commented Jun 8, 2021

Bug

Current Behavior

I see this error every time I run npm install while in watch mode:

(node:51854) UnhandledPromiseRejectionWarning: Error: Command "git rev-parse --show-toplevel" failed with code ENOENT:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:470:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:51854) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 70)
(node:51854) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Reproducible example

Run Garden in watch mode in some demo project and run, say, npm install is-odd.

Workaround

None that I know of.

@eysi09 eysi09 added the bug label Jun 8, 2021
@danhawkins
Copy link

danhawkins commented Jul 20, 2021

This is also happening to me, only on one of my projects, the other one is working fine. Also this project was working ok before, not sure what changed, for me this is just happening whenever I try to run a garden command

garden dev

Good afternoon! Let's get your environment wired up...


🌻  Garden dashboard running at http://localhost:9777
Command "git rev-parse --show-toplevel" failed with code ENOENT:

See error.log for detailed error message
project λ git feature/ch4740/add-garden-for-kafka → 

@eysi09
Copy link
Collaborator Author

eysi09 commented Jul 22, 2021

Interesting, we haven't seen that before. Usually it only happens on npm install or similar while the watch command is running. Essentially something changes in the file system while Garden is running a git command internally.

Is there a local task or similar in your Garden config that might mess with the file system while Garden is starting up?

@edvald
Copy link
Collaborator

edvald commented Jul 22, 2021

I think we're mainly missing some error handling in our git handler. We should handle these types of things gracefully.

@danhawkins
Copy link

Interesting, we haven't seen that before. Usually it only happens on npm install or similar while the watch command is running. Essentially something changes in the file system while Garden is running a git command internally.

Is there a local task or similar in your Garden config that might mess with the file system while Garden is starting up?

I don't think so

@danhawkins
Copy link

danhawkins commented Jul 24, 2021

I also just tried garden validate

Screenshot 2021-07-24 at 23 34 08

also same from garden deploy

@danhawkins
Copy link

OK in my case it was my bad, I had a submodule listed in gitmodules that I was not using

edvald added a commit that referenced this issue Jul 26, 2021
Fixes #2430

Also adds more specific and helpful error messages when we encounter
missing/invalid submodule paths.
@hqm42
Copy link

hqm42 commented Aug 5, 2021

This also occures when you move or rename the folder of a linked module. Adjusting the module path in .garden/local-config.yml fixed it for me.

edvald added a commit that referenced this issue Aug 11, 2021
Fixes #2430

Also adds more specific and helpful error messages when we encounter
missing/invalid submodule paths.
dmytri pushed a commit to dmytri/garden that referenced this issue Aug 19, 2021
Fixes garden-io#2430

Also adds more specific and helpful error messages when we encounter
missing/invalid submodule paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants