LockTimeout Error

Hi There,

I keep seeing this error on server console on the dev server. Is there any reason for it?

16:38:49 worker.1     | [2014-08-05 16:38:49,796: ERROR/MainProcess] Task frappe.tasks.enqueue_events_for_site[f324141e-f936-40f7-8359-10366786616a] raised unexpected: LockTimeoutError(u’./erp-prod/locks/scheduler.lock’,)
16:38:49 worker.1     | Traceback (most recent call last):
16:38:49 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 240, in trace_task
16:38:49 worker.1     |     R = retval = fun(*args, **kwargs)
16:38:49 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 437, in protected_call
16:38:49 worker.1     |     return self.run(*args, **kwargs)
16:38:49 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/tasks.py”, line 105, in enqueue_events_for_site
16:38:49 worker.1     |     enqueue_events(site)
16:38:49 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 25, in enqueue_events
16:38:49 worker.1     |     lock = create_lock(‘scheduler’)
16:38:49 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 16, in create_lock
16:38:49 worker.1     |     if not check_lock(lock_path):
16:38:49 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 25, in check_lock
16:38:49 worker.1     |     raise LockTimeoutError(path)
16:38:49 worker.1     | LockTimeoutError: ./erp-prod/locks/scheduler.lock

Kind regards,
MP



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/4ec6c169-c336-4008-8290-0c3cf56c68d2%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

On Tue, Aug 5, 2014 at 10:11 PM, MP ma...@gmail.com wrote:

Hi There,

I keep seeing this error on server console on the dev server. Is there any
reason for it?

16:38:49 worker.1 | [2014-08-05 16:38:49,796: ERROR/MainProcess] Task
frappe.tasks.enqueue_events_for_site[f324141e-f936-40f7-8359-10366786616a]
raised unexpected: LockTimeoutError(u’./erp-prod/locks/scheduler.lock’,)
16:38:49 worker.1 | Traceback (most recent call last):
16:38:49 worker.1 | File
“/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”,
line 240, in trace_task
16:38:49 worker.1 | R = retval = fun(*args, **kwargs)
16:38:49 worker.1 | File
“/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”,
line 437, in protected_call
16:38:49 worker.1 | return self.run(*args, **kwargs)
16:38:49 worker.1 | File
“/var/www/frappe-bench/apps/frappe/frappe/tasks.py”, line 105, in
enqueue_events_for_site
16:38:49 worker.1 | enqueue_events(site)
16:38:49 worker.1 | File
“/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 25, in
enqueue_events
16:38:49 worker.1 | lock = create_lock(‘scheduler’)
16:38:49 worker.1 | File
“/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 16, in
create_lock
16:38:49 worker.1 | if not check_lock(lock_path):
16:38:49 worker.1 | File
“/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 25, in
check_lock
16:38:49 worker.1 | raise LockTimeoutError(path)
16:38:49 worker.1 | LockTimeoutError: ./erp-prod/locks/scheduler.lock

Hi Mayur,

Lock timeout occours if there’s an exception in a scheduled events.
You can safely remove the file.

If this happens too often, then check the logs for scheduler
exceptions. (if you run bench start, then they are printed on the
console, supervisor logs them in logs/ dir).

Kind regards,
MP


Note:

If you are posting an issue,

  1. ERPNext is a free and open source software and support is given on this
    forum by a team (https://frappe.io/webnotes). So please consider donating if
    you find this forum useful (https://frappe.io/buy). Even a small amount
    would be helpful.
  2. We should be able to replicate it at our end. So please give us as much
    information as you can. Please see it from the point of view of the person
    receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send
    only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do
    not send images as attachments. Links are good. Same goes for any file you
    are going to send.

End of Note

You received this message because you are subscribed to the Google Groups
“ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to erpnext-developer-forum+un...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/4ec6c169-c336-4008-8290-0c3cf56c68d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thanks,

Pratik
erpnext

Hi Pratik,

Even after deleting the file, I am still get the same error in console. See below.

 | [2014-08-11 11:49:24,979: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)
11:49:25 worker.1     | [2014-08-11 11:49:25,097: ERROR/MainProcess] Task frappe.tasks.enqueue_events_for_site[bf6e3076-b8c8-43b6-8d21-5ea9dd119717] raised unexpected: LockTimeoutError(u’./erp-prod/locks/scheduler.lock’,)
11:49:25 worker.1     | Traceback (most recent call last):
11:49:25 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 240, in trace_task
11:49:25 worker.1     |     R = retval = fun(*args, **kwargs)
11:49:25 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 437, in protected_call
11:49:25 worker.1     |     return self.run(*args, **kwargs)
11:49:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/tasks.py”, line 105, in enqueue_events_for_site
11:49:25 worker.1     |     enqueue_events(site)
11:49:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 25, in enqueue_events
11:49:25 worker.1     |     lock = create_lock(‘scheduler’)
11:49:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 16, in create_lock
11:49:25 worker.1     |     if not check_lock(lock_path):
11:49:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 25, in check_lock
11:49:25 worker.1     |     raise LockTimeoutError(path)
11:49:25 worker.1     | LockTimeoutError: ./erp-prod/locks/scheduler.lock
11:49:39 web.1        | 213.120.255.206 - - [11/Aug/2014 11:49:39] “POST / HTTP/1.1” 200 -
11:54:25 workerbeat.1 | [2014-08-11 11:54:25,070: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)
11:54:25 worker.1     | [2014-08-11 11:54:25,088: ERROR/MainProcess] Task frappe.tasks.enqueue_events_for_site[c66eab87-9a6b-47ad-90fa-ade887f443e9] raised unexpected: LockTimeoutError(u’./erp-prod/locks/scheduler.lock’,)
11:54:25 worker.1     | Traceback (most recent call last):
11:54:25 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 240, in trace_task
11:54:25 worker.1     |     R = retval = fun(*args, **kwargs)
11:54:25 worker.1     |   File “/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py”, line 437, in protected_call
11:54:25 worker.1     |     return self.run(*args, **kwargs)
11:54:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/tasks.py”, line 105, in enqueue_events_for_site
11:54:25 worker.1     |     enqueue_events(site)
11:54:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 25, in enqueue_events
11:54:25 worker.1     |     lock = create_lock(‘scheduler’)
11:54:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 16, in create_lock
11:54:25 worker.1     |     if not check_lock(lock_path):
11:54:25 worker.1     |   File “/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py”, line 25, in check_lock
11:54:25 worker.1     |     raise LockTimeoutError(path)
11:54:25 worker.1     | LockTimeoutError: ./erp-prod/locks/scheduler.lock

Kind regards,
MP



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/48316396-5b74-4316-8908-27fe5f5ba245%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Mayur,

Scheduler.lock stays when there are problems encountered even when just enqueuing tasks, even before they have begun running.

You should look at Setup > System > Scheduler Logs to see if it sheds some light.


-Anand.


On Mon, Aug 11, 2014 at 5:27 PM, MP <ma…@gmail.com> wrote:

Hi Pratik,

Even after deleting the file, I am still get the same error in console. See below.

| [2014-08-11 11:49:24,979: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)

11:49:25 worker.1 | [2014-08-11 11:49:25,097: ERROR/MainProcess] Task frappe.tasks.enqueue_events_for_site[bf6e3076-b8c8-43b6-8d21-5ea9dd119717] raised unexpected: LockTimeoutError(u'./erp-prod/locks/scheduler.lock',)

11:49:25 worker.1 | Traceback (most recent call last):
11:49:25 worker.1 | File "/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
11:49:25 worker.1 | R = retval = fun(*args, **kwargs)

11:49:25 worker.1 | File "/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in protected_call
11:49:25 worker.1 | return self.run(*args, **kwargs)

11:49:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/tasks.py", line 105, in enqueue_events_for_site
11:49:25 worker.1 | enqueue_events(site)
11:49:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 25, in enqueue_events

11:49:25 worker.1 | lock = create_lock('scheduler')
11:49:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py", line 16, in create_lock
11:49:25 worker.1 | if not check_lock(lock_path):

11:49:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py", line 25, in check_lock
11:49:25 worker.1 | raise LockTimeoutError(path)
11:49:25 worker.1 | LockTimeoutError: ./erp-prod/locks/scheduler.lock

11:49:39 web.1 | 213.120.255.206 - - [11/Aug/2014 11:49:39] "POST / HTTP/1.1" 200 -
11:54:25 workerbeat.1 | [2014-08-11 11:54:25,070: INFO/MainProcess] Scheduler: Sending due task scheduler (frappe.tasks.enqueue_scheduler_events)

11:54:25 worker.1 | [2014-08-11 11:54:25,088: ERROR/MainProcess] Task frappe.tasks.enqueue_events_for_site[c66eab87-9a6b-47ad-90fa-ade887f443e9] raised unexpected: LockTimeoutError(u'./erp-prod/locks/scheduler.lock',)

11:54:25 worker.1 | Traceback (most recent call last):
11:54:25 worker.1 | File "/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
11:54:25 worker.1 | R = retval = fun(*args, **kwargs)

11:54:25 worker.1 | File "/var/www/frappe-bench/env/local/lib/python2.7/site-packages/celery/app/trace.py", line 437, in protected_call
11:54:25 worker.1 | return self.run(*args, **kwargs)

11:54:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/tasks.py", line 105, in enqueue_events_for_site
11:54:25 worker.1 | enqueue_events(site)
11:54:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 25, in enqueue_events

11:54:25 worker.1 | lock = create_lock('scheduler')
11:54:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py", line 16, in create_lock
11:54:25 worker.1 | if not check_lock(lock_path):

11:54:25 worker.1 | File "/var/www/frappe-bench/apps/frappe/frappe/utils/file_lock.py", line 25, in check_lock
11:54:25 worker.1 | raise LockTimeoutError(path)
11:54:25 worker.1 | LockTimeoutError: ./erp-prod/locks/scheduler.lock


Kind regards,
MP



Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/48316396-5b74-4316-8908-27fe5f5ba245%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF25ubdvXgr5yuWa%3DmWk%3DTCEf1bDizXiYR–dRN7t0%2BUog%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.