Hexo: Problem with deployment on GitHub

Created on 13 Sep 2015  ·  32Comments  ·  Source: hexojs/hexo

Hello!

Please, help someone solve the following problem. Before install Windows 10 I have everything worked fine under Windows 8.1, but now, in Windows 10, I observe the following problem:

  • perform command hexo clean — everything is fine;
  • perform command hexo generate — everything is fine;
  • perform command hexo deploy — I getting in response an error:
D:\Dev\GitHub\201507.github.io-hexo>hexo deploy
INFO  Deploying: git
INFO  Setting up Git deployment...
Initialized empty Git repository in D:/Dev/GitHub/201507.github.io-hexo/.deploy_git/.git/
[master (root-commit) bb9fe04] First commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 placeholder
INFO  Clearing .deploy folder...
INFO  Copying files from public folder...
warning: LF will be replaced by CRLF in 2015/07/30/hello-world/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 2015/07/31/minos-error/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in 2015/08/01/dropbox-file-recovery/index.html.
The file will have its original line endings in your working directory.
...
warning: LF will be replaced by CRLF in webfonts/open-sans/main.css.
The file will have its original line endings in your working directory.
[master bfb9462] Site updated: 2015-09-13 23:02:45
 65 files changed, 13324 insertions(+)
 create mode 100644 2015/07/30/hello-world/index.html
 create mode 100644 2015/07/31/minos-error/index.html
 create mode 100644 2015/08/01/dropbox-file-recovery/index.html
 create mode 100644 2015/08/08/adding-swiftype-search-to-hexo/index.html
 create mode 100644 2015/08/12/kak-bystro-dobavit-udalit-rascladku-claviatury/index.html
 create mode 100644 CNAME
 create mode 100644 about/index.html
 create mode 100644 archives/2015/07/index.html
 create mode 100644 archives/2015/08/index.html
 create mode 100644 archives/2015/index.html
 create mode 100644 archives/index.html
 create mode 100644 atom.xml
...
 create mode 100644 webfonts/source-code-pro/fonts/mrl8jkM18OlOQN8JLgasD9V_2ngZ8dMf8fLgjYEouxg.woff2
 create mode 100644 webfonts/source-code-pro/fonts/mrl8jkM18OlOQN8JLgasDy2Q8seG17bfDXYR_jUsrzg.woff2
 create mode 100644 webfonts/source-code-pro/main.css
warning: LF will be replaced by CRLF in webfonts/source-code-pro/main.css.
The file will have its original line endings in your working directory.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument

    at ChildProcess.<anonymous> (D:\Dev\GitHub\201507.github.io-hexo\node_modules\hexo-util\lib\spawn.js:42:17)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

If I point in the configuration file to use SSH instead of HTTPS, I get this error:

...
The file will have its original line endings in your working directory.
On branch master
nothing to commit, working directory clean
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at ChildProcess.<anonymous> (D:\Dev\GitHub\201507.github.io-hexo\node_modules\hexo-util\lib\spawn.js:42:17)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

The contents of my package.json file:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.1.1"
  },
  "dependencies": {
    "hexo": "^3.1.1",
    "hexo-deployer-git": "0.0.4",
    "hexo-generator-archive": "^0.1.3",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.0.3",
    "hexo-generator-index": "^0.1.3",
    "hexo-generator-sitemap": "^1.0.1",
    "hexo-generator-tag": "^0.1.2",
    "hexo-renderer-ejs": "^0.1.0",
    "hexo-renderer-marked": "^0.2.5",
    "hexo-renderer-stylus": "^0.3.0",
    "hexo-server": "^0.1.2",
    "hexo-util": "^0.1.7"
  }
}

hexo v command output:

hexo: 3.1.1
os: Windows_NT 6.3.9600 win32 x64
http_parser: 2.3
node: 0.12.7
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1p
git --version
git version 2.5.2.windows.2

How to beat this issue? What other information I can provide to solve this problem?

My repo with all config files can be found here: https://github.com/201507/201507.github.io-hexo

Most helpful comment

@doesnta, yes, I solved my problem by starting to use SSH instead HTTPS. The following information has helped to solve a problem:

@younglaker, many thanks for your hint :wink:

All 32 comments

Which shell do you use?

@Xuanwo, when installed Git I chose this option:

git_setup_2014 12 30_01-22-58

I think I met the same problem. I reinstall the system(win 7, 64 bit) and update hexo dependencies.

It's fine to generate. When I deploy:

The file will have its original line endings in your working directory.
On branch master
nothing to commit, working directory clean
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.c om': Invalid argument
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument

Is there any problem with the github username? I am not sure how to correct it . I think I did it right:

$ git config user.name
younglaker

And the error say it is on master branch ? In hexo config I set gh-pages branch. I think here is the only place about github in hexo config :

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/younglaker/blog.git
  branch: gh-pages

My hexo v

