LockTimeout Error

76 views
Skip to first unread message

MP

unread,
Aug 5, 2014, 12:41:58 PM8/5/14
to erpnext-dev...@googlegroups.com
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

Pratik Vyas

unread,
Aug 6, 2014, 1:19:56 AM8/6/14
to erpnext-dev...@googlegroups.com
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...@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

MP

unread,
Aug 11, 2014, 7:57:59 AM8/11/14
to erpnext-dev...@googlegroups.com
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

Anand Doshi

unread,
Aug 11, 2014, 9:11:17 AM8/11/14
to ERPNext Developer's Forum
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.


--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages