Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

[BUG] Fatal Python Error: pyinit_main: can't initialize time #4

Closed
Vorsku opened this issue Aug 24, 2020 · 37 comments
Closed

[BUG] Fatal Python Error: pyinit_main: can't initialize time #4

Vorsku opened this issue Aug 24, 2020 · 37 comments

Comments

@Vorsku
Copy link

Vorsku commented Aug 24, 2020

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.


Expected Behavior

PaperMerge application should start

Current Behavior

Container starts however PaperMerge doesn't

Steps to Reproduce

  1. Use provided docker-compose.yml and run docker-compose up

Environment

OS: Raspbian
CPU architecture: arm32
How docker service was installed: Raspbian convenience script, all other LSIO images work on the system

Command used to create docker container (run/create/compose/screenshot)

version: "2"
services:
papermerge:
image: linuxserver/papermerge:latest
hostname: papermerge
environment:
- PUID=1000
- PGID=100
- TZ=Europe/London
volumes:
- ${PWD}/config:/config
- ${PWD}/data:/data
ports:
- 8001:8000

Docker logs

Creating network "papermerge_default" with the default driver
Creating papermerge_papermerge_1 ... done
Attaching to papermerge_papermerge_1
papermerge_1 | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
papermerge_1 | [s6-init] ensuring user provided files have correct perms...exited 0.
papermerge_1 | [fix-attrs.d] applying ownership & permissions fixes...
papermerge_1 | [fix-attrs.d] done.
papermerge_1 | [cont-init.d] executing container initialization scripts...
papermerge_1 | [cont-init.d] 01-envfile: executing...
papermerge_1 | [cont-init.d] 01-envfile: exited 0.
papermerge_1 | [cont-init.d] 10-adduser: executing...
papermerge_1 |
papermerge_1 | -------------------------------------
papermerge_1 | _ ()
papermerge_1 | | | ___ _ __
papermerge_1 | | | / | | | /
papermerge_1 | | | _
\ | | | () |
papermerge_1 | || |
/ || __/
papermerge_1 |
papermerge_1 |
papermerge_1 | Brought to you by linuxserver.io
papermerge_1 | -------------------------------------
papermerge_1 |
papermerge_1 | To support LSIO projects visit:
papermerge_1 | https://www.linuxserver.io/donate/
papermerge_1 | -------------------------------------
papermerge_1 | GID/UID
papermerge_1 | -------------------------------------
papermerge_1 |
papermerge_1 | User uid: 1000
papermerge_1 | User gid: 100
papermerge_1 | -------------------------------------
papermerge_1 |
papermerge_1 | [cont-init.d] 10-adduser: exited 0.
papermerge_1 | [cont-init.d] 50-config: executing...
papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted
papermerge_1 |
papermerge_1 | Current thread 0x76efb460 (most recent call first):
papermerge_1 |
papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted
papermerge_1 |
papermerge_1 | Current thread 0x76f13460 (most recent call first):
papermerge_1 |
papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted
papermerge_1 |
papermerge_1 | Current thread 0x76fe3460 (most recent call first):
papermerge_1 |
papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted
papermerge_1 |
papermerge_1 | Current thread 0x76fb6460 (most recent call first):
papermerge_1 |
papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted
papermerge_1 |
papermerge_1 | Current thread 0x76f8d460 (most recent call first):
papermerge_1 |
papermerge_1 | [cont-init.d] 50-config: exited 1.
papermerge_1 | [cont-init.d] 99-custom-scripts: executing...
papermerge_1 | [custom-init] no custom files found exiting...
papermerge_1 | [cont-init.d] 99-custom-scripts: exited 0.
papermerge_1 | [cont-init.d] done.
papermerge_1 | [services.d] starting services
papermerge_1 | [services.d] done.

@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the issue template!

@n00B17
Copy link

n00B17 commented Aug 24, 2020

I second this report.

