Ask Your Question
0

how to resolveConnection time out Error when running nodejs app using puppet

asked 2016-09-21 16:27:16 -0500

nadish gravatar image

I am cloning my repo and running my nodejs application using puppet. please find the code below:

package { 'git': ensure => 'latest', }

  vcsrepo { "/nodejs-helloworld":
    ensure   => latest,
    provider => git,
    require  => [ Package["git"] ],
    source   => "git@gitlab.abc.dev.net:hello-world/nodejs-helloworld.git",
    revision => 'master',
    before   => Exec['/usr/local/bin/npm install;/usr/local/bin/npm start'],
  }
 exec { '/usr/local/bin/npm install;/usr/local/bin/npm start':
  cwd         => '/nodejs-helloworld',
  subscribe   => Vcsrepo['/nodejs-helloworld'],
  refreshonly => true,
}

My repository is cloned,and also my application is running fine and npm test also works.Everything works fine. but i get connection time out error.

Error Log:

[root@ip-*******/]# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for ip-**************
Info: Applying configuration version '1474433486'
Notice: /Stage[main]/Main/Exec[install-node-version-manager-global]/returns: executed successfully
Notice: /Stage[main]/Main/Exec[install-node-version-manager-latest]/returns: executed successfully
Notice: /Stage[main]/Main/Vcsrepo[/nodejs-helloworld]/ensure: Creating repository from latest
Notice: /Stage[main]/Main/Vcsrepo[/nodejs-helloworld]/ensure: created
 Info: /Stage[main]/Main/Vcsrepo[/nodejs-helloworld]: Scheduling refresh of Exec[/usr/local/bin/npm install;/usr/local/bin/npm start]
 Error: /Stage[main]/Main/Exec[/usr/local/bin/npm install;/usr/local/bin/npm start]: Failed to call refresh: Command exceeded timeout
 Error: /Stage[main]/Main/Exec[/usr/local/bin/npm install;/usr/local/bin/npm start]: Command exceeded timeout
 Notice: Finished catalog run in 302.86 seconds

As you can see here eventhough i get connection time out error, my app is running. and npm test works.

 [root@ip-********* nodejs-helloworld]# netstat -anp 2> /dev/null | grep :3000
    tcp6       0      0 :::3000                 :::*                    LISTEN      17630/node
 [root@ip-********* nodejs-helloworld]# npm test

    > nodejs-helloworld@1.0.0 test /nodejs-helloworld
    > mocha

      Test HelloWorld
        ✓ Should have the root route (46ms)
        ✓ Should have a hello world response
      2 passing (66ms)

Can anyone please tell me how to avoid the connection timeout error.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2016-09-28 05:24:59 -0500

dancewind gravatar image

You can disable the timeout by adding it in exec{'/usr/local/bin/npm install;/usr/local/bin/npm start': timeout=>0}


Ref: https://docs.puppet.com/puppet/latest...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-09-21 16:27:16 -0500

Seen: 25 times

Last updated: Sep 28 '16