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]: Torrent & Data removed while still being cross-seeded #279

Closed
mlamoure opened this issue May 2, 2023 · 2 comments · Fixed by #301
Closed

[Bug]: Torrent & Data removed while still being cross-seeded #279

mlamoure opened this issue May 2, 2023 · 2 comments · Fixed by #301
Assignees
Labels
bug Something isn't working status:added-to-develop Feature Request or Bug Fix is in Develop

Comments

@mlamoure
Copy link

mlamoure commented May 2, 2023

Describe the Bug

In a single run of qbm:

  1. Torrent was tagged with an issue - removed from tracker. A cross-seeded torrent also exists. Potentially relevant - the torrent was also tagged as noHL
  2. Torrent was removed including data.
  3. When qbm checked for torrents with No Hardlinks, error occurs, presumingly as qbm is checking for hard links on the cross-seeded torrent. Qbt still thinks the data is there, and has not errored yet.

Nohardlink Error: Unable to open the folder /data/completed/tv_shows/. Please make sure folder exists and qbit_manage has access to this directory. |

Subsequent runs of qbm produces the same error until the torrent is removed from qbt. If the torrent in qbt is re-checked, it could result in re-downloading the torrent.

Config

# This is an example configuration file that documents all the options.
# It will need to be modified for your specific use case.
# Please refer to the link below for more details on how to set up the configuration file
# https://github.com/StuffAnThings/qbit_manage/wiki/Config-Setup

commands:
  # The commands defined below will IGNORE any commands used in command line and docker env variables.
  dry_run: false
  cross_seed: false
  recheck: true
  cat_update: true
  tag_update: true
  rem_unregistered: true
  tag_tracker_error: true
  rem_orphaned: true
  tag_nohardlinks: true
  skip_cleanup: false

qbt:
  # qBittorrent parameters
  host: 10.66.0.221:8080
  user: <REDACTED>
  pass: <REDACTED>

settings:
  force_auto_tmm: true  # Will force qBittorrent to enable Automatic Torrent Management for each torrent.
  tracker_error_tag: issue  # Will set the tag of any torrents that do not have a working tracker.
  nohardlinks_tag: noHL # Will set the tag of any torrents with no hardlinks.
  ignoreTags_OnUpdate: # When running tag-update function, it will update torrent tags for a given torrent even if the torrent has at least one or more of the tags defined here. Otherwise torrents will not be tagged if tags exist.
  - noHL
  - cross-seed
  - other

directory:
  # Do not remove these
  # Cross-seed var: </your/path/here/>  # Output directory of cross-seed
  # root_dir var: </your/path/here/>  # Root downloads directory used to check for orphaned files, noHL, and RecycleBin.
  # <OPTIONAL> remote_dir var: </your/path/here/>  # Path of docker host mapping of root_dir.
  # Must be set if you're running qbit_manage locally and qBittorrent/cross_seed is in a docker
  # <OPTIONAL> recycle_bin var: </your/path/here/>   # Path of the RecycleBin folder. Default location is set to remote_dir/.RecycleBin
  # <OPTIONAL> torrents_dir var: </your/path/here/>  # Path of the your qbittorrent torrents directory. Required for `save_torrents` attribute in recyclebin

  #cross_seed: "/your/path/here/"
  root_dir: /data/completed/
  remote_dir: /data/completed/
  recycle_bin: /data/recycle_bin/
  torrents_dir: /data/torrent_files/
  cross_seed:
  orphaned_dir: /data/orphaned_data/

cat:
  # Category & Path Parameters
  # <Category Name> : <save_path>  # Path of your save directory.
  tv_completed: /data/completed/tv_shows/
  movies_completed: /data/completed/movies/
  books_completed: /data/completed/ebooks/
  music_completed: /data/completed/music/

cat_change:
  # This moves all the torrents from one category to another category. This executes on --cat-update
  # WARNING: if the paths are different and Default Torrent Management Mode is set to automatic the files could be moved !!!
  # <Old Category Name> : <New Category>
  tv_sonarr.cross-seed: tv_completed
  tv_completed.cross-seed: tv_completed
  movies_radarr.cross-seed: movies_completed
  movies_completed.cross-seed: movies_completed
  music_lidarr.cross-seed: music_completed
  music_completed.cross-seed: music_completed

