l3uddz / plex_autoscan

Script to assist sonarr/radarr with plex imports. Will only scan the folder that has been imported, instead of the whole library section.
GNU General Public License v3.0
395 stars 70 forks source link

Missing env in plex scanner call through docker #133

Open thel1988 opened 4 years ago

thel1988 commented 4 years ago

Describe the bug When the autoscan is initaing a scan through Docker it seems that Plex scanner is not able to scan as it is missing an enviromental variable: PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/config for plex scanner to function.

To Reproduce Steps to reproduce the behavior:

  1. When I try to reproduce the error, i will just try to run the following command: python scan.py sections --loglevel DEBUG and have added the DEBUG loglevel. In the log bellow docker -exec it seems that the variable is missing.

Logs Link to debug or trace log files.

 2020-01-14 14:20:47,778 -     INFO -      PLEX [23235231288648]: Using Plex Scanner

Plex Sections:
==============
 2020-01-14 14:20:47,778 -    DEBUG -      PLEX [23235231288648]: docker exec -u nobody -it binhex-plexpass bash -c 'export LD_LIBRARY_PATH=/usr/lib/plexmediaserver;/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list'
terminate called after throwing an instance of 'soci::soci_error'
  what():  sqlite3_statement_backend::prepare: no such column: library_sections.content_changed_at for SQL: select library_sections.id as 'library_sections_id', library_sections.library_id as 'library_sections_library_id', library_sections.name as 'library_sections_name', library_sections.name_sort as 'library_sections_name_sort', library_sections.section_type as 'library_sections_section_type', library_sections.language as 'library_sections_language', library_sections.agent as 'library_sections_agent', library_sections.scanner as 'library_sections_scanner', library_sections.user_thumb_url as 'library_sections_user_thumb_url', library_sections.user_art_url as 'library_sections_user_art_url', library_sections.user_theme_music_url as 'library_sections_user_theme_music_url', library_sections.created_at as 'library_sections_created_at', library_sections.updated_at as 'library_sections_updated_at', library_sections.scanned_at as 'library_sections_scanned_at', library_sections.user_fields as 'library_sections_user_fields', library_sections.query_xml as 'library_sections_query_xml', library_sections.query_type as 'library_sections_query_type', library_sections.uuid as 'library_sections_uuid', library_sections.changed_at as 'library_sections_changed_at', library_sections.content_changed_at as 'library_sections_content_changed_at' from library_sections
****** PLEX MEDIA SCANNER CRASHED, CRASH REPORT WRITTEN: /home/nobody/Library/Application Support/Plex Media Server/Crash Reports/1.18.4.2171-ac2afe5f8/PLEX MEDIA SCANNER/22f3c2a6-fa1a-dc99-2e29def9-792ee3ae.dmp
bash: line 1:  3465 Aborted                 /usr/lib/plexmediaserver/Plex\ Media\ Scanner --list

System Information

**Config https://pastebin.com/JKadXN0p