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

[BUG] hexo server hanging forever when repo contains any invalid symbolic link #124

Open
kuanyui opened this issue Jan 4, 2018 · 9 comments

Comments

@kuanyui
Copy link

kuanyui commented Jan 4, 2018

Environment Info

Node version(node -v): v6.9.1 (in nvm)
OS: Chakra Linux

Your site _config.yml (Optional):

Your theme _config.yml (Optional):

Hexo and Plugin version(npm ls --depth 0):

[email protected] /home/onohiroko/source-blog
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

For question

After hexo server --debug, it stopped at a fixed point, then hang and server still not startup:

./node_modules/hexo-cli/bin/hexo server --debug                                                                                                                                                                (01-04 10:11)
02:11:19.915 DEBUG Hexo version: 3.2.2                                                 
02:11:19.917 DEBUG Working directory: ~/source-blog/                                   
02:11:19.988 DEBUG Config loaded: ~/source-blog/_config.yml                          
02:11:20.101 DEBUG Script loaded: scripts/livedoor-opml2md.js                          
02:11:20.101 DEBUG Script loaded: scripts/toc.js                                      
02:11:20.102 DEBUG Script loaded: themes/taiga/scripts/fancybox.js                        
02:11:20.103 DEBUG Plugin loaded: hexo-cli                                                  
02:11:20.105 DEBUG Plugin loaded: hexo-generator-archive                      
02:11:20.106 DEBUG Plugin loaded: hexo-generator-category                          
02:11:20.144 DEBUG Plugin loaded: hexo-deployer-git                                 
02:11:20.146 DEBUG Plugin loaded: hexo-generator-feed                             
02:11:20.146 DEBUG Plugin loaded: hexo-generator-index                                 
02:11:20.147 DEBUG Plugin loaded: hexo-generator-sitemap                              
02:11:20.149 DEBUG Plugin loaded: hexo-renderer-ejs                                  
02:11:20.230 DEBUG Plugin loaded: hexo-renderer-stylus                                                                                                                                                                                                              
02:11:20.231 DEBUG Plugin loaded: hexo-generator-tag                                                                                                                                                                                                                
02:11:20.235 DEBUG Plugin loaded: hexo-renderer-marked                  
02:11:20.273 DEBUG Plugin loaded: hexo-server                                                                                                                                                                                                                       
02:11:20.280 DEBUG Loading database.                                
02:11:20.451 INFO  Start processing                             
02:11:20.654 DEBUG Processed: _drafts/2017-malaysia-singapore.md      
......... (articles)
02:11:20.721 DEBUG Theme config loaded.                                              
02:11:20.722 DEBUG Processed: _config.yml                                                                                                                                                                                                                           
02:11:20.722 DEBUG Processed: image/banner/03.jpg                                                                                                                                                                                                                   
02:11:20.722 DEBUG Processed: image/banner/02.jpg                       
02:11:20.723 DEBUG Processed: lists/dist/ui-bootstrap-tpls-2.5.0.min.js                                                                                                                                                                                             
02:11:20.723 DEBUG Processed: transcription/Skyrim_Main_Theme.pdf   
......... (files)
02:11:20.854 DEBUG Processed: image/2014/IMG_6379.jpg                                      
02:11:20.854 DEBUG Processed: image/2014/IMG_6382.jpg                                   
02:11:20.860 DEBUG Processed: image/2014/IMG_6386.jpg                                 
02:11:20.897 DEBUG Processed: file/2015/1947_Overture_cover.pdf                      
^C02:14:02.583 INFO  See you again                                                      
02:14:02.633 DEBUG Database saved   

It freezed at 02:11:20.897, so I press ^C to interrupt.

Some possibly usable clues:

  1. Firewall is not running.
  2. I didn't encounter this problem on macOS.
  3. 4000 port is not be occupied by others.
  4. hexo is not installed system globally.
@tomap
Copy link
Contributor

tomap commented Jan 8, 2018

When it "freezed", did you tried to navigate at 127.0.0.1:4000 on your local browser ?

@kuanyui
Copy link
Author

kuanyui commented Jan 8, 2018

Yes, cannot open.

@RupGautam
Copy link

Why do you have node v6.9.x when it should be node v9.x.x ?
See hexojs/hexo#2534

@kuanyui
Copy link
Author

kuanyui commented Jan 14, 2018

  1. I've tried rm -rf node_modules in my hexo repository then reinstall everything via npm install (Also tried to reinstall everything with yarn, but get same issue.)
  2. I've tested this hexo repository could run under node v6.9.1 on my another system (macOS El Captain & High Sierra).
  3. node v9.x.x seems incompatible with hexo 3.2.2, get lots of errors when run.
  4. Surely, I always remember to rm -rf node_modules before changing the version of node via nvm use

@kuanyui
Copy link
Author

kuanyui commented Jan 14, 2018

I just try to use latest node.js LTS v8.9.4 carbon, hexo server still hang.......
screenshot_20180114_220929
Even add --debug to hexo server, nothing else special outputs...

