0

I want to install a service in AWS as below command since i have two apps needs to be hosted in the same server. I am able to deploy an app in the default service strong-pm. But when i try to create a new service as below

sudo slc pm-install --upstart 0.6 --user manhunt-pm --port 6666 --job-file /etc/init/manhunt-pm.conf

The service gets started. But when i try to deploy the tar file, I am getting the following error

Deploy /home/ec2-user/manhunt-0.0.0.tgz to http://localhost:6666 failed: read ECONNRESET

From the aws log, i see the following message

Feb 27 05:50:05 ip-172-31-28-147 strong-pm: TypeError: Object #<Object> has no method 'sendError'</b>
Feb 27 05:50:05 ip-172-31-28-147 strong-pm:   at /usr/lib/node_modules/strongloop/node_modules/strong-pm/lib/pack-receiver.js:94:12
Feb 27 05:50:05 ip-172-31-28-147 strong-pm:   at /usr/lib/node_modules/strongloop/node_modules/mkdirp/index.js:46:53
Feb 27 05:50:05 ip-172-31-28-147 strong-pm:   at Object.oncomplete (fs.js:107:15)
Feb 27 05:50:05 ip-172-31-28-147 strong-pm: 
Feb 27 05:50:05 ip-172-31-28-147 init: manhunt-pm main process (13087) terminated with status 8
Feb 27 05:50:05 ip-172-31-28-147 init: manhunt-pm main process ended, respawning
Feb 27 05:50:05 ip-172-31-28-147 su: (to manhunt-pm) root on none
Feb 27 05:50:10 ip-172-31-28-147 strong-pm: sl-pm.js: control listening on path `/var/lib/manhunt-pm/pmctl`
Feb 27 05:50:10 ip-172-31-28-147 strong-pm: sl-pm.js: listen on 6666, work base is `/var/lib/manhunt-pm/.strong-pm` with config `/var/lib/manhunt-pm/.strong-pm/config`

Am I missing something? Or is there any other way that I want to host two different apps in the same server in different port say 3000 and 3001. Please help.

Ryann Graham
  • 8,079
  • 2
  • 29
  • 32

1 Answers1

0

edit: the bug described below was fixed in strong-pm@1.7.3

The first line of the error looks like a bug. It is triggering an error while trying to tell you that it failed to create a temp directory.

Looking at the code that triggers that, I think this may be a permissions problem. You have two separate instances of strong-pm each running as their own user, but the way it creates temporary directories appears to assume semi-exclusive access.

I suspect that if you do ls -ld /tmp/strong-pm you will see that it is drwxr-xr-x and owned by strong-pm:strong-pm.

If you run sudo chmod o+w /tmp/strong-pm it should allow the second instance to create its temp directory like it is trying to. You should only need to do that once.

Ryann Graham
  • 8,079
  • 2
  • 29
  • 32
  • I've reported these bugs and submitted a PR for them: https://github.com/strongloop/strong-pm/pull/133 – Ryann Graham Feb 28 '15 at 19:53
  • Thx for the answer. I solved the permission issue. But still the 2nd instance does not seem to run the process. I see from the log that the 2nd instance rebuild the code and generatate the directory under the /var/lib/manhunt-pm/.strong-pm/work the following folder ecbd952dabe34ff2710351df78ea44b4cb68b7cd.1425179284756. But the instance is not running the app. I don't see the "current" directory under the work folder – user3679710 Mar 01 '15 at 03:12
  • Are you able to open an issue on https://github.com/strongloop/strong-pm/issues about running multiple instances of strong-pm on a single server? – Ryann Graham Mar 01 '15 at 21:46