Kometa-Team / ImageMaid

Python 3 Script for Cleaning Up Images in Plex
MIT License
306 stars 16 forks source link

Docker - Directory Error: Plex Databases Directory Not Found: /home/docker/media-services/plex/data #51

Open ithinktech opened 6 months ago

ithinktech commented 6 months ago

Version Number

1.0.2

What branch are you on?

master

Describe the Bug

Compose File:

# Plex Image Clean-up
  plex-image-cleanup:
    image: meisnate12/plex-image-cleanup
    container_name: plex-image-cleanup
    environment:
      - TZ=${TZ}
    volumes:
      - ${CONTAINER_DATA}/plex/data/image-cleanup/config:/config
      - ${CONTAINER_DATA}/plex/data/config:/plex
    restart: unless-stopped

.env file

PLEX_PATH="/home/docker/media-services/plex/data"
MODE=report
SCHEDULE=
PLEX_URL=http://192.168.1.1:32400
PLEX_TOKEN=b84d9ef7a7bc9c24606c3d4f2b5acddea9123456
DISCORD=https://discord.com/api/webhooks/###################/####################################################################
TIMEOUT=600
SLEEP=60
IGNORE_RUNNING=False
LOCAL_DB=False
USE_EXISTING=False
PHOTO_TRANSCODER=False
EMPTY_TRASH=False
CLEAN_BUNDLES=False
OPTIMIZE_DB=False
TRACE=False
LOG_REQUESTS=False

Docker Log

|====================================================================================================|
|        ____  _             __  __      _          __  __                                           |
|       |  _ \| | _____  __ |  \/  | ___| |_ __ _  |  \/  | __ _ _ __   __ _  __ _  ___ _ __         |
|       | |_) | |/ _ \ \/ / | |\/| |/ _ \ __/ _` | | |\/| |/ _` | '_ \ / _` |/ _` |/ _ \ '__|        |
|       |  __/| |  __/>  <  | |  | |  __/ || (_| | | |  | | (_| | | | | (_| | (_| |  __/ |           |
|       |_|   |_|\___/_/\_\ |_|  |_|\___|\__\__,_| |_|  |_|\__,_|_| |_|\__,_|\__, |\___|_|           |
|                                                                            |___/                   |
|                                         Plex Image Cleanup                                         |
|                                                                                                    |
|     Version: 1.0.2 (Docker)                                                                        |
|     Platform: Linux-6.8.0-31-generic-x86_64-with-glibc2.28                                         |
|     Memory: 8 GB                                                                                   |
|====================================================================================================|
| Run Command: plex_image_cleanup.py                                                                 |
| --plex (PLEX_PATH): /home/docker/media-services/plex/data                                          |
| --mode (MODE): report                                                                              |
| --schedule (SCHEDULE):                                                                             |
| --url (PLEX_URL): (redacted)                                                                       |
| --token (PLEX_TOKEN): (redacted)                                                                   |
| --discord (DISCORD): (redacted)                                                                    |
| --timeout (TIMEOUT): 600                                                                           |
| --sleep (SLEEP): 60                                                                                |
| --ignore (IGNORE_RUNNING): False                                                                   |
| --local (LOCAL_DB): False                                                                          |
| --existing (USE_EXISTING): False                                                                   |
| --photo-transcoder (PHOTO_TRANSCODER): False                                                       |
| --empty-trash (EMPTY_TRASH): False                                                                 |
| --clean-bundles (CLEAN_BUNDLES): False                                                             |
| --optimize-db (OPTIMIZE_DB): False                                                                 |
| --trace (TRACE): False                                                                             |
| --log-requests (LOG_REQUESTS): False                                                               |
|======================================== Validating Options ========================================|
| Running in Report Mode                                                                             |
| Discord URL Error: (404 [Not Found]) {'message': '404: Not Found', 'code': 0}                      |
| Report: Metadata Directory File changes will be reported but not performed.                        |
|====================================================================================================|
| Directory Error: Plex Databases Directory Not Found: /home/docker/media-services/plex/data         |
|====================================================================================================|
|====================================================================================================|
|                                            Error Report                                            |
|====================================================================================================|
|                                                                                                    |
| Generic Errors:                                                                                    |
|   Discord URL Error: (404 [Not Found]) {'message': '404: Not Found', 'code': 0}                    |
|====================================================================================================|
|                                          Critical Report                                           |
|====================================================================================================|
|                                                                                                    |
| Generic Criticals:                                                                                 |
|   Directory Error: Plex Databases Directory Not Found: /home/docker/media-services/plex/data       |
|====================================================================================================|
|                                     Plex Image Cleanup Summary                                     |
|====================================================================================================|
| Running in Report Mode                                                                             |
|=================================== Plex Image Cleanup Finished ====================================|
| Total Runtime      | 0:00:00                                                                       |
|====================================================================================================|

### Logs

_No response_
INIGHub commented 4 months ago

Did you ever find resolution to this issue? I am having the same problem.

I have tried:

TopperBG commented 4 months ago

For me that works without any issues: kometateam/imagemaid:develop -v "/pms/config/Library/Application Support/Plex Media Server:/plex:rw"

INIGHub commented 4 months ago

Thanks for the reply. This gave me what I needed. For others who may need this.

Not Working: Originally, I mapped plex to the base plex directory ie: /[docker]/plex/conf:/plex With the configuration directive of - PLEX_PATH="/[docker]/plex/database/Library/Application\ Support/Plex\ Media\ Server"

Bad example from docker-compose.yml

environment:
  - PLEX_PATH="/docker/plex/database/Library/Application\ Support/Plex\ Media\ Server"
  - MODE=report     #Metadata Directory File changes will be reported but not performed.

volumes:
  - /docker/pmm-clean/conf:/config
  - /docker/plex/conf:/plex

Working: I just used the proper drive mapping and removed the PLEX_PATH line

Working example from docker-compose.yml

environment:
  # - PLEX_PATH="/docker/plex/database/Library/Application\ Support/Plex\ Media\ Server"
  - MODE=report     #Metadata Directory File changes will be reported but not performed.

volumes:
  - /docker/pmm-clean/conf:/config
  - "/docker/plex/database/Library/Application\ Support/Plex\ Media\ Server:/plex"
thunderstorm654 commented 4 months ago

Thank you so much for this, just went round in circles for an hour before seeing this. The docs could be clearer, that you only need one of these to be populated - either in the compose file OR in the .env file, not both.

The example compose file should really be working with the sample env file otherwise it's a bit of a mess!

TopperBG commented 4 months ago

It's not about docs, you don't have any other way to interchange dirs between two containers.