tracker:
  # Mandatory
  # Tag Parameters
  # <Tracker URL Keyword>:    # <MANDATORY> This is the keyword in the tracker url
  # <MANDATORY> Set tag name. Can be a list of tags or a single tag
  #   tag: <Tag Name>
  # <OPTIONAL> Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading. -2 means the global limit should be used, -1 means no limit.
  #   max_ratio: 5.0
  # <OPTIONAL> Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding. -2 means the global limit should be used, -1 means no limit.
  #   max_seeding_time: 129600
  # <OPTIONAL> Will ensure that noHL torrents from this tracker are not deleted by cleanup variable if torrent has not yet met the minimum seeding time (min).
  #   min_seeding_time: 2000
  # <OPTIONAL> Will limit the upload speed KiB/s (KiloBytes/second) (-1 means no limit)
  #   limit_upload_speed: 150
  # <OPTIONAL> Set this to the notifiarr react name. This is used to add indexer reactions to the notifications sent by Notifiarr
  #   notifiarr: <notifiarr indexer>
  avistaz:
    tag:
    - Avistaz
    max_ratio: 5.0
    max_seeding_time: 129600
    min_seeding_time: 30400
    limit_upload_speed: 150
    notifiarr: avistaz

  alpharatio:
    tag: AlphaRatio
    max_ratio: -1
    max_seeding_time: -1

  aither:
    tag: Aither
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 7200

  beyond-hd:
    tag: Beyond-HD

  blutopia:
    tag: Blutopia
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 10080 # 7 days

  cartoonchaos:
    tag: CartoonChaos

  digitalcore:
    tag: DigitalCore

  gazellegames:
    tag: GGn

  filelist.io:
    tag: FileList
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 2880

  flro.org:
    tag: FileList
    max_seeding_time: -1
    max_ratio: -1

  hdts:
    tag: HDTorrents
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 2880 # 48 hours

  landof.tv:
    tag: BroadcasTheNet

  lst.gg:
    tag: LST
    min_seeding_time: 7200 # 5 days

  myanonamouse:
    tag: MaM
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 4320

  passthepopcorn:
    tag: PassThePopcorn
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 2880 # 48 hours

  privatehd:
    tag: PrivateHD
    notifiarr:

  tleechreload:
    tag: TorrentLeech
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 11520 # 8 days

  torrentleech:
    tag: TorrentLeech
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 11520 # 8 days

  tv-vault:
    tag: TV-Vault

  bgp.technology:
    tag: IPTorrents
    max_seeding_time: -1
    max_ratio: -1

  empirehost.me:
    tag: IPTorrents
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 20160

  stackoverflow.tech:
    tag: IPTorrents
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 20160

  scenetime:
    tag: SceneTime
    max_seeding_time: -1
    max_ratio: -1
    min_seeding_time: 4320 # 72 hours

  nebulance:
    tag: Nebulance
    min_seeding_time: 86000
    max_seeding_time: -1
    max_ratio: -1

  rarbg.me:
    tag: RARBG
    max_seeding_time: 2
    max_ratio: .01

  speed.connecting.center:
    tag: Speed.CD
    max_seeding_time: -1
    max_ratio: -1

  # The "other" key is a special keyword and if defined will tag any other trackers that don't match the above trackers into this tag
  other:
    tag: other
    max_seeding_time: 2
    max_ratio: .01

nohardlinks:
  # Tag Movies/Series that are not hard linked
  # Mandatory to fill out directory parameter above to use this function (root_dir/remote_dir)
  # This variable should be set to your category name of your completed movies/completed series in qbit. Acceptable variable can be any category you would like to tag if there are no hardlinks found
  movies_completed:
    # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category.
    exclude_tags:
    - PassThePopcorn
    # <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that have a noHL tag and meets share limits

    cleanup: true

    # <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading.
    # Delete this key from a category's config to use the tracker's configured max_ratio. Will default to -1 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.
    max_ratio: -1
    # <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding.
    # Delete this key from a category's config to use the tracker's configured max_seeding_time. Will default to -1 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.

    max_seeding_time: 30240 # 3 weeks

    # <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
    limit_upload_speed: -1

    # <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
    # Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.

    min_seeding_time: 30240
    # <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after changing share limits
    resume_torrent_after_untagging_noHL: true

  # Can have additional categories set with separate ratio/seeding times defined.
  tv_completed:
    # <OPTIONAL> exclude_tags var: Will exclude torrents with any of the following tags when searching through the category.
    exclude_tags:
    # <OPTIONAL> cleanup var: WARNING!! Setting this as true Will remove and delete contents of any torrents that have a noHL tag and meets share limits
    cleanup: true
    # <OPTIONAL> max_ratio var: Will set the torrent Maximum share ratio until torrent is stopped from seeding/uploading.
    # Delete this key from a category's config to use the tracker's configured max_ratio. Will default to -1 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.
    max_ratio: -1
    # <OPTIONAL> max seeding time var: Will set the torrent Maximum seeding time (min) until torrent is stopped from seeding.
    # Delete this key from a category's config to use the tracker's configured max_seeding_time. Will default to -1 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.
    max_seeding_time: 30240
    # <OPTIONAL> Limit Upload Speed var: Will limit the upload speed KiB/s (KiloBytes/second) (`-1` : No Limit)
    limit_upload_speed: -1
    # <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
    # Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the category or tracker.
    # Uses the larger value of the noHL Category or Tracker specific setting.
    min_seeding_time: 30240
    # <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after changing share limits
    resume_torrent_after_untagging_noHL: true

  books_completed:
    exclude_tags:
    - MaM
    cleanup: true
    max_ratio: -1
    max_seeding_time: 60480
    limit_upload_speed: -1
    min_seeding_time: 43200
    resume_torrent_after_untagging_noHL: true

  music_completed:
    exclude_tags:
    cleanup: true
    max_ratio: -1
    max_seeding_time: 60480
    limit_upload_speed: -1
    min_seeding_time: 43200
    resume_torrent_after_untagging_noHL: true

recyclebin:
  # Recycle Bin method of deletion will move files into the recycle bin (Located in /root_dir/.RecycleBin) instead of directly deleting them in qbit
  # By default the Recycle Bin will be emptied on every run of the qbit_manage script if empty_after_x_days is defined.
  enabled: true
  # <OPTIONAL> empty_after_x_days var:
  # Will automatically remove all files and folders in recycle bin after x days. (Checks every script run)
  # If this variable is not defined it, the RecycleBin will never be emptied.
  # WARNING: Setting this variable to 0 will delete all files immediately upon script run!
  empty_after_x_days: 60
  # <OPTIONAL> save_torrents var:
  # If this option is set to true you MUST fill out the torrents_dir in the directory attribute.
  # This will save a copy of your .torrent and .fastresume file in the recycle bin before deleting it from qbittorrent
  save_torrents: true
  # <OPTIONAL> split_by_category var:
  # This will split the recycle bin folder by the save path defined in the `cat` attribute
  # and add the base folder name of the recycle bin that was defined in the `recycle_bin` sub-attribute under directory.
  split_by_category: false

orphaned:
  # Orphaned files are those in the root_dir download directory that are not referenced by any active torrents.
  # Will automatically remove all files and folders in orphaned data after x days. (Checks every script run)
  # If this variable is not defined it, the orphaned data will never be emptied.
  # WARNING: Setting this variable to 0 will delete all files immediately upon script run!
  empty_after_x_days: 60
  # File patterns that will not be considered orphaned files. Handy for generated files that aren't part of the torrent but belong with the torrent's files
  exclude_patterns:
  - '**/.DS_Store'
  - '**/Thumbs.db'
  - '**/@eaDir'
  - '**/_unpackerred'
  - '**/*.!qB'

apprise:
  # Apprise integration with webhooks
  # Leave Empty/Blank to disable
  # Mandatory to fill out the url of your apprise API endpoint
  api_url: http://10.66.0.223:8000/
  # Mandatory to fill out the notification url/urls based on the notification services provided by apprise. https://github.com/caronc/apprise/wiki
  notify_url: pover://<REDACTED>

#notifiarr:
  # Notifiarr integration with webhooks
  # Leave Empty/Blank to disable
  # Mandatory to fill out API Key
  #apikey: <REDACTED>
  # <OPTIONAL> Set to a unique value (could be your username on notifiarr for example)
  #instance:

webhooks:
  # Webhook notifications:
  # Possible values:
  # Set value to notifiarr if using notifiarr integration
  # Set value to apprise if using apprise integration
  # Set value to a valid webhook URL
  # Set value to nothing (leave Empty/Blank) to disable
  error: apprise
  run_start: #apprise
  run_end: #apprise
  function:
    cross_seed: apprise
    recheck: apprise
    cat_update: apprise
    tag_update: apprise
    rem_unregistered: apprise
    tag_tracker_error: apprise
    rem_orphaned: apprise
    tag_nohardlinks: apprise
    cleanup_dirs: apprise

Logs

https://gist.githubusercontent.com/mlamoure/f045d22ddba166c1b8fa5262962b4c34/raw/a125e58adad3f5cd125bf98701adb7b44a708c42/gistfile1.txt

Screenshots

No response

Installation

Unraid

Version Number

3.6.2

What branch are you on?

master

@mlamoure mlamoure added the bug Something isn't working label May 2, 2023
@bobokun
Copy link
Collaborator

bobokun commented May 21, 2023

I'm not able to reproduce this issue. By default qbit-manage should not delete the data if you have an existing torrent with the same name. Does this happen frequently? I have a feeling it might be a coincidence that the cross seed torrent got injected while qbit manage was in the middle of a run so it did not detect that the cross seed torrent was there.

@mlamoure
Copy link
Author

I have not seen it happen again. I can keep an eye out and report back.

@bobokun bobokun added the status:added-to-develop Feature Request or Bug Fix is in Develop label May 22, 2023
@bobokun bobokun mentioned this issue May 24, 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