$ hexo v
hexo: 3.1.1
os: Windows_NT 6.1.7601 win32 x64
http_parser: 2.3
node: 0.12.6
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1o

dependencies:

"dependencies": {
"hexo": "^3.1.0",
"hexo-deployer-git": "0.0.4",
"hexo-deployer-heroku": "0.0.3",
"hexo-deployer-openshift": "0.0.1",
"hexo-deployer-rsync": "^0.1.1",
"hexo-generator-archive": "^0.1.3",
"hexo-generator-category": "^0.1.3",
"hexo-generator-feed": "^1.0.2",
"hexo-generator-index": "^0.1.3",
"hexo-generator-sitemap": "^1.0.1",
"hexo-generator-tag": "^0.1.2",
"hexo-migrator-rss": "^0.1.2",
"hexo-renderer-ejs": "^0.1.0",
"hexo-renderer-marked": "^0.2.4",
"hexo-renderer-stylus": "^0.2.0",
"hexo-server": "^0.1.2"
}

git:

$ git version
git version 2.5.2.windows.2

@201507
I try SSH instead HTTPS, it works.

If you still have problem with HTTPS, try this command:

ssh -T [email protected]

For more details : http://laker.me/blog/2015/09/18/Git-push常见报错/ .Hope it helps

@younglaker, thanks for your reply. I will check your information and I will answer later.

I have the same problem, and change https to ssh ,it didn't work for me. Did you solve it?@201507

@doesnta, yes, I solved my problem by starting to use SSH instead HTTPS. The following information has helped to solve a problem:

@younglaker, many thanks for your hint :wink:

you say “If I point in the configuration file to use SSH instead of HTTPS, I get this error:” ,how can it work for you finally?I have the problem just like you ,even the wrong message,can you tell how can you fix it? @201507

my sshkey working fine.

@doesnta He even haven't add ssh key.
If you're sure that your ssh key is fine , try to run this command:

ssh -T [email protected]

@younglaker

$ ssh -T [email protected]
Enter passphrase for key '/c/Users/dell/.ssh/id_rsa':
Hi doesnta! You've successfully authenticated, but GitHub does not provide shell access.

but when i deploy the hexo ,it come out the wrong message:

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Do i miss something ?

@younglaker
my _config.xml

deploy:
  type: git
  repo:  [email protected]:/doesnta/doesnta.github.io.git
  branch: master

i also add the remote url in the git/config,useless~~~

[remote "origin"]
    url = [email protected]:doesnta/[email protected]
    fetch = +refs/heads/*:refs/remotes/github/*

@doesnta, here are the steps I performed:

  1. Delete all keys in the folder C:\Users\your-username\.ssh\
  2. Download and install GitHub Desktop
  3. Log in to the GitHub Desktop
  4. The program will generate new SSH keys in C:\Users\your-username\.ssh\ folder (github_rsa.pub, github_rsa)
  5. Copy this keys and give them such names: id_rsa.pub, id_rsa
  6. Run the command ssh -T [email protected] and follow the prompts

If you have difficulty, use the information in these pages:

I hope you can understand my text. I have explained better, but my level of English is poor.

@201507 thanks。

I solve this problem last night.It seem to be the git bug.so i change the git to lower edition.

I meet same problems and try to input this command "ssh -T [email protected]"

it works.

thanks~

201507 the answer that really works! Thank you

@rgodoyl you're welcome! :wink:

I met the same problem with @doesnta.

my git version

$ git version
git version 2.5.0.windows.1

when i run ssh -T [email protected]

Enter passphrase for key '/c/Users/behappy/.ssh/id_rsa':
Hi tsunamidesign! You've successfully authenticated, but GitHub does not provide shell access.

use the 1.9 version of git @tsunamidesign

@doesnta thx a lot.

@doesnta thx use the 1.9 version of git

@doesnta thx a lot. use SSH instead HTTPS

Actually, I met this issue before, and I did try many ways, the best way I know is to use Power Shell instead of Git Bash.

@doesnta Thanks. Mark, I have same problem, use this issue list solved.

So, the latest verison og git can't work fine in on win?

@Xuanwo Still have issue today!!!

I met this issue too.I think this issue is about username of git.So i change git user.name and fixed that.

@201507 thanks>
I solved this issue just now.

meet the issus on git version 2.9.0.windows.1

also meet host key verification failed. Then I push the '.deploy_git' folder , and it success! But 'hexo deploy' still don't work.

@201507
it works!thanks!

In case it still happens to people, the way I work over it is opening Git Bash, cd to your site directory and run hexo generate --deploy there inside Git Bash itself instead of using the Windows command-line. Seems to work consistently over a couple of PCs I use, even if it's less convenient.

I solve the problem by deleting GitHub password in KeyChain Access. Then I execute the deploy command hexo d -g in the terminal after that the terminal will ask me for the github username and password. And just input the new account info then you can do as usual.

Was this page helpful?
0 / 5 - 0 ratings