@alex-phillips
Copy link
Member

This looks like a permissions issue. Ensure that the directory you're mounting for /config and /data are writable by 1000:100 as you've specified.

@Vorsku
Copy link
Author

Vorsku commented Sep 10, 2020

This looks like a permissions issue. Ensure that the directory you're mounting for /config and /data are writable by 1000:100 as you've specified.

Hi Alex - permissions of the directory are fine:

drwxrwxrwx  4 1000 100 4.0K Aug 24 12:18 .
drwxrwxrwx 42 1000 100 4.0K Sep  7 20:01 ..
drwxrwxrwx  2 1000 100 4.0K Aug 24 11:32 config
drwxrwxrwx  5 1000 100 4.0K Aug 24 11:32 data
-rwxr-xr-x  1 1000 100  278 Aug 24 12:18 docker-compose.yml

Thanks

@alex-phillips
Copy link
Member

Vorsku what happens if you attempt to run the container without volume mounts (just as a test)? Does it successfully run the migrations then?

@Vorsku
Copy link
Author

Vorsku commented Sep 10, 2020

I've tried it without volume mounts and with UID/GID of 1000/1000 and still get the same error. Not sure whether @n00B17 is also using ARM but could be an ARM-specific issue?

#docker-compose.yml

version: "2"
services:
  papermerge:
    image: linuxserver/papermerge:latest
    hostname: papermerge
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
#end

@alex-phillips
Copy link
Member

Ah, I didn't check on ARM. Let me give that a shot.

@n00B17
Copy link

n00B17 commented Sep 10, 2020

yes, I do use arm as well.
(raspberry pi 4)

@alex-phillips
Copy link
Member

It looks like this bug is related to the focal base image we had to use here. We're still waiting for the ARM issue to be resolved. Once that's resolved upstream, this should no longer be an issue.

@Vorsku
Copy link
Author

Vorsku commented Sep 15, 2020

Thanks Alex, I'll keep trying new builds and update this issue when it's resolved.

@rubenix
Copy link

rubenix commented Sep 20, 2020

same here with rpi 4; any update on this?

@Roxedus
Copy link
Member

Roxedus commented Sep 20, 2020

You need a updated version of libseccomp2, 2.4.3-1 or higher. It is currently not available for Raspberry PI OS, but it is for Ubuntu. You can look into downloading the Deb from Ubuntus repository.

@rubenix
Copy link

rubenix commented Sep 20, 2020

thants @Roxedus will try that! hopefully this can be fixed soon anyways

@Vorsku
Copy link
Author

Vorsku commented Sep 20, 2020

Thanks @Roxedus, it looks like that's specific to RPI-OS and Ubuntu Focal.

I'll try and fork tomorrow using lsiobase/ubuntu:bionic and see if it works - @alex-phillips would there be any option for a separate papermerge branch built on bionic instead?

@aptalca
Copy link
Member

aptalca commented Sep 20, 2020

Iirc we had to use focal for a specific reason, so bionic rebase is unlikely to work

@alex-phillips
Copy link
Member

We had to use focal due to package version requirements by papermerge itself that are not available in bionic.

@rubenix
Copy link

rubenix commented Oct 3, 2020

still cannot make it to work on a rpi 4; neither dev ubuntu version...would love to have this running, can I help somehow?

@Roxedus
Copy link
Member

Roxedus commented Oct 3, 2020

What version of libseccomp2 do you have? You can check with sudo apt-cache policy libseccomp2

@rubenix
Copy link

rubenix commented Oct 3, 2020

Im on 2.3.3-4

@Roxedus
Copy link
Member

Roxedus commented Oct 3, 2020

So you did not patch your system to work. It is not a direct problem with the image, but with the libseccomp2 package on the host. You can install this patch by grabbing a backport.

apt-add-repository "deb http://deb.debian.org/debian buster-backports main"

apt-get install -t buster-backports libseccomp2

@frank-qcd-qk
Copy link

So you did not patch your system to work. It is not a direct problem with the image, but with the libseccomp2 package on the host. You can install this patch by grabbing a backport.

apt-add-repository "deb http://deb.debian.org/debian buster-backports main"

apt-get install -t buster-backports libseccomp2

I have just tested on Jetson nano, with the back port version of 2.4.4-1~bpo10+1 and the issue still exists

@adrianoleal
Copy link

The same problem here. Without solution?
Use rpi 4 4gb

@adrianoleal
Copy link

It looks like this bug is related to the focal base image we had to use here. We're still waiting for the ARM issue to be resolved. Once that's resolved upstream, this should no longer be an issue.

Please let me know when it is functional, please, thank you.

@joel-gfdez
Copy link

Hello,

I have also faced this issue. I haven't got it working yet on my RPi4 yet, but I'm going to try these solutions.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@l4rm4nd
Copy link

l4rm4nd commented Nov 27, 2020

Hey guys, any updates for this issue? Still not working for RPi4 .. tried latest build and arm32v7-latest.

papermerge_1 | Fatal Python error: pyinit_main: can't initialize time
papermerge_1 | Python runtime state: core initialized
papermerge_1 | PermissionError: [Errno 1] Operation not permitted

@aptalca
Copy link
Member

aptalca commented Nov 28, 2020

https://docs.linuxserver.io/faq

@stellarpower
Copy link

For reference, this also affects SWAG under arm32; can confirm the package installation for Buster worked for me.

@MAEssakly
Copy link

MAEssakly commented Feb 20, 2021

Installing libseccomp2_2.5.0-3_armhf.deb on my RPi4 resolved the problem.
Thx everyone!
http://ftp.us.debian.org/debian/pool/main/libs/libseccomp

@juanjimpad
Copy link

juanjimpad commented Apr 7, 2021

https://docs.linuxserver.io/faq

Thanks! As the docs states, downloading and installing a newer libseccomp2.deb works for RPi4.

wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb

sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

2021-04-07 08:56:48 - INFO :: MainThread : Tautulli is ready!

Its Working, thanks!!

@tjallison87
Copy link

https://docs.linuxserver.io/faq

Thanks! As the docs states, downloading and installing a newer libseccomp2.deb works for RPi4.
wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb
sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

2021-04-07 08:56:48 - INFO :: MainThread : Tautulli is ready!

Its Working, thanks!!

This also solved the problem for me on RPi 4. Thanks!

@AugustoCiuffoletti
Copy link

Same problem and libseccomp solution works also for a RPi 3 Mod.B V1.2.

Thanks

@antoniotorres
Copy link

https://docs.linuxserver.io/faq

Thanks! As the docs states, downloading and installing a newer libseccomp2.deb works for RPi4.

wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb

sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

Also worked with my Raspberry Pi 4 4GB.

This is the issue that appeared when doing docker-compose build:

Step 4/62 : RUN pip3 install --no-cache-dir -r requirements.txt --upgrade pip
 ---> Running in 3865e8e884e7
Fatal Python error: pyinit_main: can't initialize time
Python runtime state: core initialized
PermissionError: [Errno 1] Operation not permitted

Current thread 0xb6f30010 (most recent call first):
<no Python frame>

@1ubuntuuser
Copy link

The link above is broken as the package has been updated. this version still fixes the problem.

wget ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.3-2_armhf.deb
sudo dpkg -i libseccomp2_2.5.3-2_armhf.deb

The link above will probably break in time too. Go to https://packages.debian.org/sid/armhf/libseccomp2/download to find the new version number and put that in the url.

Thanks for your help! Had a docker image that was working on another armv7 device but not starting on a pi4.

@canepan
Copy link

canepan commented May 1, 2022

Note: you also need Docker >= 19 for this to work, and it can be fixed by using docker.io from bullseye.
More details here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests