[GH-ISSUE #295] docker-compose fails with "invalid signature" on raspberry #239

Closed
opened 2026-02-25 21:31:31 +03:00 by kerem · 10 comments
Owner

Originally created by @luebbe on GitHub (Feb 3, 2021).
Original GitHub issue: https://github.com/ciur/papermerge/issues/295

Originally assigned to: @ciur on GitHub.

First of all I think the three line build instructions need a little update. At least for me on a raspberry 3b they were:

git clone https://github.com/ciur/papermerge.git
cd papermerge/docker/1.4
docker-compose up

docker-compose up in docker/1.4 results in the following output:

Building app
Step 1/29 : FROM ubuntu:20.04
 ---> bcf7edb34eae
Step 2/29 : LABEL maintainer="Eugen Ciur <eugen@papermerge.com>"
 ---> Using cache
 ---> de6c77e2beb5
Step 3/29 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> bef850b81ac6
Step 4/29 : RUN apt-get update  && apt-get install -y                     build-essential                     vim                     python3                     python3-pip                     python3-venv                     virtualenv                     poppler-utils                     git                     imagemagick                     pdftk-java                     apache2                     apache2-dev                     locales  && rm -rf /var/lib/apt/lists/*  && pip3 install --upgrade pip
 ---> Running in f32773c142d3
Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [101 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
  At least one invalid signature was encountered.
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [109 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
  At least one invalid signature was encountered.
Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
  At least one invalid signature was encountered.
Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
  At least one invalid signature was encountered.
Reading package lists...
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed.
ERROR: Service 'app' failed to build : The command '/bin/sh -c apt-get update  && apt-get install -y
 build-essential                     vim                     python3                     python3-pip
 python3-venv                     virtualenv                     poppler-utils                     git
   imagemagick                     pdftk-java                     apache2                     apache2-dev
      locales  && rm -rf /var/lib/apt/lists/*  && pip3 install --upgrade pip' returned a non-zero code: 100

When I run docker-compose up in docker/1.2 it "finishes", but fails with the error:

Starting postgres_db       ... done
Starting papermerge_worker ... done
Starting papermerge_service ... done
Attaching to postgres_db, papermerge_worker, papermerge_service
papermerge_service | standard_init_linux.go:219: exec user process caused: exec format error
papermerge_worker | standard_init_linux.go:219: exec user process caused: exec format error
postgres_db |
postgres_db | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_db |
papermerge_worker exited with code 1
postgres_db | 2021-02-03 20:18:30.376 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_db | 2021-02-03 20:18:30.377 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_db | 2021-02-03 20:18:30.385 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_db | 2021-02-03 20:18:30.455 UTC [27] LOG:  database system was shut down at 2021-01-31 17:04:47 UTC
postgres_db | 2021-02-03 20:18:30.554 UTC [1] LOG:  database system is ready to accept connections
papermerge_service exited with code 1

So in 1.2 the compose finishes, but service and worker fail to start.

Originally created by @luebbe on GitHub (Feb 3, 2021). Original GitHub issue: https://github.com/ciur/papermerge/issues/295 Originally assigned to: @ciur on GitHub. First of all I think the three line build instructions need a little update. At least for me on a raspberry 3b they were: ``` git clone https://github.com/ciur/papermerge.git cd papermerge/docker/1.4 docker-compose up ``` `docker-compose up ` in docker/1.4 results in the following output: ``` Building app Step 1/29 : FROM ubuntu:20.04 ---> bcf7edb34eae Step 2/29 : LABEL maintainer="Eugen Ciur <eugen@papermerge.com>" ---> Using cache ---> de6c77e2beb5 Step 3/29 : ARG DEBIAN_FRONTEND=noninteractive ---> Using cache ---> bef850b81ac6 Step 4/29 : RUN apt-get update && apt-get install -y build-essential vim python3 python3-pip python3-venv virtualenv poppler-utils git imagemagick pdftk-java apache2 apache2-dev locales && rm -rf /var/lib/apt/lists/* && pip3 install --upgrade pip ---> Running in f32773c142d3 Get:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease [265 kB] Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB] Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [101 kB] Err:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease At least one invalid signature was encountered. Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [109 kB] Err:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease At least one invalid signature was encountered. Err:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease At least one invalid signature was encountered. Err:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease At least one invalid signature was encountered. Reading package lists... W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal InRelease' is not signed. W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease' is not signed. W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease' is not signed. W: GPG error: http://ports.ubuntu.com/ubuntu-ports focal-security InRelease: At least one invalid signature was encountered. E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security InRelease' is not signed. ERROR: Service 'app' failed to build : The command '/bin/sh -c apt-get update && apt-get install -y build-essential vim python3 python3-pip python3-venv virtualenv poppler-utils git imagemagick pdftk-java apache2 apache2-dev locales && rm -rf /var/lib/apt/lists/* && pip3 install --upgrade pip' returned a non-zero code: 100 ``` When I run `docker-compose up` in docker/1.2 it "finishes", but fails with the error: ``` Starting postgres_db ... done Starting papermerge_worker ... done Starting papermerge_service ... done Attaching to postgres_db, papermerge_worker, papermerge_service papermerge_service | standard_init_linux.go:219: exec user process caused: exec format error papermerge_worker | standard_init_linux.go:219: exec user process caused: exec format error postgres_db | postgres_db | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres_db | papermerge_worker exited with code 1 postgres_db | 2021-02-03 20:18:30.376 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres_db | 2021-02-03 20:18:30.377 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres_db | 2021-02-03 20:18:30.385 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_db | 2021-02-03 20:18:30.455 UTC [27] LOG: database system was shut down at 2021-01-31 17:04:47 UTC postgres_db | 2021-02-03 20:18:30.554 UTC [1] LOG: database system is ready to accept connections papermerge_service exited with code 1 ``` So in 1.2 the compose finishes, but service and worker fail to start.
kerem 2026-02-25 21:31:31 +03:00
Author
Owner

@ciur commented on GitHub (Feb 7, 2021):

Hi @luebbe,

I don't own a Raspberry Pi and I personally never intended to run Papermerge on that platform. However, I know many people do that and maybe someone who runs Papermerge on Raspberry Pi can can help you here.
This is definitely not a bug.

<!-- gh-comment-id:774607570 --> @ciur commented on GitHub (Feb 7, 2021): Hi @luebbe, I don't own a Raspberry Pi and I personally never intended to run Papermerge on that platform. However, I know many people do that and maybe someone who runs Papermerge on Raspberry Pi can can help you here. This is definitely not a bug.
Author
Owner

@luebbe commented on GitHub (Feb 7, 2021):

Thanks for the feedback. Will investigate further. It definitely wasn't a feature request, so I started with the "bug" template :D

Any idea why the 1.2 version fails to start the services?

<!-- gh-comment-id:774669490 --> @luebbe commented on GitHub (Feb 7, 2021): Thanks for the feedback. Will investigate further. It definitely wasn't a feature request, so I started with the "bug" template :D Any idea why the 1.2 version fails to start the services?
Author
Owner

@luebbe commented on GitHub (Feb 7, 2021):

OK, I found the following article:
https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm
and intstalled the current version of libseccomp manually. Now docker-compose builds in 1.4.

If this is everything needed to get up and running on a Raspberry, maybe add a line to the docs?
I'll keep you updated.

<!-- gh-comment-id:774671675 --> @luebbe commented on GitHub (Feb 7, 2021): OK, I found the following article: https://askubuntu.com/questions/1263284/apt-update-throws-signature-error-in-ubuntu-20-04-container-on-arm and intstalled the current version of `libseccomp` manually. Now docker-compose builds in 1.4. If this is everything needed to get up and running on a Raspberry, maybe add a line to the docs? I'll keep you updated.
Author
Owner

@luebbe commented on GitHub (Feb 7, 2021):

Making progress. Now step 26/29 fails

Step 26/29 : RUN pip3 install -r requirements/base.txt --no-cache-dir
...
Collecting lxml
  Downloading lxml-4.6.2.tar.gz (3.2 MB)
    ERROR: Command errored out with exit status 1:
     command: /opt/app/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ppy_6z5d/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ppy_6z5d/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ppy_6z5d/lxml/pip-egg-info
         cwd: /tmp/pip-install-ppy_6z5d/lxml/
    Complete output (3 lines):
    Building lxml version 4.6.2.
    Building without Cython.
    Error: Please make sure the libxml2 and libxslt development packages are installed.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Service 'app' failed to build : The command '/bin/sh -c pip3 install -r requirements/base.txt --no-cache-dir' returned a non-zero code: 1

I tried again after installing the two dev packages with sudo apt install libxml2-dev libxslt-dev python-dev on the host, but got the same error.

I'm a total docker noob, but I guess the dev packages should be installed in the container? No idea how to achieve this.

<!-- gh-comment-id:774674460 --> @luebbe commented on GitHub (Feb 7, 2021): Making progress. Now step 26/29 fails ``` Step 26/29 : RUN pip3 install -r requirements/base.txt --no-cache-dir ... Collecting lxml Downloading lxml-4.6.2.tar.gz (3.2 MB) ERROR: Command errored out with exit status 1: command: /opt/app/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ppy_6z5d/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ppy_6z5d/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ppy_6z5d/lxml/pip-egg-info cwd: /tmp/pip-install-ppy_6z5d/lxml/ Complete output (3 lines): Building lxml version 4.6.2. Building without Cython. Error: Please make sure the libxml2 and libxslt development packages are installed. ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Service 'app' failed to build : The command '/bin/sh -c pip3 install -r requirements/base.txt --no-cache-dir' returned a non-zero code: 1 ``` I tried again after installing the two dev packages with `sudo apt install libxml2-dev libxslt-dev python-dev` on the host, but got the same error. I'm a total docker noob, but I guess the dev packages should be installed in the container? No idea how to achieve this.
Author
Owner

@amo13 commented on GitHub (Feb 7, 2021):

I never used docker. Maybe you can deploy papermerge more easily if you use ArchLinuxArm and the package I created for archlinux.
If docker just spins up an OS image and runs a script, you might be able to script the installation easily.
Just an idea.

<!-- gh-comment-id:774749538 --> @amo13 commented on GitHub (Feb 7, 2021): I never used docker. Maybe you can deploy papermerge more easily if you use [ArchLinuxArm](https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4) and the [package](https://wiki.archlinux.org/index.php/Papermerge) I created for archlinux. If docker just spins up an OS image and runs a script, you might be able to script the installation easily. Just an idea.
Author
Owner

@luebbe commented on GitHub (Feb 8, 2021):

@amo13 sorry, not going to reinstall the system from scratch for a package that I want to try out. I'm glad that I got out of the python version hell by running Home Assistant in a docker container.

<!-- gh-comment-id:774987154 --> @luebbe commented on GitHub (Feb 8, 2021): @amo13 sorry, not going to reinstall the system from scratch for a package that I want to try out. I'm glad that I got out of the python version hell by running Home Assistant in a docker container.
Author
Owner

@amo13 commented on GitHub (Feb 8, 2021):

Of course! But you might be able to use an archlinux docker image and run the installation of papermerge on the archlinux inside the docker container? Or maybe I just have a misconception of how docker works...

<!-- gh-comment-id:775041242 --> @amo13 commented on GitHub (Feb 8, 2021): Of course! But you might be able to use an archlinux docker image and run the installation of papermerge on the archlinux inside the docker container? Or maybe I just have a misconception of how docker works...
Author
Owner

@luebbe commented on GitHub (Feb 8, 2021):

Made a little more progress by adding four -dev packages to the apt-get update section in app.dockerfile:

diff --git a/docker/1.4/app.dockerfile b/docker/1.4/app.dockerfile
index 3544aef..04c5537 100644
--- a/docker/1.4/app.dockerfile
+++ b/docker/1.4/app.dockerfile
@@ -19,6 +19,10 @@ RUN apt-get update \
                     apache2 \
                     apache2-dev \
                     locales \
+                    libxml2-dev \
+                    libxslt-dev \
+                    libffi-dev \
+                    python-dev \
  && rm -rf /var/lib/apt/lists/* \
  && pip3 install --upgrade pip

docker-compose up gets a lot further, but still fails in 26/29:

  Building wheel for cryptography (PEP 517): started
  Building wheel for cryptography (PEP 517): finished with status 'error'
  Building wheel for future (setup.py): started
  ERROR: Command errored out with exit status 1:

... ~100 lines

 running build_rust

      =============================DEBUG ASSISTANCE=============================
      If you are seeing a compilation error please try the following steps to
      successfully install cryptography:

      1) Upgrade to the latest pip and try again. This will fix errors for most
         users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
      2) Read https://cryptography.io/en/latest/installation.html for specific
         instructions for your platform.
      3) Check our frequently asked questions for more information:
         https://cryptography.io/en/latest/faq.html
      4) Ensure you have a recent Rust toolchain installed.
      =============================DEBUG ASSISTANCE=============================

  error: Can not find Rust compiler
  ----------------------------------------
  ERROR: Failed building wheel for cryptography

Looks like I have to install the Rust compiler, but my google fu hasn't helped me to solve this (yet).

<!-- gh-comment-id:775298279 --> @luebbe commented on GitHub (Feb 8, 2021): Made a little more progress by adding four -dev packages to the *apt-get update* section in app.dockerfile: ```diff diff --git a/docker/1.4/app.dockerfile b/docker/1.4/app.dockerfile index 3544aef..04c5537 100644 --- a/docker/1.4/app.dockerfile +++ b/docker/1.4/app.dockerfile @@ -19,6 +19,10 @@ RUN apt-get update \ apache2 \ apache2-dev \ locales \ + libxml2-dev \ + libxslt-dev \ + libffi-dev \ + python-dev \ && rm -rf /var/lib/apt/lists/* \ && pip3 install --upgrade pip ``` docker-compose up gets a lot further, but still fails in 26/29: ``` Building wheel for cryptography (PEP 517): started Building wheel for cryptography (PEP 517): finished with status 'error' Building wheel for future (setup.py): started ERROR: Command errored out with exit status 1: ... ~100 lines running build_rust =============================DEBUG ASSISTANCE============================= If you are seeing a compilation error please try the following steps to successfully install cryptography: 1) Upgrade to the latest pip and try again. This will fix errors for most users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip 2) Read https://cryptography.io/en/latest/installation.html for specific instructions for your platform. 3) Check our frequently asked questions for more information: https://cryptography.io/en/latest/faq.html 4) Ensure you have a recent Rust toolchain installed. =============================DEBUG ASSISTANCE============================= error: Can not find Rust compiler ---------------------------------------- ERROR: Failed building wheel for cryptography ``` Looks like I have to install the Rust compiler, but my google fu hasn't helped me to solve this (yet).
Author
Owner

@ciur commented on GitHub (Feb 9, 2021):

@luebbe, docker is not the magic pill; docker itself is nothing more than piece of software with its own dependency issues and problems. :) In case you cannot run Papermerge via docker, I suggest to try manual installation. Manual installation is very well documented (well, for Ubuntu 20) and you shouldn't encounter any issue (unless some binaries incompatibilities of your platform). At very least, if you encounter a problem with manual installation it will be simpler to troubleshoot the problem.

<!-- gh-comment-id:775740184 --> @ciur commented on GitHub (Feb 9, 2021): @luebbe, docker is not the magic pill; docker itself is nothing more than piece of software with its own dependency issues and problems. :) In case you cannot run Papermerge via docker, I suggest to try [manual installation](https://papermerge.com/docs/Installation/installation.html). Manual installation is very well documented (well, for Ubuntu 20) and you shouldn't encounter any issue (unless some binaries incompatibilities of your platform). At very least, if you encounter a problem with manual installation it will be simpler to troubleshoot the problem.
Author
Owner

@luebbe commented on GitHub (Feb 9, 2021):

Yes, I know :) It's all software...
I had a very good experience moving my HA installation from manual (virtualenv) to docker. It was no joy having to update python whenever HA required a recent version and raspbian was still a few versions behind.
So I went for docker straight away, hoping to avoid these kind of problems. I was also hoping that I could slowly dig myself through the docker installation and get it up and running in order to provide help for others who want to go the same path.
I'll think this through and see how I'll continue.

<!-- gh-comment-id:775750633 --> @luebbe commented on GitHub (Feb 9, 2021): Yes, I know :) It's all software... I had a very good experience moving my HA installation from manual (virtualenv) to docker. It was no joy having to update python whenever HA required a recent version and raspbian was still a few versions behind. So I went for docker straight away, hoping to avoid these kind of problems. I was also hoping that I could slowly dig myself through the docker installation and get it up and running in order to provide help for others who want to go the same path. I'll think this through and see how I'll continue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#239
No description provided.