Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB error executing 'update_job' (database is locked). Retrying with a new DB connection... #244

Open
clownf opened this issue Jun 1, 2022 · 5 comments
Assignees
Labels

Comments

@clownf
Copy link

clownf commented Jun 1, 2022

Describe the bug
DB error executing 'update_job' (database is locked). Retrying with a new DB connection...

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Traceback
Traceback (most recent call last):
File "/home/clownf/.local/lib/python3.8/site-packages/django_apscheduler/util.py", line 99, in func_wrapper
result = func(*args, **kwargs)
File "/home/clownf/.local/lib/python3.8/site-packages/django_apscheduler/jobstores.py", line 258, in update_job
db_job.save()
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/base.py", line 743, in save
self.save_base(using=using, force_insert=force_insert,
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/base.py", line 780, in save_base
updated = self._save_table(
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/base.py", line 853, in _save_table
updated = self._do_update(base_qs, using, pk_val, values, update_fields,
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/base.py", line 903, in _do_update
return filtered._update(values) > 0
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/query.py", line 760, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1471, in execute_sql
cursor = super().execute_sql(result_type)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
cursor.execute(sql, params)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 99, in execute
return super().execute(sql, params)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/clownf/.local/lib/python3.8/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: database is locked

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Environment (please complete the following information):

  • OS: ubuntu 20.04
  • Browser [e.g. Chrome 67]
  • Python Version 3.8.10
  • Gerapy Version 0.9.10

Additional context
Add any other context about the problem here.

@clownf clownf added the bug label Jun 1, 2022
@InfernalAzazel
Copy link

兄弟我也遇到这个问题有没有解决方法?

@clownf
Copy link
Author

clownf commented Jun 9, 2022

兄弟我也遇到这个问题有没有解决方法?

暂时还没有,已准备自己写爬虫框架了

@aya-momo
Copy link

使用其它类型的数据库,不要使用默认的sqlite。我换成mysql后,就没有这个问题了

@MrDML
Copy link

MrDML commented May 6, 2024

使用其它类型的数据库,不要使用默认的sqlite。我换成mysql后,就没有这个问题了
你好,请问你如何配置的

@InfernalAzazel
Copy link

使用其它类型的数据库,不要使用默认的sqlite。我换成mysql后,就没有这个问题了
你好,请问你如何配置的

我早就换成 qinglong 更先进的技术, 非常稳定又可以自动拉取 github 的爬虫项目。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants