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

Delete channel or resources task fails when attempting to release an expired Redis lock #7669

Closed
radinamatic opened this issue Nov 5, 2020 · 6 comments · Fixed by #7685
Closed
Assignees
Labels
bug Behavior is wrong or broken P0 - critical Priority: Release blocker or regression
Milestone

Comments

@radinamatic
Copy link
Member

Observed behavior

Both Delete channel and Manage > Delete (all) resources for that same channel are failing.
Asset from v0.14.4-weekly7 build on Windows 7.
The only content present was KA (EN) > Math > Arithmetic, and I was not able to delete neither the full channel, nor by selecting all the resources inside, as the task was reported as Failed. I suspect just the DB was deleted but not the resources.

Expected behavior

Being able to delete channel/resources.

User-facing consequences

Inability to manage channels and resources on the device.

Errors and logs

Nothing jumped at me as relevant in the browser console, attaching the logs.

logs.zip

Steps to reproduce

  1. Download KA (EN) > Math > Arithmetic.
  2. Try to delete the channel and/or all the resources.

Context

Tell us about your environment, including:

  • Kolibri version: v0.14.4-weekly7
  • Operating system: Windows 7
  • Browser: Firefox
@radinamatic radinamatic added bug Behavior is wrong or broken P1 - important Priority: High impact on UX OS: Windows labels Nov 5, 2020
@rtibbles
Copy link
Member

rtibbles commented Nov 5, 2020

Seems to be an issue here:

  File "c:\python36\lib\site-packages\kolibri\core\tasks\worker.py", line 72, in handle_finished_future
    result = future.result()
  File "c:\python36\lib\concurrent\futures\_base.py", line 425, in result
    return self.__get_result()
  File "c:\python36\lib\concurrent\futures\_base.py", line 384, in __get_result
    raise self._exception
  File "c:\python36\lib\concurrent\futures\thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "c:\python36\lib\site-packages\kolibri\core\tasks\worker.py", line 217, in wrap
    return f(*args, **kwargs)
  File "c:\python36\lib\site-packages\kolibri\core\tasks\job.py", line 194, in y
    result = func(*args, **kwargs)
  File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "c:\python36\lib\site-packages\kolibri\core\tasks\management\commands\base.py", line 119, in handle
    return self.handle_async(*args, **options)
  File "c:\python36\lib\site-packages\kolibri\core\content\management\commands\deletecontent.py", line 114, in handle_async
    channel, node_ids, exclude_node_ids, force_delete
  File "c:\python36\lib\site-packages\kolibri\core\content\management\commands\deletecontent.py", line 45, in delete_metadata
    channel.delete_content_tree_and_files()
  File "c:\python36\lib\site-packages\kolibri\core\utils\cache.py", line 70, in __exit__
    self.release()
  File "c:\python36\lib\site-packages\kolibri\core\utils\cache.py", line 64, in release
    self._lock.release()
  File "c:\python36\lib\site-packages\kolibri\dist\diskcache\recipes.py", line 165, in release
    assert is_owned, 'cannot release un-acquired lock'
AssertionError: cannot release un-acquired lock

This is called after the channel metadata has been removed from the DB, but before the content is cleared up, so it's consistent with the reports.

@radinamatic radinamatic changed the title Delete channel or reseurces task is failing Delete channel or resources task is failing Nov 5, 2020
@jonboiser jonboiser added this to the 0.14.4 milestone Nov 5, 2020
@jonboiser jonboiser added P0 - critical Priority: Release blocker or regression and removed P1 - important Priority: High impact on UX OS: Windows labels Nov 5, 2020
@jredrejo
Copy link
Member

jredrejo commented Nov 6, 2020

FYI, in a RPI, with kolibri-server and this setup for redis:

CACHE_BACKEND = redis
CACHE_REDIS_MAXMEMORY = 536870912
CACHE_REDIS_MAXMEMORY_POLICY = allkeys-lru

deleting the same channel @radinamatic comments has worked, but... it took 8 minutes

@radinamatic
Copy link
Member Author

Still extant on 0.14.4-RC1.

I only see the AssertionError in a warning, but there are ...to many SQL variables errors.

daemon.txt
kolibri.txt

@radinamatic radinamatic reopened this Nov 17, 2020
@rtibbles
Copy link
Member

Looks like my updates didn't go far enough here.

@jonboiser jonboiser changed the title Delete channel or resources task is failing Delete channel or resources task fails when attempting to release an expired Redis lock Nov 17, 2020
@radinamatic
Copy link
Member Author

Additional detail: above fail happened when I selected to delete all the resources (Manage > select topic > Delete), but the workflow Options > Delete channel > select channel > Delete worked and wiped it in around 3 minutes.

@jonboiser
Copy link
Contributor

Closing and opening #7697 with more detailed documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Behavior is wrong or broken P0 - critical Priority: Release blocker or regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants