Github: Unable to push: cannot run undefined: No such file or directory

Created on 13 Oct 2017  ·  15Comments  ·  Source: atom/github

Prerequisites

  • Have you tried to reproduce the problem in Safe Mode?
    yes
  • Have you followed all applicable steps in the debugging guide?
    yes
  • Have you checked the FAQs on the message board for common solutions?
    yes
  • Have you checked that your issue isn't already filed?
    Kind of, there are multiple bug reports about Unable to push, but with different underlying reason.

Description

I'm trying to push to a repository using the status bar widget.

Steps to Reproduce

At least for me:

  1. Open a repo in Atom.
  2. Commit something (that works fine)
  3. Using the widget to push the changes:

screen shot 2017-10-13 at 17 28 03

It also does not work if their are not remote changes.

Expected behavior:

Pushing to the repository.

Actual behavior:

After enabling git diagnostics:

git-shell-out-strategy.js:246 git:git push origin fix/ics-sync in /Users/despairblue/git/wunderflats/api
git-shell-out-strategy.js:247 exit status 128
git-shell-out-strategy.js:248 stdout
git-shell-out-strategy.js:249 
git-shell-out-strategy.js:250 stderr
git-shell-out-strategy.js:251 17:21:25.499400 git.c:340               trace: built-in: git 'push' 'origin' 'fix/ics-sync'
17:21:25.534918 run-command.c:626       trace: run_command: 'undefined' '[email protected]' 'git-receive-pack '\''wunderflats/wunderflats-api.git'\'''
fatal: cannot run undefined: No such file or directory
fatal: unable to fork

git-shell-out-strategy.js:246 git:git status --porcelain=v2 --branch --untracked-files=all --ignore-submodules=dirty -z in /Users/despairblue/git/wunderflats/api
git-shell-out-strategy.js:247 exit status 0
git-shell-out-strategy.js:248 stdout
git-shell-out-strategy.js:249 # branch.oid da7022c8669098944c2808cf3bc7a36513c3f342# branch.head fix/ics-sync# branch.upstream origin/fix/ics-sync# branch.ab +1 -11 .M N... 100644 100644 100644 a2d2789dfc48983fa96ccbd60106986e9e3760ba a2d2789dfc48983fa96ccbd60106986e9e3760ba src/listings/lib.js1 .M N... 100644 100644 100644 aa263cc36b62f535e64ef05a7aa6c2a7583e3e62 aa263cc36b62f535e64ef05a7aa6c2a7583e3e62 src/utils/joi-extensions/joi-dates.js1 .M N... 100644 100644 100644 f4939b09e57bd782c43debca73d74a937916701a f4939b09e57bd782c43debca73d74a937916701a test/helpers/response.js1 .M N... 100644 100644 100644 804814122ecfeb5b8efab979acf725ae4c06cfc9 804814122ecfeb5b8efab979acf725ae4c06cfc9 test/http/blocks/create.js
git-shell-out-strategy.js:250 stderr
git-shell-out-strategy.js:251 17:21:25.586020 git.c:340               trace: built-in: git 'status' '--porcelain=v2' '--branch' '--untracked-files=all' '--ignore-submodules=dirty' '-z'

Reproduces how often:

100%

Versions

Atom    : 1.21.0
Electron: 1.6.9
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm  1.18.5
npm  3.10.10
node 6.9.5 x64
python 2.7.10
git 2.11.0

Mac OS X 10.12.6 (16G29)

Most helpful comment

I'm not sure if this issue stems from the same problem, but I'm getting similar behaviour?

Unable to push
error: cannot spawn undefined: No such file or directory
fatal: unable to fork

All 15 comments

Thanks for the report! Just to confirm, you have no problem pushing on the command line for that repository? Also, the problem is the same for you no matter what repository you use?

And lastly, if you've used previous versions of Atom and the GitHub package, did you always have this problem or did it just happen for you with 1.21.0?

@rsese Pushing from the terminal works. This happens with every repository, just tried a couple hosted on bitbucket and github.

Ah I found the culprit, it only happens when starting atom in dev mode, even when there are no dev packages loaded. Issuingatom-beta --dev breaks this.

I'm running Atom in dev mode because I patched the command palette to mitigate performance issues I have: https://github.com/atom/command-palette/pull/90 https://github.com/atom/command-palette/pull/81

I guess I just install the patched version as a regular package and disable the one that is shipped.

Not sure if this still is a bug though, is there a reason the github package should not work in dev mode?

@despairblue What is the full output of the apm links command?

/Users/despairblue/.atom/dev/packages (1)
└── command-palette -> /Users/despairblue/github/command-palette
/Users/despairblue/.atom/packages (0)
└── (no links)

@despairblue And if you unlink command-palette it still doesn't work in dev mode? Do you have a local clone of the Atom repository on your computer? When was the last time you pulled and built that? Running in dev mode also loads resources from the local clone of your Atom repository.

@Ben3eeE just unlinked:

/Users/despairblue/.atom/dev/packages (0)
└── (no links)
/Users/despairblue/.atom/packages (0)
└── (no links)

I still get the same error when starting in dev mode, and it just works if I don't start it in dev mode. I don't have a local copy of atom's repository. 😕

I have the same issue here on a gitlab repository on push, fetch or pull on Windows

I can do it in command line

13:25:02.442071 git.c:344 trace: built-in: git 'push' 'origin' 'master'
13:25:02.444076 run-command.c:626 trace: run_command: 'undefined' '[email protected]' 'git-receive-pack '\''jbdamianoWork/UsimTest.git'\'''
error: cannot spawn undefined: No such file or directory
fatal: unable to fork

I can do it with command line

BTW I installed an old version 1.20.1 and the git push is working correctly

I am not using dev mode and having the same issue on push. Pushing from terminal works fine.

Unable to push
fatal: cannot run send-pack: No such file or directory
error: failed to push some refs to 'https://github.com/razvan-panda/nixpkgs.git'

I'm not sure if this issue stems from the same problem, but I'm getting similar behaviour?

Unable to push
error: cannot spawn undefined: No such file or directory
fatal: unable to fork

I've seen this problem happening only for SSH access.
If I do git clone https://github.com/gliviu/dir-compare.git atom works properly when push/pull.
If I clone with ssh git clone [email protected]:gliviu/dir-compare.git the problem starts manifesting:

Uncaught (in promise) GitError: git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false pull origin master in C:\Users\...\git2\dir-compare exited with code 1
stdout: 
stderr: error: cannot spawn undefined: No such file or directory
fatal: unable to fork

    at new GitError (C:\Users\...\AppData\Local\atom\app-1.25.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:72:18)
    at C:\Users\...\AppData\Local\atom\app-1.25.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:336:27
    at Generator.next (<anonymous>)
    at step (C:\Users\...\AppData\Local\atom\app-1.25.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:60:191)
    at C:\Users\...\AppData\Local\atom\app-1.25.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:60:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:109:7)

I tried running git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false pull origin master from command line and it works.
As suggested in #1199 I have no home/.git/hooks or home/.gitconfig.
Also sh.exe is in %PATH%.
Running atom 1.25.0 on windows 10 x64

No longer able to reproduce in atom 1.26.0

Having the same issue for SSH cloned repo access. While I am able to fetch, pull, push from command prompt (using Git-Cmd and Git-Bash), I get the same error in Atom:

git-shell-out-strategy.js:265 git:git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false fetch origin master in D:\Users\redacted\Documents\redactedreponame
git-shell-out-strategy.js:266 exit status 128
git-shell-out-strategy.js:267 stdout
git-shell-out-strategy.js:268 
git-shell-out-strategy.js:269 stderr
git-shell-out-strategy.js:270 14:19:30.284810 git.c:344               trace: built-in: git fetch origin master
14:19:30.287810 run-command.c:640       trace: run_command: undefined -G [email protected]
14:19:30.290811 run-command.c:640       trace: run_command: unset GIT_CONFIG_PARAMETERS GIT_PREFIX; undefined [email protected] 'git-upload-pack '\''redacted/redactedreponame.git'\'''
error: cannot spawn undefined: No such file or directory
error: cannot spawn undefined: No such file or directory
fatal: unable to fork

