linuxserver / docker-bazarr

GNU General Public License v3.0
232 stars 29 forks source link

[BUG] Bazarr crash on start sqlalchemy issue #139

Open dracossan opened 1 month ago

dracossan commented 1 month ago

Is there an existing issue for this?

Current Behavior

On the past maybe 2 or 3 latest upgrade, bazarr crash on start using postgresql backend. System before upgrade was working fine.

Expected Behavior

dont crash

Steps To Reproduce

latest fedora server 40 os with docker swarm installed, latest dnf update postgress14 on docker installed configure bazarr with postgress back end.

Environment

config.yaml:
---
addic7ed:
  cookies: ''
  password: ''
  user_agent: ''
  username: ''
  vip: false
analytics:
  enabled: true
anidb:
  api_client: ''
  api_client_ver: 1
animetosho:
  anidb_api_client: ''
  anidb_api_client_ver: 1
  search_threshold: 6
anticaptcha:
  anti_captcha_key: ''
assrt:
  token: ''
auth:
  apikey: xxx
  password: xxx
  type: null
  username: admin
avistaz:
  cookies: ''
  user_agent: ''
backup:
  day: 6
  folder: /config/backup
  frequency: Daily
  hour: 3
  retention: 31
betaseries:
  token: ea76850906b5
cinemaz:
  cookies: ''
  user_agent: ''
cors:
  enabled: true
deathbycaptcha:
  password: ''
  username: ''
embeddedsubtitles:
  fallback_lang: en
  hi_fallback: false
  included_codecs: []
  timeout: 600
  unknown_as_fallback: false
general:
  adaptive_searching: true
  adaptive_searching_delay: 4w
  adaptive_searching_delta: 3w
  anti_captcha_provider: null
  auto_update: true
  base_url: ''
  branch: development
  chmod: '0777'
  chmod_enabled: true
  days_to_upgrade_subs: 30
  debug: false
  default_und_audio_lang: ''
  default_und_embedded_subtitles_lang: ''
  dont_notify_manual_actions: false
  embedded_subs_show_desired: true
  embedded_subtitles_parser: mediainfo
  enabled_integrations: []
  enabled_providers:
  - opensubtitlescom
  - tvsubtitles
  - embeddedsubtitles
  - soustitreseu
  - subsynchro
  - supersubtitles
  - wizdom
  - yifysubtitles
  - betaseries
  flask_secret_key: f2e0f80684369ed8cc9db4cd7246f1e6
  hi_extension: hi
  ignore_ass_subs: true
  ignore_pgs_subs: true
  ignore_vobsub_subs: true
  ip: 0.0.0.0
  language_equals: []
  minimum_score: 90
  minimum_score_movie: 70
  movie_default_enabled: true
  movie_default_profile: 1
  movie_tag_enabled: false
  multithreading: true
  page_size: 25
  page_size_manual_search: 10
  parse_embedded_audio_track: true
  port: 6767
  postprocessing_cmd: ''
  postprocessing_threshold: 90
  postprocessing_threshold_movie: 70
  serie_default_enabled: true
  serie_default_profile: 1
  serie_tag_enabled: false
  single_language: false
  skip_hashing: false
  subfolder: current
  subfolder_custom: ''
  subzero_mods: OCR_fixes,common,remove_tags
  theme: dark
  upgrade_frequency: 24
  upgrade_manual: true
  upgrade_subs: true
  use_embedded_subs: true
  use_postprocessing: false
  use_postprocessing_threshold: false
  use_postprocessing_threshold_movie: false
  use_radarr: true
  use_scenename: true
  use_sonarr: true
  utf8_encode: true
  wanted_search_frequency: 24
  wanted_search_frequency_movie: 24
hdbits:
  passkey: ''
  username: ''
karagarga:
  f_password: ''
  f_username: ''
  password: ''
  username: ''
ktuvit:
  email: ''
  hashed_password: ''
legendasdivx:
  password: ''
  skip_wrong_fps: false
  username: ''
legendastv:
  featured_only: false
  password: ''
  username: ''
log:
  exclude_filter: ''
  ignore_case: false
  include_filter: ''
  use_regex: false
movie_scores:
  audio_codec: 3
  edition: 1
  hash: 119
  hearing_impaired: 1
  release_group: 13
  resolution: 2
  source: 7
  streaming_service: 1
  title: 60
  video_codec: 2
  year: 30
napisy24:
  password: ''
  username: ''
opensubtitles:
  password: xxxxxxxx
  skip_wrong_fps: true
  ssl: false
  timeout: 15
  use_tag_search: false
  username: xxxxxxx
  vip: false
opensubtitlescom:
  include_ai_translated: false
  password: xxxxxxx
  use_hash: true
  username: xxxxxx
podnapisi:
  verify_ssl: true
postgresql:
  database: bazarrus
  enabled: true
  host: pgsql14
  password: bazarrus
  port: 5432
  username: bazarrus
proxy:
  exclude:
  - localhost
  - 127.0.0.1
  password: ''
  port: ''
  type: null
  url: ''
  username: ''
radarr:
  apikey: 45fb6e0ece4e4e21a2e6a4c39546ab6d
  base_url: ''
  defer_search_signalr: true
  excluded_tags: []
  full_update: Daily
  full_update_day: 6
  full_update_hour: 6
  http_timeout: 60
  ip: radarrus
  movies_sync: 1440
  only_monitored: false
  port: 7878
  ssl: false
  sync_only_monitored_movies: false
  use_ffprobe_cache: true
series_scores:
  audio_codec: 3
  episode: 30
  hash: 359
  hearing_impaired: 1
  release_group: 14
  resolution: 2
  season: 30
  series: 180
  source: 7
  streaming_service: 1
  video_codec: 2
  year: 90
sonarr:
  apikey: 1bb8c6b312074af889e75a1b770f793f
  base_url: ''
  defer_search_signalr: false
  episodes_sync: 1440
  exclude_season_zero: false
  excluded_series_types: []
  excluded_tags: []
  full_update: Daily
  full_update_day: 6
  full_update_hour: 10
  http_timeout: 60
  ip: sonarrus
  only_monitored: false
  port: 8989
  series_sync: 1440
  ssl: false
  sync_only_monitored_episodes: false
  sync_only_monitored_series: false
  use_ffprobe_cache: true
subdl:
  api_key: ''
subf2m:
  user_agent: ''
  verify_ssl: false
subscene:
  password: ''
  username: ''
subsync:
  checker:
    blacklisted_languages: []
    blacklisted_providers: []
  debug: false
  force_audio: true
  gss: true
  max_offset_seconds: 60
  no_fix_framerate: false
  subsync_movie_threshold: 70
  subsync_threshold: 90
  use_subsync: true
  use_subsync_movie_threshold: false
  use_subsync_threshold: false
titlovi:
  password: ''
  username: ''
titulky:
  approved_only: false
  password: ''
  username: ''
whisperai:
  endpoint: http://127.0.0.1:9000
  loglevel: INFO
  response: 5
  timeout: 3600
xsubs:
  password: ''
  username: ''

CPU architecture

x86-64

Docker creation

version: "3.9"

networks:
  traefik-public:
    external: true
  backend:
    external: true

volumes:
  bazarr_cifs_truenas01_config:
   xxxxxxxxxx

services:
  bazarrus:
    image: lscr.io/linuxserver/bazarr:development
    environment:
      - PUID=3000
      - PGID=3000
    volumes:
       - bazarr_cifs_truenas01_config:/config
    networks:
      - backend
      - traefik-public
    deploy:
      replicas: 1
      placement:
        max_replicas_per_node: 1
        constraints:
          - node.role == worker
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: any
        delay: 10s
        max_attempts: 0
        window: 1m
      labels:
        - "autoresfresh=true"
        - "traefik.enable=true"
        - "traefik.docker.network=traefik-public"
      # Server Port Access
        - "traefik.http.services.bazarrus.loadbalancer.server.port=6767"
      # Server HTTP Access
        - "traefik.http.routers.bazarrus-http.entrypoints=web"
        - "traefik.http.routers.bazarrus-http.rule=Host(`bazarrus.domain.com`)"
        - "traefik.http.routers.bazarrus-http.service=bazarrus"
      # Server HTTPS Access
        - "traefik.http.routers.bazarrus-https.entrypoints=websecure"
        - "traefik.http.routers.bazarrus-https.rule=Host(`bazarrus.domain.com`)"
        - "traefik.http.routers.bazarrus-https.tls.certresolver=cloudflaresproduction"
        - "traefik.http.routers.bazarrus-https.tls=true"
        - "traefik.http.routers.bazarrus-https.service=bazarrus"
      # Server HTTP -> HTTPS
        - "traefik.http.middlewares.bazarrus-redirect-web-secure.redirectscheme.scheme=https"
        - "traefik.http.middlewares.bazarrus-redirect-web-secure.redirectscheme.permanent=true"
        - "traefik.http.routers.bazarrus-http.middlewares=bazarrus-redirect-web-secure"
      # Wildcard Domain
        - "traefik.http.routers.bazarrus-https.tls.domains[0].main=domain.com"
        - "traefik.http.routers.bazarrus-https.tls.domains[0].sans=*.domain.com"
        - "traefik.http.routers.bazarrus-https.tls.domains[1].main=domain.com"
        - "traefik.http.routers.bazarrus-https.tls.domains[1].sans=*.domain.com"
      # Middleware Authentik
        - "traefik.http.routers.bazarrus-https.middlewares=authentik"
        - "traefik.http.routers.bazarrus-http.middlewares=authentik"

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝
   Brought to you by linuxserver.io
───────────────────────────────────────
To support the app dev(s) visit:
Bazarr: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XHHRWXT9YB7WE&source=url
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    3000
User GID:    3000
───────────────────────────────────────
Linuxserver.io version: v1.4.4-beta.27-ls619
Build-date: 2024-07-30T21:24:17+00:00
───────────────────────────────────────

[custom-init] No custom files found, skipping...
/app/bazarr/bin/bazarr/../custom_libs/subzero/language.py:165: SyntaxWarning: invalid escape sequence '\.'
  IETF_MATCH = ".+\.([^-.]+)(?:-[A-Za-z]+)?$"
/app/bazarr/bin/bazarr/../custom_libs/subzero/language.py:166: SyntaxWarning: invalid escape sequence '\.'
  ENDSWITH_LANGUAGECODE_RE = re.compile("\.([^-.]{2,3})(?:-[A-Za-z]{2,})?$")
/app/bazarr/bin/bazarr/../custom_libs/subzero/language.py:170: SyntaxWarning: invalid escape sequence '\.'
  language_match = re.match(".+\.([^\.]+)$" if not ietf
Connection to localhost (127.0.0.1) 6767 port [tcp/*] succeeded!
[ls.io-init] done.
/app/bazarr/bin/bazarr/../libs/alembic/ddl/postgresql.py:187: UserWarning: autoincrement and existing_autoincrement only make sense for MySQL
  super().alter_column(
Traceback (most recent call last):
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1960, in _exec_single_context
    self.dialect.do_execute(
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/default.py", line 924, in do_execute
    cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column table_languages_profiles.tag does not exist
LINE 1: ...tain", table_languages_profiles."originalFormat", table_lang...
                                                             ^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/bazarr/bin/bazarr/main.py", line 52, in <module>
    upgrade_languages_profile_hi_values()
  File "/app/bazarr/bin/bazarr/app/database.py", line 508, in upgrade_languages_profile_hi_values
    for languages_profile in (database.execute(
                              ^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/orm/scoping.py", line 778, in execute
    return self._proxied.execute(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/orm/session.py", line 2306, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/orm/session.py", line 2191, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/orm/context.py", line 293, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1408, in execute
    return meth(
           ^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/sql/elements.py", line 513, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1630, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1839, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1979, in _exec_single_context
    self._handle_dbapi_exception(
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 2335, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/base.py", line 1960, in _exec_single_context
    self.dialect.do_execute(
  File "/app/bazarr/bin/bazarr/../libs/sqlalchemy/engine/default.py", line 924, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column table_languages_profiles.tag does not exist
LINE 1: ...tain", table_languages_profiles."originalFormat", table_lang...
                                                             ^
[SQL: SELECT table_languages_profiles."profileId", table_languages_profiles.name, table_languages_profiles.cutoff, table_languages_profiles.items, table_languages_profiles."mustContain", table_languages_profiles."mustNotContain", table_languages_profiles."originalFormat", table_languages_profiles.tag 
FROM table_languages_profiles]
(Background on this error at: https://sqlalche.me/e/20/f405)
github-actions[bot] commented 1 month ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

dracossan commented 1 month ago

same issue: https://github.com/morpheus65535/bazarr/issues/2592

LinuxServer-CI commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.