Skip to content

pod stop myapp - not deleting app from pm2 in case of fatal error #86

@ka05

Description

@ka05

I recently ran into the case where one of my apps had stopped and when i tried to restart it said it was started and showed the name and port, etc. However it was not actually running when re-running pod list. This led me to dig through the code a bit and I found that in api.startApp(), pm2.start() was indeed called and successfully returned the proper response that i was seeing. This means that most likely the pm2.start() method does not handle the case that I was seeing. I then decided to investigate the app within the pm2 scope. So I ran pm2 status which showed that my app was indeed stopped and when running pod start myapp and checking pm2 status again it was still stopped. The only way I could find around this was to run pm2 delete myapp and then re-run pod start myapp. After this It seemed to work just fine.

Im not entirely sure of this but In order to fix this perhaps you could get the status of the app from pm2 before running start, and if it is stopped then delete it from pm2, and proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions