Skip to content

ensure_backup_directory has a hard-coded path #742

@Gilrain

Description

@Gilrain

The ensure_backup_directory function in backup_routes.py tries to create a "data" folder using the installation path.

On a read only file system this results in a failed launch.

Creating a softlinked "data" folder under ~/.config/huntarr/ allows the program to start.

huntarr 8.2.10-1 on Arch Linux

Log:

OSError: [Errno 30] Read-only file system: '/usr/share/webapps/huntarr/data'
    ~~~~~~~~^^^^^^^^^^^^
    os.mkdir(self, mode)
  File "/usr/lib/python3.13/pathlib/_local.py", line 722, in mkdir
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.13/pathlib/_local.py", line 726, in mkdir
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    self.backup_dir.mkdir(parents=True, exist_ok=True)
  File "/usr/share/webapps/huntarr/src/routes/backup_routes.py", line 128, in ensure_backup_directory
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    self.ensure_backup_directory()
  File "/usr/share/webapps/huntarr/src/routes/backup_routes.py", line 104, in __init__
    backup_manager = BackupManager()
  File "/usr/share/webapps/huntarr/src/routes/backup_routes.py", line 445, in <module>
    from src.routes.backup_routes import backup_bp
  File "/usr/share/webapps/huntarr/src/primary/web_server.py", line 54, in <module>
    from primary.web_server import app
  File "/usr/share/webapps/huntarr/main.py", line 108, in <module>
Traceback (most recent call last):
During handling of the above exception, another exception occurred:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/webapps/huntarr/data/backups'
    ~~~~~~~~^^^^^^^^^^^^
    os.mkdir(self, mode)
  File "/usr/lib/python3.13/pathlib/_local.py", line 722, in mkdir
Traceback (most recent call last):
CRITICAL:HuntarrRoot:Fatal Error: An unexpected error occurred during initial imports: [Errno 30] Read-only file system: '/usr/share/webapps/huntarr/data'
ERROR:src.routes.backup_routes:Failed to create backup directory: [Errno 30] Read-only file system: '/usr/share/webapps/huntarr/data'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions