Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

What would cause Odoo to crash and is there a way to automatically restart the service ?

By
Sean Samborski
on 7/23/14, 3:19 PM 3,101 views

Every other day we can't connect to OpenERP. Chrome says "Oops. Can't find the webpage." To fix it, I have to run `service openerp restart` to get it back. 

 

This is tiresome getting calls about it being down every other day. Is there a common cause for this and is there a solution? It seems nothing is written to any logs about this.

wow, from my limited experience that could be a number of issues. First, do you have a script set to auto start when the server your openerp install lives on is rebooted? If not, maintenance could be rebooting your server and killing your openerp instance. Check to see if you have maxxed out your memory resources on your server. Probably not, but worth checking. Are you running on a VPS? If so, find out if their IT is killing idle processes during peak usage hours to load manage. I'd probably check that first. If they are, switch providers asap. Check your server logs to see if you have a security issue. Change passwords and ssh keys to illiminate that minute possibility. If you still can't find a logical reason for the server stopping, one way to patch it would be a cron job that runs every so often restarting the server. Sorry that I can't help more but your problem is very vague and lacking details so this is all I can come up with.

John Baldwin
on 7/23/14, 4:56 PM

Thanks, John. I will check these things. I am running on a VPS so I will check witht he host to see if they're causing an issue.

Elephante, Sean Samborski
on 7/23/14, 5:39 PM

Host said it was nothing. I upgraded the RAM on my server so I will see if this helps solve the issue.

Elephante, Sean Samborski
on 7/28/14, 9:32 PM
1
Beta Uliansyah
On 3/22/16, 9:08 PM

This is my simple crontab script. Please feel free to use or modify it.

Assumptions: 

  • home folder is /home/minamart

  • odoo script located in /home/minamart/odoo/odoo.py


Create a file called cek-minamart.sh, as below: 

#!/bin/bash
SERVICE=/home/minamart/odoo/odoo.py
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
#echo "1"
echo "$SERVICE is running well at `date`" >> /home/minamart/restart.log
else
#echo "2"
echo "$SERVICE is not running. Restarting... at `date`" >> /home/minamart/restart.log
screen -S ODOO_MINAMART-`date "+%F"`-`date "+%T"` -d -m $SERVICE
fi


Make it run every 3 minutes, or any specified time you like:

$ crontab -e

add new line

*/3 * * * * /home/minamart/cek-minamart.sh


This approach will run cek-minamart.sh script every 3 minutes and save the output result to restart.log. After some time, the restart.log filled with lines like this:

$ date
Wed Mar 23 07:48:06 WIB 2016
$ cat restart.log
/home/minamart/odoo/odoo.py is not running. Restarting... at Wed Mar 23 07:42:01 WIB 2016
/home/minamart/odoo/odoo.py is running well at Wed Mar 23 07:45:01 WIB 2016
/home/minamart/odoo/odoo.py is running well at Wed Mar 23 07:48:01 WIB 2016

/home/minamart/odoo/odoo.py is running well at Wed Mar 23 07:51:01 WIB 2016 /home/minamart/odoo/odoo.py is running well at Wed Mar 23 07:54:01 WIB 2016 /home/minamart/odoo/odoo.py is running well at Wed Mar 23 07:57:01 WIB 2016 /home/minamart/odoo/odoo.py is running well at Wed Mar 23 08:00:01 WIB 2016 /home/minamart/odoo/odoo.py is running well at Wed Mar 23 08:03:01 WIB 2016 /home/minamart/odoo/odoo.py is running well at Wed Mar 23 08:06:01 WIB 2016

It means, initially the odoo process is not running, and the script fire it up. Hope, it answered your problem.


0
Anass Ahmed
On 3/27/16, 3:44 PM

It looks like you use Upstart (Maybe you use Systemd, and `service` command is only an alias), if so, check the following question:

https://askubuntu.com/questions/251577/how-to-supervise-and-automatically-restart-a-process

If you use systemd, you could change the service unit file and add the statement under [service] section:

Restart=Always
0
Yogesh
On 7/23/14, 10:58 PM

Agreed with John Baldwin, there can be number of issues. Most likely issue seems with memory. How much memory system has? Check are you on *nix platform, check kernal logs, you will find there if it is memory issue.

0

Grover Menacho

--Grover Menacho--
2523
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Systems Engineer + MBA

Grover Menacho
On 7/23/14, 3:27 PM

It depends on which service you are using and the plan that you have. I've been experiencing issues with 1GB of memory. But I've that problem on Webfaction since they had stopped my services when I surpassed the memory limit.

0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 7/23/14, 9:16 PM

Look into the upstart command - it will monitor any process and restart it if it crashes or is killed.

http://upstart.ubuntu.com/

I have Ubuntu so this looks like a promising solution. I have never heard of Upstart. Looking at the link now. Thanks.

Elephante, Sean Samborski
on 7/28/14, 9:33 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 7/23/14, 3:19 PM
Seen: 3101 times
Last updated: 3/27/16, 3:44 PM