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

Backup cannot be restored #2850

Open
cryptolukas opened this issue Feb 16, 2025 · 8 comments
Open

Backup cannot be restored #2850

cryptolukas opened this issue Feb 16, 2025 · 8 comments

Comments

@cryptolukas
Copy link

Describe the bug
Backup cannot be restored

To Reproduce
Steps to reproduce the behavior:

  1. Add backup to the /opt/bazarr/data/backup/
  2. try to restore in the web ui
  3. the logfile print an error

Expected behavior
I expect a backup can be restored

Screenshots
If applicable, add screenshots to help explain your problem.

Software (please complete the following information):

  • Bazarr: [e.g. v1.4.5 & 1.5.1]
  • OS: [e.g. Debian 12]

Additional context

python3 bazarr.py
Bazarr starting child process with PID 28461...
2025-02-16 16:14:29,258 - waitress                         (7f3842dc2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-02-16 16:14:29,260 - waitress                         (7f3842dc2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Closing database...
Closing webserver...
2025-02-16 16:18:40,963 - root                             (7f37cffc76c0) :  INFO (central:56) - Bazarr is being restarted...
Deleting restart file...
Terminating child process with PID 28461
Bazarr is restarting...
Bazarr starting child process with PID 28779...
ERROR:root:Unable to delete /opt/bazarr/data/db/bazarr.db
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/utilities/backup.py", line 131, in restore_from_backup
    os.remove(restore_database_path)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/bazarr/data/restore/bazarr.db'
2025-02-16 16:18:48,223 - waitress                         (7f53865d2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-02-16 16:18:48,224 - waitress                         (7f53865d2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Deleting restart file...
Terminating child process with PID 28779
Bazarr is restarting...
Bazarr starting child process with PID 28889...
2025-02-16 16:18:52,406 - root                             (7f6706921040) :  ERROR (server:59) - BAZARR cannot bind to specified TCP port, trying with default (6767)
2025-02-16 16:18:52,527 - root                             (7f6706921040) :  ERROR (server:64) - BAZARR cannot bind to default TCP port (6767) because it's already in use, exiting...
Closing database...
Closing webserver...
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/app/server.py", line 46, in configure_server
    self.server = create_server(app,
                  ^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 78, in create_server
    last_serv = TcpWSGIServer(
                ^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 243, in __init__
    self.bind_server_socket()
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 364, in bind_server_socket
    self.bind(sockaddr)
  File "/opt/bazarr/bazarr/../libs/waitress/wasyncore.py", line 395, in bind
    return self.socket.bind(addr)
           ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bazarr/bazarr/main.py", line 43, in <module>
    from app.server import webserver, app  # noqa E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 108, in <module>
    webserver = Server()
                ^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 42, in __init__
    self.configure_server()
  File "/opt/bazarr/bazarr/app/server.py", line 66, in configure_server
    self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
  File "/opt/bazarr/bazarr/app/server.py", line 100, in shutdown
    self.close_all()
  File "/opt/bazarr/bazarr/app/server.py", line 97, in close_all
    self.server.close()
    ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'
@morpheus65535
Copy link
Owner

Could be fixed in upcoming beta. Can you test and confirm please?

@cryptolukas
Copy link
Author

Can give you an update in the next hours

@morpheus65535
Copy link
Owner

Upcoming beta will be released tonight so you'll be able to install it tomorrow.

@cryptolukas
Copy link
Author

A error appear again.
Checked the backup file again. The file is not empty.

root@bazarr:/opt/bazarr/data/backup# unzip -l bazarr_backup_v1.4.5_2024.10.30_07.15.38.zip 
Archive:  bazarr_backup_v1.4.5_2024.10.30_07.15.38.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 89202688  2024-10-30 07:15   bazarr.db
     5359  2024-10-30 06:53   config.yaml
---------                     -------
 89208047                     2 files
root@bazarr:/opt/bazarr# python3 -m pip install -r requirements.txt
Ignoring pywin32: markers 'platform_system == "Windows"' don't match your environment
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (66.1.1)
Requirement already satisfied: lxml<5.0.0,>=4.3.0 in /usr/local/lib/python3.11/dist-packages (from -r requirements.txt (line 2)) (4.9.4)
Requirement already satisfied: numpy>=1.12.0 in /usr/local/lib/python3.11/dist-packages (from -r requirements.txt (line 3)) (2.2.3)
Requirement already satisfied: webrtcvad-wheels>=2.0.10 in /usr/local/lib/python3.11/dist-packages (from -r requirements.txt (line 4)) (2.0.14)
Requirement already satisfied: Pillow>=9.0.0 in /usr/local/lib/python3.11/dist-packages (from -r requirements.txt (line 5)) (11.1.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@bazarr:/opt/bazarr# python3 
bazarr/      bazarr.py    custom_libs/ frontend/    libs/        migrations/  
root@bazarr:/opt/bazarr# python3 bazarr.py 
Bazarr starting child process with PID 33070...
Closing database...
Closing webserver...
2025-02-23 08:34:11,954 - root                             (7fb6502b7040) :  INFO (central:56) - Bazarr is being restarted...
2025-02-23 08:34:12,689 - waitress                         (7fb6502b7040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-02-23 08:34:12,690 - waitress                         (7fb6502b7040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Deleting restart file...
Terminating child process with PID 33070
Bazarr is restarting...
Bazarr starting child process with PID 33208...
2025-02-23 08:34:19,755 - waitress                         (7fea56519040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-02-23 08:34:19,756 - waitress                         (7fea56519040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Closing database...
Closing webserver...
2025-02-23 08:35:16,463 - root                             (7fe9f17da6c0) :  INFO (central:56) - Bazarr is being restarted...
Deleting restart file...
Terminating child process with PID 33208
Bazarr is restarting...
Bazarr starting child process with PID 33345...
ERROR:root:Unable to delete /opt/bazarr/data/db/bazarr.db
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/utilities/backup.py", line 131, in restore_from_backup
    os.remove(restore_database_path)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/bazarr/data/restore/bazarr.db'
2025-02-23 08:35:22,608 - waitress                         (7f7ab0ce2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-02-23 08:35:22,609 - waitress                         (7f7ab0ce2040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Deleting restart file...
Terminating child process with PID 33345
Bazarr is restarting...
Bazarr starting child process with PID 33455...
2025-02-23 08:35:26,849 - root                             (7ff0e90ff040) :  ERROR (server:59) - BAZARR cannot bind to specified TCP port, trying with default (6767)
2025-02-23 08:35:26,975 - root                             (7ff0e90ff040) :  ERROR (server:64) - BAZARR cannot bind to default TCP port (6767) because it's already in use, exiting...
Closing database...
Closing webserver...
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/app/server.py", line 46, in configure_server
    self.server = create_server(app,
                  ^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 78, in create_server
    last_serv = TcpWSGIServer(
                ^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 243, in __init__
    self.bind_server_socket()
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 364, in bind_server_socket
    self.bind(sockaddr)
  File "/opt/bazarr/bazarr/../libs/waitress/wasyncore.py", line 395, in bind
    return self.socket.bind(addr)
           ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bazarr/bazarr/main.py", line 43, in <module>
    from app.server import webserver, app  # noqa E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 108, in <module>
    webserver = Server()
                ^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 42, in __init__
    self.configure_server()
  File "/opt/bazarr/bazarr/app/server.py", line 66, in configure_server
    self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
  File "/opt/bazarr/bazarr/app/server.py", line 100, in shutdown
    self.close_all()
  File "/opt/bazarr/bazarr/app/server.py", line 97, in close_all
    self.server.close()
    ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'

@morpheus65535
Copy link
Owner

This isn't nightly release. What exact version of Bazarr is this? This bug was fixed in 1.5.2-beta.19.

@cryptolukas
Copy link
Author

It was the beta. Sorry for the late reply.

   62  wget https://github.com/morpheus65535/bazarr/releases/download/v1.5.2-beta.19/bazarr.zip
   63  sudo unzip bazarr.zip -d /opt/bazarr
   64  cd bazarr/
   65  python3 -m pip install -r requirements.txt
   66  python3 bazarr.py

@cryptolukas
Copy link
Author

cryptolukas commented Mar 1, 2025

This is the result with beta.19
bazarr is installed on a virtual machine with only bazarr installed on debian.

root@bazarr:/opt/bazarr# python3 bazarr.py 
Bazarr starting child process with PID 945...
Closing database...
Closing webserver...
2025-03-01 08:29:40,582 - root                             (7fcb0c025040) :  INFO (central:56) - Bazarr is being restarted...
2025-03-01 08:29:41,295 - waitress                         (7fcb0c025040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-03-01 08:29:41,296 - waitress                         (7fcb0c025040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Deleting restart file...
Terminating child process with PID 945
Bazarr is restarting...
Bazarr starting child process with PID 1078...
2025-03-01 08:29:50,315 - waitress                         (7fa5b2e67040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-03-01 08:29:50,315 - waitress                         (7fa5b2e67040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Closing database...
Closing webserver...
2025-03-01 08:30:07,358 - root                             (7fa559ffb6c0) :  INFO (central:56) - Bazarr is being restarted...
Deleting restart file...
Terminating child process with PID 1078
Bazarr is restarting...
Bazarr starting child process with PID 1193...
ERROR:root:Unable to delete /opt/bazarr/data/db/bazarr.db
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/utilities/backup.py", line 131, in restore_from_backup
    os.remove(restore_database_path)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/bazarr/data/restore/bazarr.db'
2025-03-01 08:30:13,145 - waitress                         (7f8bd9bf5040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://0.0.0.0:6767
2025-03-01 08:30:13,146 - waitress                         (7f8bd9bf5040) :  INFO (wasyncore:485) - BAZARR is started and waiting for requests on: http://[::]:6767
Deleting restart file...
Terminating child process with PID 1193
Bazarr is restarting...
Bazarr starting child process with PID 1303...
2025-03-01 08:30:17,608 - root                             (7efcf7f4b040) :  ERROR (server:59) - BAZARR cannot bind to specified TCP port, trying with default (6767)
2025-03-01 08:30:17,733 - root                             (7efcf7f4b040) :  ERROR (server:64) - BAZARR cannot bind to default TCP port (6767) because it's already in use, exiting...
Closing database...
Closing webserver...
Traceback (most recent call last):
  File "/opt/bazarr/bazarr/app/server.py", line 46, in configure_server
    self.server = create_server(app,
                  ^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 78, in create_server
    last_serv = TcpWSGIServer(
                ^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 243, in __init__
    self.bind_server_socket()
  File "/opt/bazarr/bazarr/../libs/waitress/server.py", line 364, in bind_server_socket
    self.bind(sockaddr)
  File "/opt/bazarr/bazarr/../libs/waitress/wasyncore.py", line 395, in bind
    return self.socket.bind(addr)
           ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 98] Address already in use

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/bazarr/bazarr/main.py", line 43, in <module>
    from app.server import webserver, app  # noqa E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 108, in <module>
    webserver = Server()
                ^^^^^^^^
  File "/opt/bazarr/bazarr/app/server.py", line 42, in __init__
    self.configure_server()
  File "/opt/bazarr/bazarr/app/server.py", line 66, in configure_server
    self.shutdown(EXIT_PORT_ALREADY_IN_USE_ERROR)
  File "/opt/bazarr/bazarr/app/server.py", line 100, in shutdown
    self.close_all()
  File "/opt/bazarr/bazarr/app/server.py", line 97, in close_all
    self.server.close()
    ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'close'

Bash history

   88  rm -rf bazarr
   89  wget https://github.com/morpheus65535/bazarr/releases/download/v1.5.2-beta.19/bazarr.zip
   90  ll
   91  mv bazarr.zip.1 bazarr.zip
   92  unzip bazarr.zip -d /opt/bazarr
   93  ll bazarr
   94  ls bazarr
   95  cd bazarr/
   96  python3 -m pip install -r requirements.txt
   97  python3 bazarr.py

@morpheus65535
Copy link
Owner

Did you select Development as branch to use in Settings-->General? You can confirm the version you are running in System-->Status. My guess it that Bazarr is downgrading to 1.5.1 because you didn't select the proper branch in settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants