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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish-gh-pages script fails -- error: git clone failed #2258

Closed
jartuso opened this issue Jan 31, 2020 · 7 comments 路 Fixed by #2307
Closed

Publish-gh-pages script fails -- error: git clone failed #2258

jartuso opened this issue Jan 31, 2020 · 7 comments 路 Fixed by #2307
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers v1 This issue is for Docusaurus 1

Comments

@jartuso
Copy link
Contributor

jartuso commented Jan 31, 2020

馃悰 Bug Report

When trying to publish changes to our github pages hosted site, the npm run publish-gh-pages step fails with the following error code (full output from powershell attached)

generate.js triggered...
feed.js triggered...
feed.js triggered...
sitemap.js triggered...
Site built successfully. Generated files in 'build' folder.
7ce717117293691c87678f7b3cc7fbe015e946de
fatal: Too many arguments.
Error: git clone failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ publish-gh-pages: docusaurus-publish
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ publish-gh-pages script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\artus\AppData\Roaming\npm-cache_logs\2020-01-30T23_49_07_563Z-debug.log

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Windows 10
node (12.14.1)
npm (6.13.4)
yarn (1.21.1)

  1. clone documentation repo locally
  2. make edits in visual studio code
  3. run command: cmd /C "set GIT_USER=[myuser] && set CURRENT_BRANCH=master && npm run publish-gh-pages"
  4. fails :(

Note -- also fails in the same way when using yarn run publish-gh-pages

Expected behavior

My 1st time trying to push changes to our docusaurus site. I expected it to work without any errors.

Actual Behavior

npm run publish-gh-pages failed

Reproducible Demo

Repo that I'm trying to push changes for
https://github.com/OpenBCI/Documentation/tree/master

docusaurus-errortxt.txt

@jartuso jartuso added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jan 31, 2020
@lex111 lex111 added the v1 This issue is for Docusaurus 1 label Jan 31, 2020
@LogicEveryWhere
Copy link

same issue with identical environment

@LogicEveryWhere
Copy link

Temporary solution!!
file website/node_modules/docusaurus/lib/publish-gh-pages.js
line 20: const GIT_USER = process.env.GIT_USER.trim();

just trim git user

@prma85
Copy link

prma85 commented Feb 7, 2020

This is what I have been using in azure and works just fine

git config --global user.email "$(GH_USER)@users.noreply.github.com"
git config --global user.name "$(GH_USER)"
GIT_USER=$(GH_USER) npm run publish-gh-pages

Running it directly from my machine (windows 10) also worked without errors.

I hope it helps :)

@OndrejNepozitek
Copy link
Contributor

The problem is caused by a whiteline that is appended to the GIT_USER env variable on windows 10 when you run the cmd /C "set GIT_USER=<GITHUB_USERNAME> && yarn deploy" command. It can be fixed by running cmd /C "set GIT_USER=<GITHUB_USERNAME>&& yarn deploy" instead (note the missing space between <GITHUB_USERNAME> and &&).

It's quite unfortunate that the command is included in the official docs so probably a lot of windows users will encounter this problem.

@yangshun
Copy link
Contributor

Could you help to submit a PR for Windows? That would be much appreciated!

@turkyden
Copy link

The problem is caused by a whiteline that is appended to the GIT_USER env variable on windows 10 when you run the cmd /C "set GIT_USER=<GITHUB_USERNAME> && yarn deploy" command. It can be fixed by running cmd /C "set GIT_USER=<GITHUB_USERNAME>&& yarn deploy" instead (note the missing space between <GITHUB_USERNAME> and &&).

It's quite unfortunate that the command is included in the official docs so probably a lot of windows users will encounter this problem.

Nice, it work ! Thank you sir.

@AlFalahTaieb
Copy link

I'm having this problem and i'm not even on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers v1 This issue is for Docusaurus 1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants