cbenning / fussel

A static photo gallery generator
https://github.com/cbenning/fussel
MIT License
260 stars 17 forks source link

Docker install error #28

Closed tehniemer closed 4 years ago

tehniemer commented 4 years ago

I'm getting this error when starting the container. Any idea what it means or how to correct it?

ImportError: cannot import name 'UnidentifiedImageError' from 'PIL' (/usr/lib/python3.8/site-packages/PIL/__init__.py)
cbenning commented 4 years ago

That's new. I suspect its an invalid image format that I didn't handle properly in the code. What type of files are you using?

tehniemer commented 4 years ago

It's all .jpg files with the exception of a single .txt file for another application that also uses the same directory.

edit: check that, there are a few .mp4 files in there as well.

tehniemer commented 4 years ago

I just tried changing the /input directory to one that only contains .jpg files and I get the same error.

cbenning commented 4 years ago

Is there more to the stack trace per chance?

cbenning commented 4 years ago

Looking at other instances of this error online, it might indicate an incorrectly installed "Pillow" library. Example: https://github.com/home-assistant/core/issues/32953

The error appears to be happening in the actual loading of Pillow and hasn't started actually processing the photos yet.

tehniemer commented 4 years ago

This is the whole log

today at 1:31 PM /
today at 1:32 PM /fussel /
today at 1:32 PM Using config:
today at 1:32 PM
today at 1:32 PM INPUT_PATH=/input
today at 1:32 PM HTTP_ROOT=https://fussel.domain.com/
today at 1:32 PM OVERWRITE=false
today at 1:32 PM PEOPLE_ENABLE=true
today at 1:32 PM WATERMARK_ENABLE=false
today at 1:32 PM WATERMARK_PATH=web/src/images/fussel-watermark.png
today at 1:32 PM WATERMARK_RATIO=0.3
today at 1:32 PM SITE_NAME=Fussel Gallery
today at 1:32 PM RECURSIVE_ALBUMS=true
today at 1:32 PM RECURSIVE_ALBUMS_NAME_PATTERN={parent_album} > {album}
today at 1:32 PM Traceback (most recent call last):
today at 1:32 PM File "./fussel.py", line 5, in <module>
today at 1:32 PM from generator import SiteGenerator
today at 1:32 PM File "/fussel/generator/__init__.py", line 1, in <module>
today at 1:32 PM from .generate import *
today at 1:32 PM File "/fussel/generator/generate.py", line 6, in <module>
today at 1:32 PM from PIL import Image, UnidentifiedImageError
today at 1:32 PM ImportError: cannot import name 'UnidentifiedImageError' from 'PIL' (/usr/lib/python3.8/site-packages/PIL/__init__.py)
today at 1:32 PM Fixing permissions...
today at 1:32 PM \nExtra docker instructions:
today at 1:32 PM To validate build run:
today at 1:32 PM python -m http.server --directory <your-output-mapping>
today at 1:32 PM /
today at 1:32 PM Container stopped
tehniemer commented 4 years ago

Here's the snippet from my compose file if that's of any use.

## Fussel - Image Gallery
  fussel:
    image: cbenning/fussel:latest
    container_name: fussel
    restart: unless-stopped
    networks:
      - proxy
    security_opt:
      - no-new-privileges:true
    ports:
      - "$FUSSEL_PORT:8000"
    environment:
      PUID: $PUID
      PGID: $PGID
      INPUT_PATH: "/input"
      HTTP_ROOT: "https://fussel.$DOMAINNAME/"
      OVERWRITE: "false"
      PEOPLE_ENABLE: "true"
      WATERMARK_ENABLE: "false"
      WATERMARK_PATH: "web/src/images/fussel-watermark.png"
      WATERMARK_RATIO: 0.3
      SITE_NAME: "Fussel Gallery"
      RECURSIVE_ALBUMS: "true"
      RECURSIVE_ALBUMS_NAME_PATTERN: "{parent_album} > {album}"
    volumes:
      - "fussel:/fussel/web/build"
      - "$PHOTO_DIR/_EXPORTS/Collections:/input:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
    labels:
      - "traefik.enable=false"
      ## HTTP Routers
      - "traefik.http.routers.fussel-rtr.entrypoints=https"
      - "traefik.http.routers.fussel-rtr.rule=HostHeader(`fussel.$DOMAINNAME`)"
      - "traefik.http.routers.fussel-rtr.tls=true"
      ## Middlewares
#      - "traefik.http.routers.fussel-rtr.middlewares=chain-no-auth@file" #No Authentication
#      - "traefik.http.routers.fussel-rtr.middlewares=chain-basic-auth@file" #Basic Authentication
#      - "traefik.http.routers.fussel-rtr.middlewares=chain-oauth@file" #Google OAuth 2.0
#      - "traefik.http.routers.fussel-rtr.middlewares=chain-organizr@file" #Organizr Authentication
      - "traefik.http.routers.fussel-rtr.middlewares=chain-authelia@file" #Authelia Authentication
      ## HTTP Services
      - "traefik.http.routers.fussel-rtr.service=fussel-svc"
      - "traefik.http.services.fussel-svc.loadbalancer.server.port=8000"
cbenning commented 4 years ago

I think I see the problem in the docker file

cbenning commented 4 years ago

It does seem like an issue with the Docker image itself. I've updated it now. Can you run: docker pull cbenning/fussel:latest and try again please?

Note: just a heads up. This container is intended to generate the gallery, not necessarily host it. (just looking at your docker-compose)

tehniemer commented 4 years ago

pulled the latest and I'm still getting the error.

I was lazy and just copied and pasted my format for the compose file, traefik is disabled for this container.

cbenning commented 4 years ago

Yeah I see how the pillow dependency is weird inside the image. Not sure how that happened, but ill get on it.

cbenning commented 4 years ago

@tehniemer can you please do another pull an try again? Pretty sure it's fixed now. Looks like pillow was kinda installed twice on there.

tehniemer commented 4 years ago

Looks like it's doing what it's supposed to now. Thanks for the quick work!

today at 3:21 PM /fussel /
today at 3:21 PM Using config:
today at 3:21 PM
today at 3:21 PM INPUT_PATH=/input
today at 3:21 PM HTTP_ROOT=https://fussel.domain.com/
today at 3:21 PM OVERWRITE=false
today at 3:21 PM PEOPLE_ENABLE=true
today at 3:21 PM WATERMARK_ENABLE=false
today at 3:21 PM WATERMARK_PATH=web/src/images/fussel-watermark.png
today at 3:21 PM WATERMARK_RATIO=0.3
today at 3:21 PM SITE_NAME=Fussel Gallery
today at 3:21 PM RECURSIVE_ALBUMS=true
today at 3:21 PM RECURSIVE_ALBUMS_NAME_PATTERN={parent_album} > {album}
today at 3:21 PM > Importing album /input/Lightpainting as 'Lightpainting'
today at 3:21 PM --> Processing /input/Lightpainting/20160216.0002.jpg...
today at 3:21 PM ----> Copying to '/fussel/web/public/static/_gallery/albums/Lightpainting/original_20160216.0002.jpg'
today at 3:21 PM ------> Generating photo sizes: 500x317 799x507 1024x649 1599x1014
today at 3:21 PM --> Processing /input/Lightpainting/20160216.0003.jpg...
today at 3:21 PM ----> Copying to '/fussel/web/public/static/_gallery/albums/Lightpainting/original_20160216.0003.jpg'
today at 3:21 PM ------> Generating photo sizes: 500x375 800x600 1024x768 1600x1200
today at 3:21 PM --> Processing /input/Lightpainting/20160216.0004.jpg...
today at 3:21 PM ----> Copying to '/fussel/web/public/static/_gallery/albums/Lightpainting/original_20160216.0004.jpg'
today at 3:21 PM ------> Generating photo sizes: 500x375 800x600 1024x768 1600x1200
today at 3:21 PM --> Processing /input/Lightpainting/20160216.0001.jpg...
today at 3:21 PM ----> Copying to '/fussel/web/public/static/_gallery/albums/Lightpainting/original_20160216.0001.jpg'
today at 3:21 PM ------> Generating photo sizes: 500x374 800x599 1024x767 1600x1199
today at 3:21 PM --> Processing /input/Lightpainting/20160216.0005.jpg...
today at 3:21 PM ----> Copying to '/fussel/web/public/static/_gallery/albums/Lightpainting/original_20160216.0005.jpg'
cbenning commented 4 years ago

Awesome, thanks for trying it and sticking with it.