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

"All Requests" Will Not Load #28

Closed
Alcatraz077 opened this issue May 20, 2021 · 2 comments
Closed

"All Requests" Will Not Load #28

Alcatraz077 opened this issue May 20, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Alcatraz077
Copy link

Describe the bug
All Requests will not load.

To Reproduce

  1. Go to Conreq main page
  2. Click on "All Requests" under "Admin"
  3. Page will not load

Expected behavior
All requests to load

Additional context
Log block when this occurs:

TypeError: 'NoneType' object does not support item assignment
    card["requested_by"] = entry.get("requested_by__username")
TypeError: 'NoneType' object does not support item assignment
ERROR conreq.utils.cache: Function info failed to execute!
Traceback (most recent call last):
  File "/app/conreq/conreq/utils/cache.py", line 177, in handler
    background_task(cache.set, cache_key, function_results, cache_duration)
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 797, in __call__
    return self.huey.enqueue(self.s(*args, **kwargs))
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 290, in enqueue
    self.storage.enqueue(self.serialize_task(task), task.priority)
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 728, in enqueue
    self.sql('insert into task (queue, data, priority) values (?, ?, ?)',
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 671, in sql
    with self.db(commit=commit) as curs:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 652, in db
    if commit: cursor.execute(self.begin_sql)
sqlite3.OperationalError: database is locked

ERROR conreq.core.tmdb.base: Failed to set content attributes!
Traceback (most recent call last):
  File "/app/conreq/conreq/core/tmdb/base.py", line 472, in _set_content_attributes
    results["content_type"] = content_type
TypeError: 'NoneType' object does not support item assignment

Exception in thread Thread-493:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/app/conreq/conreq/utils/multiprocessing.py", line 19, in run
    self._return = self._target(*self._args, **self._kwargs)
  File "/app/conreq/conreq/core/user_requests/helpers.py", line 142, in __generate_request_card
    card["requested_by"] = entry.get("requested_by__username")
TypeError: 'NoneType' object does not support item assignment
ERROR django.request: Internal Server Error: /request/all_requests/
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/asgiref/sync.py", line 458, in thread_handler
    raise exc_info[1]
  File "/usr/lib/python3.8/site-packages/django/core/handlers/exception.py", line 38, in inner
    response = await get_response(request)
  File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py", line 233, in _get_response_async
    response = await wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.8/site-packages/asgiref/sync.py", line 423, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 455, in wait_for
    return await fut
  File "/usr/lib/python3.8/site-packages/asgiref/current_thread_executor.py", line 22, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.8/site-packages/asgiref/sync.py", line 462, in thread_handler
    return func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/app/conreq/conreq/core/user_requests/views.py", line 106, in all_requests
    all_cards = generate_requests_cards(user_requests)
  File "/app/conreq/conreq/core/user_requests/helpers.py", line 204, in generate_requests_cards
    content_discovery.determine_id_validity(all_cards)
  File "/app/conreq/conreq/core/tmdb/base.py", line 173, in determine_id_validity
    if result.__contains__("name"):
AttributeError: 'NoneType' object has no attribute '__contains__'
[2021-05-20 14:57:50,420] ERROR:huey.consumer.Worker:Worker-5:Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
ERROR huey.consumer.Worker: Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
[2021-05-20 14:57:50,428] ERROR:huey.consumer.Worker:Worker-2:Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
ERROR huey.consumer.Worker: Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
[2021-05-20 14:57:50,452] ERROR:huey.consumer.Worker:Worker-4:Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
ERROR huey.consumer.Worker: Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
[2021-05-20 14:57:50,516] ERROR:huey.consumer.Worker:Worker-1:Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
ERROR huey.consumer.Worker: Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
[2021-05-20 14:57:50,944] ERROR:huey.consumer.Worker:Worker-3:Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database
ERROR huey.consumer.Worker: Error reading from queue
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/huey/consumer.py", line 109, in loop
    task = self.huey.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/api.py", line 306, in dequeue
    data = self.storage.dequeue()
  File "/usr/lib/python3.8/site-packages/huey/storage.py", line 738, in dequeue
    curs.execute('delete from task where id = ?', (tid,))
sqlite3.OperationalError: attempt to write a readonly database

Seems to be an issue with the sqlite3 db based on some of the errors it spits out.

Screenshots
N/A

System Information

Conreq Version

  • Version: 0.18.71
  • Branch: main
  • Host: Docker under Debian Linux (docker image ghcr.io/roxedus/conreq:latest)

Desktop

  • OS: Windows 10
  • Browser: Brave (Chromium based), Firefox

Smartphone
N/A

@Alcatraz077 Alcatraz077 added the bug Something isn't working label May 20, 2021
@Archmonger
Copy link
Owner

Issue is related to #23
Right now it's technically possible for so many requests to exist that "All Requests" can time out while loading.

Resolution will involve permanently storing these items in the database rather than cache.

@Alcatraz077
Copy link
Author

My bad, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants