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

[Bug]: Uncaught exception while emptying recycle bin #272

Closed
appiekap653 opened this issue Apr 23, 2023 · 6 comments · Fixed by #273
Closed

[Bug]: Uncaught exception while emptying recycle bin #272

appiekap653 opened this issue Apr 23, 2023 · 6 comments · Fixed by #273
Assignees
Labels
bug Something isn't working status:added-to-develop Feature Request or Bug Fix is in Develop

Comments

@appiekap653
Copy link

Describe the Bug

When files are deleted outside of qBitManage it throws an uncaught exception while emptying the recycle bin.
It just keeps on looping after that throwing the same error over and over again.

I don't think it is that necessary to keep wanting to find the files it needs to delete. and keep looping until those files are found.
When your objective is empty the bin and the files are gone, why keep looping and searching for files that you thought where there? it is empty...

`
|================== Searching: /data/downloads/torrents/private/movies/.RecycleBin ==================|

| Deleted kings.of.mulberry.street.let.love.reign.2023.1080p.web.h264-edith.nfo from /data/downloads/torrents/private/movies/.RecycleBin (Last modified 2 days ago). |

| Uncaught Exception |

Traceback (most recent call last):

File "/app/qbit_manage.py", line 563, in

start_loop()

File "/app/qbit_manage.py", line 322, in start_loop

start()

File "/app/qbit_manage.py", line 436, in start

stats["recycle_emptied"] += cfg.cleanup_dirs("Recycle Bin")

File "/app/modules/config.py", line 532, in cleanup_dirs

fileStats = os.stat(file)

FileNotFoundError: [Errno 2] No such file or directory: '/data/downloads/torrents/private/movies/.RecycleBin/torrents/private/movies/Kings.of.Mulberry.Street.Let.Love.Reign.2023.1080p.WEB.h264-EDITH/kings.of.mulberry.street.let.love.reign.2023.1080p.web.h264-edith.nfo'
`

Config

No response

Logs

https://gist.github.com/appiekap653/16d420d4d7edf9fcd4757734dc7ec509

Screenshots

No response

Installation

Docker

Version Number

3.6.1

What branch are you on?

master

@appiekap653 appiekap653 added the bug Something isn't working label Apr 23, 2023
@bobokun
Copy link
Collaborator

bobokun commented Apr 23, 2023

It seems to be that qbit_manage is unable to delete those files and/or doesn't have the correct permissions to read those files. I've added additional logging and fixed the uncaught exception error so it shouldn't crash anymore.

Can you update to the develop branch and enable trace logging by adding the env variable QBT_TRACE=True

@appiekap653
Copy link
Author

appiekap653 commented Apr 23, 2023

Well the reason is not permissions, the files are simply not there anymore. Like i said in the first post, the files where deleted outside of qbitmanage.

Are you keeping some kind of list of all the files in the bin? And delete them by going over that list?

If so, would it be an idea to just remove the items from your list when the physical files are not present anymore, instead of give an error?

@bobokun
Copy link
Collaborator

bobokun commented Apr 23, 2023

Nope, qbit_manage gets the list of all the files in the bin at the time it's cleaning so it was seeing those files at the time of run. That's why I believe it's a permission issue since those files definitely do exist (or at least qbit_manage think they do exist) at the time of running.

Those trace logs would definitely help confirm that theory though.

@bobokun bobokun added the status:added-to-develop Feature Request or Bug Fix is in Develop label Apr 23, 2023
@appiekap653
Copy link
Author

well... to be honest, the trace logs doesn't say anything anymore about it, for two reasons:

  1. The logs are showing only the last 2 hours while it happened yesterday.
  2. those files are definitely not there since like i said in the beginning. I deleted them outside of qbitmanage, which started the looping error. but when I noticed yesterday that new torrents weren't getting tagged anymore I restarted the qbitmanage container and it kept looping on the error. hence my question if it stores the filelist of the bin...

What triggered the uncaught error is totally clear. I deleted some files that qbitmanage thought where there still.
What is wierd is that qbitmanage has an uncaught exception while he is emptying the bin. isn't an empty directory not the goal? why argue for files that should have been there and keep arguing and finally crash while if it has been there you would just deleted them...
Why not make it like: oh that file was supposed to be there, i need to delete it. someone else deleted it, i don't care, move on to the next...

@bobokun
Copy link
Collaborator

bobokun commented Apr 24, 2023

Qbit manage sees that the files are there. Either way, this uncaught exception is now handled so itll be fixed in the next release

@appiekap653
Copy link
Author

development_log

@bobokun bobokun mentioned this issue Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status:added-to-develop Feature Request or Bug Fix is in Develop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants