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

Start the server? #15

Closed
huglester opened this issue May 19, 2015 · 15 comments
Closed

Start the server? #15

huglester opened this issue May 19, 2015 · 15 comments
Assignees
Labels

Comments

@huglester
Copy link
Contributor

Hello,

So I started the server.
The publicUrl is set to http://IP:8081

GitLab-Pages@0.1.0 start /var/www/vhosts/pages
node ./bin/www

But when I go to IP, with port 8081 - I can't see anything, page not found.
Other problem is, that netstat -na does not show, that port 8081 is listening.

Any ideas? Thank you!

@huglester
Copy link
Contributor Author

@Glavin001 hello, I would really like to start and try this project for our markdown docs.. Any help would be appreciated!

Thanks

@Glavin001
Copy link
Owner

The publicUrl is actually used for the webhook -- see https://github.com/Glavin001/GitLab-Pages/search?q=publicurl&type=Code&utf8=%E2%9C%93
So it should not cause problems. I'm not sure why it's not working.

Could you run DEBUG=* npm start and see what messages are displayed in the console?

Update: You should see app:server Listening on port 3000 +0ms at the bottom of your logs when it finally settles.

@huglester
Copy link
Contributor Author

Hello,

sorry for the delay, here what I came up with:
I see output:

> node ./bin/www

  express:router:route new / +0ms
  express:router:layer new / +1ms
  express:router:route get / +0ms
  express:router:layer new / +0ms
  express:router:route new /login +0ms
  express:router:layer new /login +0ms
  express:router:route post /login +1ms
  express:router:layer new / +0ms
  express:router:route new /logout +0ms
  express:router:layer new /logout +0ms
  express:router:route get /logout +0ms
  express:router:layer new / +0ms
  express:router:route new / +0ms
  express:router:layer new / +0ms
  express:router:route get / +0ms
  express:router:layer new / +0ms
  express:router:route new /:project_id/enable +1ms
  express:router:layer new /:project_id/enable +0ms
  express:router:route get /:project_id/enable +0ms
  express:router:layer new / +0ms
  express:router:route new /:project_id/disable +0ms
  express:router:layer new /:project_id/disable +0ms
  express:router:route get /:project_id/disable +0ms
  express:router:layer new / +0ms

module.js:340
    throw err;
          ^
Error: Cannot find module '../build/Debug/nodegit.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/huglester/Projects/pages/node_modules/nodegit/lib/nodegit.js:16:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

npm ERR! GitLab-Pages@0.1.0 start: `node ./bin/www`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the GitLab-Pages@0.1.0 start script.
npm ERR! This is most likely a problem with the GitLab-Pages package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get their info via:
npm ERR!     npm owner ls GitLab-Pages
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.16.0-41-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! cwd /home/huglester/Projects/pages
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/huglester/Projects/pages/npm-debug.log
npm ERR! not ok code 0

seems it can't find module: nodegit

I tried installing and watched for install process, I see this error:

/
> nodegit@0.4.1 install /home/huglester/Projects/pages/node_modules/nodegit
> node lifecycleScripts/install

[nodegit] Fetching binary from S3.
[nodegit] Failed to install prebuilt binary, building manually.
[nodegit] Making sure dependencies are available and native code is generated
[nodegit] Everything is ready to go, attempting compilation
[nodegit] Building native node module.
{ [Error: Command failed: npm WARN prefer global js-beautify@1.5.6 should be installed with -g
npm WARN prefer global pangyp@2.2.1 should be installed with -g
npm ERR! Linux 3.16.0-41-generic
npm ERR! argv "node" "/home/huglester/Projects/pages/node_modules/nodegit/node_modules/.bin/npm" "install" "--ignore-scripts"
npm ERR! node v0.10.38
npm ERR! npm  v2.11.2
npm ERR! path /home/huglester/.npm/js-yaml/3.0.1
npm ERR! code EACCES
npm ERR! errno 3

npm ERR! Error: EACCES, mkdir '/home/huglester/.npm/js-yaml/3.0.1'
npm ERR!  { [Error: EACCES, mkdir '/home/huglester/.npm/js-yaml/3.0.1']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/home/huglester/.npm/js-yaml/3.0.1',
npm ERR!   parent: 'coveralls' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/huglester/Projects/pages/node_modules/nodegit/npm-debug.log
] killed: false, code: 3, signal: null }
undefined
debug@2.2.0 node_modules/debug
└── ms@0.7.1

I have also tried removing node_modules/ directory entirely and install with sudo npm install - ut same error.

@huglester
Copy link
Contributor Author

I also submitted issue to nodegit. I think it is more their error not GitlabPages?

@huglester
Copy link
Contributor Author

Hello, thanks for the help.

With the help of DEBUG=* npm install
I figured out I need to remove ./node_modules and ~/.npm folders.

This gave me nice results :)

thanks!

@Glavin001
Copy link
Owner

Glad to hear it's working!

@huglester
Copy link
Contributor Author

Yeah, it is realy nice, thanks. But strange I am pressing 'Enable' but nothing happens...

Are there any pre-requirements for the repo?

@Glavin001
Copy link
Owner

Are there any pre-requirements for the repo?

Just that it is configured properly. See https://github.com/Glavin001/GitLab-Pages#step-2-configure-gitlab-pages-server

Try running with:

DEBUG=* npm start

and trace down all of the debug lines and see where it does not work. I would recommend adding some debug lines in https://github.com/Glavin001/GitLab-Pages/blob/master/routes/projects.js#L9-L43 which is what handles the enabling of the repository.

If you are unable to figure out what's not working, please feel free to create a new issue with more information that would allow me help debug with you.

@huglester
Copy link
Contributor Author

Hello, thans for help.

After some debugging I see, that hooks are beeing added!

Now I see that after test pull, I see that content is beeing deployed..
But 'Enable' button does not change to 'Disable'

Any idea where to look?:)))

@huglester huglester reopened this Jun 20, 2015
@Glavin001
Copy link
Owner

Try refreshing the webpage. Hopefully it is something as easy as that. If not... 👎

If that does not work then it could be a problem in how the check for if a repository is enabled or not works. Here is the view: https://github.com/Glavin001/GitLab-Pages/blob/master/views/index.handlebars#L13-L17
How it works is by checking if the deploy key and web hook has already successfully been added: https://github.com/Glavin001/GitLab-Pages/blob/master/routes/index.js#L28-L35

@huglester
Copy link
Contributor Author

Hello @Glavin001

and thanks for helping :)

I have disabled this "IF" https://github.com/Glavin001/GitLab-Pages/blob/master/routes/index.js#L28

Because I have one added 'global' key, for all projeject, for easier pulling of projects. So now it verifies only the 'webhookUrl' - and then shows as Enabled/Disabled.

What do you think?

What was the main purpose to check if the is deploy key with 'Gitlab Pages'?

Thanks

@Glavin001
Copy link
Owner

Deploy keys have only read / pull permissions. GitLab Pages will have it's deploy key that it reuses on any applicable / enabled project. So I think maybe your issue was skipping this step: https://github.com/Glavin001/GitLab-Pages#step-1-create-your-deploy-key-pair
I will be keeping with the idea of Deploy key for GitLab Pages, so removing that if statement is a no go.
Glad to hear we have at least narrowed it down to that one line though!

@huglester
Copy link
Contributor Author

So you basicly upload this key. and then add this deployment key to every Project. Right?

@Glavin001
Copy link
Owner

Every project enabled for Gitlab pages, yes. 


Sent from Mailbox

On Mon, Jun 22, 2015 at 4:04 AM, huglester notifications@github.com
wrote:

So you basicly upload this key. and then add this deployment key to every Project. Right?

Reply to this email directly or view it on GitHub:
#15 (comment)

@Glavin001
Copy link
Owner

I think this issue can be closed. What you are describing now is not expected usage of GitLab Pages and/or should be made into another issue if it is still causing problems for you. Thanks!

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

No branches or pull requests

2 participants