internal/process/next_tick.js:109 Uncaught (in promise) GitError: git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false fetch origin master in D:\Users\redacted\Documents\redactedreponame exited with code 128
stdout: 
stderr: 14:19:30.284810 git.c:344               trace: built-in: git fetch origin master
14:19:30.287810 run-command.c:640       trace: run_command: undefined -G [email protected]
14:19:30.290811 run-command.c:640       trace: run_command: unset GIT_CONFIG_PARAMETERS GIT_PREFIX; undefined [email protected] 'git-upload-pack '\''redacted/redactedreponame.git'\'''
error: cannot spawn undefined: No such file or directory
error: cannot spawn undefined: No such file or directory
fatal: unable to fork

    at new GitError (D:\Users\redacted\AppData\Local\atom\app-1.27.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:75:18)
    at D:\Users\redacted\AppData\Local\atom\app-1.27.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:343:27
    at Generator.next (<anonymous>)
    at step (D:\Users\redacted\AppData\Local\atom\app-1.27.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:64:191)
    at D:\Users\redacted\AppData\Local\atom\app-1.27.0\resources\app.asar\node_modules\github\lib\git-shell-out-strategy.js:64:361
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:109:7)
GitError @ git-shell-out-strategy.js:30
(anonymous) @ git-shell-out-strategy.js:276
step @ git-shell-out-strategy.js:21
(anonymous) @ git-shell-out-strategy.js:21
_tickCallback @ internal/process/next_tick.js:109
git-shell-out-strategy.js:265 git:git -c color.ui=false -c color.status=false -c color.showBranch=false -c color.diff=false -c color.branch=false status --porcelain=v2 --branch --untracked-files=all --ignore-submodules=dirty -z in D:\Users\redacted\Documents\redactedreponame
git-shell-out-strategy.js:266 exit status 0
git-shell-out-strategy.js:267 stdout
git-shell-out-strategy.js:268 # branch.oid 6d8f5f7a5e60c6576af9dd8744f1521ec18bb134# branch.head master# branch.upstream origin/master# branch.ab +0 -01 .M N... 100644 100644 100644 0cf10d621a95af7fe4eed9cbf2c0602190f94a8c 0cf10d621a95af7fe4eed9cbf2c0602190f94a8c .gitignore? private/python-requirements.txt
git-shell-out-strategy.js:269 stderr
git-shell-out-strategy.js:270 14:19:30.352319 git.c:344               trace: built-in: git status --porcelain=v2 --branch --untracked-files=all --ignore-submodules=dirty -z

Using the following versions:

Atom    : 1.27.1
Electron: 1.7.15
Chrome  : 58.0.3029.110
Node    : 7.9.0

Like the previous comments, sh.exe is on the path and no git hooks configured. The SSH key uses the default file name.

Oddly enough, using the git-plus extension does work. I tested disabling the extension and restarting, but still get the same result.

I have the exactly same problem. Should be easy to reproduce. I am using scoop to install git globally, so _scoop install git -g_ would you give an environment for reproducing the problem.

I debugged this issue. Git works with both GIT_SSH and GIT_SSH_COMMAND environment variables. Second form of env. variable can include command line arguments.

Atom uses only _GIT_SSH_COMMAND_ so when Atom loads setting from environment and you are using GIT_SSH (valid setup) it returns _undefined_ and then Atom passes _undefined_ using environment for spawned git command. Git then tries to call _undefined_ instead of ssh.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UziTech picture UziTech  ·  4Comments

RafaelNGP picture RafaelNGP  ·  4Comments

joshaber picture joshaber  ·  4Comments

benogle picture benogle  ·  4Comments

yubaoquan picture yubaoquan  ·  3Comments