Odoo Help

0

could not obtain lock on row in relation "ir_cron"

By
Mathias Colpaert
on 1/29/15, 2:37 AM 6,480 views

In my postgresql log, I see following error (keeps on beeing logged over and over):

2015-01-28 17:40:26 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 17:40:26 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=2
                                       FOR UPDATE NOWAIT
2015-01-28 17:41:32 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 17:41:32 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=7
                                       FOR UPDATE NOWAIT
2015-01-28 18:36:39 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 18:36:39 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=1
                                       FOR UPDATE NOWAIT
2015-01-28 19:30:44 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 19:30:44 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=9
                                       FOR UPDATE NOWAIT
2015-01-28 19:36:57 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 19:36:57 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=1
                                       FOR UPDATE NOWAIT
2015-01-28 19:41:07 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 19:41:07 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=2
                                       FOR UPDATE NOWAIT
2015-01-28 19:41:16 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 19:41:16 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=7
                                       FOR UPDATE NOWAIT
2015-01-28 21:11:30 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 21:11:30 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=7
                                       FOR UPDATE NOWAIT
2015-01-28 23:30:43 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 23:30:43 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=9
                                       FOR UPDATE NOWAIT
2015-01-28 23:36:55 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 23:36:55 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=1
                                       FOR UPDATE NOWAIT
2015-01-28 23:41:03 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 23:41:03 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=2
                                       FOR UPDATE NOWAIT
2015-01-28 23:41:14 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-28 23:41:14 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=7
                                       FOR UPDATE NOWAIT
2015-01-29 03:07:02 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-29 03:07:02 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=1
                                       FOR UPDATE NOWAIT
2015-01-29 04:07:25 UTC ERROR:  could not obtain lock on row in relation "ir_cron"
2015-01-29 04:07:25 UTC STATEMENT:  SELECT *
                                       FROM ir_cron
                                       WHERE numbercall != 0
                                          AND active
                                          AND nextcall <= (now() at time zone 'UTC')
                                          AND id=1
                                       FOR UPDATE NOWAIT

What is causing this error?

I have following configuration:

  • Odoo v8.0
  • Ubuntu 14.04 LTS on vps
  • No outgoing mailserver configured

 

Same situation here, also looking for an answer.

Ermin Trevisan
on 3/10/15, 3:10 AM

Same situation here, also looking for an answer.

Ygol InternetWork, Yves Goldberg
on 5/26/16, 8:19 AM
1
Bernard Kipkorir Too
On 1/18/17, 5:31 AM

Please check your ir_cron actions for "scheduled actions" that have  very small interval_time like 1 minute interval. It is likely that the next run is starting before the previous one is finished (LOCKED FOR UPDATE). This happens in scheduled actions like fetching mail from your mail server which may take longer than 1 or 2 minutes due to connection issues or alot of emails to download. 

0

Zbik

--Zbik--
6263
| 6 4 7
Lodz, Poland
--Zbik--


Zbik
On 3/10/15, 3:29 AM

You verify how many openerp server instances have run.

>ps aux | grep oepenrp

or, you set in openerp-server.conf

max_cron_threads = 1

This appears to be because two cron threads run the same command.

I only have 1 server instance running. max_cron_threads is set to 2, but if this is the bug, why does this option even exist? Should I always put max_cron_threads = 1, and why?

Mathias Colpaert
on 5/29/15, 9:59 AM

If the whole system works properly, settings max_cron_threads = 2 is good.

Zbik
on 5/29/15, 12:35 PM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 1/29/15, 2:37 AM
Seen: 6480 times
Last updated: 1/18/17, 5:31 AM