And I don't know why npm ls --depth 0 gives me lots of ERR:

[onohiroko@onohiroko-pc:~/source-blog]$ npm ls --depth 0                                                                                                                                                                                                                        
[email protected] /home/onohiroko/source-blog                       
├── [email protected]                                                    
├── [email protected]                                                 
├── [email protected]                                        
├── [email protected]                                       
├── [email protected]                                      
├── [email protected]                                      
├── [email protected]                                    
├── [email protected]                                               
├── [email protected]                                             
├── [email protected]                                              
├── [email protected]                                       
├── [email protected]                                                                                                                                                                                                                                                                
├── [email protected]
└── [email protected]

npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
[onohiroko@onohiroko-pc:~/source-blog]$ nvm ls                                                                                                                                                                                                                                   (01-14 22:26)
        v0.8.26
         v6.9.1
->       v8.9.4
         v9.3.0
         system
default -> v6.9.1
node -> stable (-> v9.3.0) (default)
stable -> 9.3 (-> v9.3.0) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> v8.9.4)
lts/argon -> v4.8.7 (-> N/A)
lts/boron -> v6.12.3 (-> N/A)
lts/carbon -> v8.9.4
[onohiroko@onohiroko-pc:~/source-blog]$ which hexo                                                                                                                                                                                                                               (01-14 22:33)
/home/onohiroko/source-blog/node_modules/.bin/hexo

@RupGautam
Copy link

Hey @kuanyui , I tired node v. 8.x.x LTS on Arch Linux and I couldn't replicate the issue. I'm assuming it could be your system specific. Also, you sure you have nothing run on port that hexo is using?

Check it using netstat or something similar
$ netstat -na | grep -i LISTEN
$ netstat -f inet -na | grep -i LISTEN

Another check, I'm not sure if you have already done it.

@kuanyui
Copy link
Author

kuanyui commented Feb 10, 2018

screenshot_20180210_204218
F-I-N-A-L-L-L-Y ! I found where the problem is!
See the screenshot, there's a symbolic link (I don't know how on earth it appeared at first), and this symbolic link has invalid target. rm this file, hexo server works.

I think this is a bug that should be fixed. I don't know what things hexo-server has done, but I've ever tried to use http-server to serve the same repository and encountered no problem like this.

@RupGautam
Copy link

RupGautam commented Feb 10, 2018

Good job! But I'm not convinced it's related to HexoJS server tho.
Hey @NoahDragon, Can you look at this?

@kuanyui kuanyui changed the title hexo server hanging forever and cannot run. [BUG] hexo server hanging forever and cannot run. Feb 12, 2018
@kuanyui kuanyui changed the title [BUG] hexo server hanging forever and cannot run. [BUG] hexo server hanging forever when repo contains any invalid symbolic link Feb 24, 2018
@stevenjoezhang stevenjoezhang transferred this issue from hexojs/hexo Mar 9, 2020
@yanickxia
Copy link

Me toooo....

source git:(private-master) ✗ find . -type l -ls

  8522124      4 lrwxrwxrwx   1 yanick   yanick         72 6月 15 19:05 ./_posts/java/networking/java-nio-1-basic.md -> ../../../../../yann-hexo-blog/source/_posts/java/nio/java-nio-1-basic.md
  8522129      4 lrwxrwxrwx   1 yanick   yanick         77 6月 15 19:05 ./_posts/java/networking/netty/netty-3-pipeline.md -> /Users/yann/codes/yann-hexo-blog/source/_posts/java/netty/netty-3-pipeline.md
  8522126      4 lrwxrwxrwx   1 yanick   yanick         76 6月 15 19:05 ./_posts/java/networking/netty/netty-0-prepare.md -> /Users/yann/codes/yann-hexo-blog/source/_posts/java/netty/netty-0-prepare.md
  8522130      4 lrwxrwxrwx   1 yanick   yanick         76 6月 15 19:05 ./_posts/java/networking/netty/netty-4-bytebuf.md -> /Users/yann/codes/yann-hexo-blog/source/_posts/java/netty/netty-4-bytebuf.md
  8522128      4 lrwxrwxrwx   1 yanick   yanick         84 6月 15 19:05 ./_posts/java/networking/netty/netty-2-acceptor-thread.md -> /Users/yann/codes/yann-hexo-blog/source/_posts/java/netty/netty-2-acceptor-thread.md
  8522127      4 lrwxrwxrwx   1 yanick   yanick         78 6月 15 19:05 ./_posts/java/networking/netty/netty-1-bootstrap.md -> /Users/yann/codes/yann-hexo-blog/source/_posts/java/netty/netty-1-bootstrap.md
  8522131      4 lrwxrwxrwx   1 yanick   yanick         70 6月 15 19:05 ./_posts/java/projectreactor.md -> ../../../../yann-hexo-blog/source/_posts/java/spring/projectreactor.md

delete all... then everything be ok...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants