the-paperless-project / paperless

Scan, index, and archive all of your paper documents
GNU General Public License v3.0
7.85k stars 499 forks source link

Docker install: ERROR: for consumer Container "a713bc3650c5" is unhealthy. #719

Open ostpol opened 3 years ago

ostpol commented 3 years ago

Hi,

I'm trying to install Paperless with/in Docker (Docker version 20.10.2, build 2291f61, Ubuntu 20.04.1). I'm not very familiar with Docker, so I hope somebody can give me a hint.

docker-compose up -d runs into this error:

Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Creating paperless_webserver_1 ... done

ERROR: for consumer  Container "a713bc3650c5" is unhealthy.
ERROR: Encountered errors while bringing up the project.

docker-compose --verbose up -d:

...
compose.parallel.feed_queue: Healthcheck for service(s) upstream of <Service: consumer> failed - not processing
compose.parallel.parallel_execute_iter: Failed: <Service: consumer>
compose.parallel.feed_queue: Pending: set()

ERROR: for consumer  Container "a713bc3650c5" is unhealthy.
ERROR: compose.cli.main.exit_with_metrics: Encountered errors while bringing up the project.

docker-compose.yml:

version: '2.1'

services:
    webserver:
        build: ./
        # uncomment the following line to start automatically on system boot
        restart: always
        ports:
            # You can adapt the port you want Paperless to listen on by
            # modifying the part before the `:`.
            - "8008:8000"
        healthcheck:
            test: ["CMD", "curl" , "-f", "http://localhost:8000"]
            interval: 30s
            timeout: 10s
            retries: 5
        volumes:
            - /media/documents/store:/usr/src/paperless/data
            - /media/documents/media:/usr/src/paperless/media
            # You have to adapt the local path you want the consumption
            # directory to mount to by modifying the part before the ':'.
            - /media/documents/inbox:/consume
        env_file: docker-compose.env
        # The reason the line is here is so that the webserver that doesn't do
        # any text recognition and doesn't have to install unnecessary
        # languages the user might have set in the env-file by overwriting the
        # value with nothing.
        environment:
            - PAPERLESS_OCR_LANGUAGES=
        command: ["gunicorn", "-b", "0.0.0.0:8000"]

    consumer:
        build: ./
        # uncomment the following line to start automatically on system boot
        restart: always
        depends_on:
            webserver:
                condition: service_healthy
        volumes:
            - /media/documents/store:/usr/src/paperless/data
            - /media/documents/media:/usr/src/paperless/media
            # This should be set to the same value as the consume directory
            # in the webserver service above.
            - /media/documents/inbox:/consume
            # Likewise, you can add a local path to mount a directory for
            # exporting. This is not strictly needed for paperless to
            # function, only if you're exporting your files: uncomment
            # it and fill in a local path if you know you're going to
            # want to export your documents.
            - /media/documents/export:/export
        env_file: docker-compose.env
        command: ["document_consumer", "--no-inotify"]

volumes:
    data:
    media:

docker-compose.env:

# Environment variables to set for Paperless
# Commented out variables will be replaced with a default within Paperless.
#
# In addition to what you see here, you can also define any values you find in
# paperless.conf.example here.  Values like:
#
# * PAPERLESS_PASSPHRASE
# * PAPERLESS_CONSUMPTION_DIR
# * PAPERLESS_CONSUME_MAIL_HOST
#
# ...are all explained in that file but can be defined here, since the Docker
# installation doesn't make use of paperless.conf.
#
# NOTE: values in paperless.conf should be wrapped in double quotes, but not in this file
# Example:
# paperless.conf: PAPERLESS_FORGIVING_OCR="true"
# docker-compose.env (this file): PAPERLESS_FORGIVING_OCR=true

# Use this variable to set a timezone for the Paperless Docker containers. If not specified, defaults to UTC.
TZ=Europe/Berlin

# Additional languages to install for text recognition.  Note that this is
# different from PAPERLESS_OCR_LANGUAGE (default=eng), which defines the
# default language used when guessing the language from the OCR output.
PAPERLESS_OCR_LANGUAGES=deu

PAPERLESS_FORGIVING_OCR=true

# Set Paperless to use SSL for the web interface.
# Enabling this will require ssl.key and ssl.cert files in paperless' data directory.
# PAPERLESS_USE_SSL=false

# You can change the default user and group id to a custom one
#USERMAP_UID=1000
#USERMAP_GID=1000

The underlying directories are SMB-shares.

/etc/fstab:

//192.168.1.25/documents /media/documents cifs defaults,nofail,username=admin,password=*supersecure*,vers=1.0,x-systemd.automount,x-systemd.requires=network-online.target,gid=1000,uid=1000,rw,users 0 0

tony@server:~/Docker/paperless/paperless$ ls -ll /media/documents/
total 0
drwxr-xr-x 2 tony tony 0 Mär  5  2020 archive
drwxr-xr-x 2 tony tony 0 Jan 22 18:53 export
drwxr-xr-x 2 tony tony 0 Jan 19 17:53 inbox
drwxr-xr-x 2 tony tony 0 Jan 22 18:23 media
drwxr-xr-x 2 tony tony 0 Jan 22 19:11 store
drwxr-xr-x 2 tony tony 0 Jan 22 18:38 tmp
tony@server:~/Docker/paperless/paperless$ id
uid=1000(tony) gid=1000(tony) groups=1000(tony),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare),998(docker)