jdoss / ppngx

Podman + Paperless NGX
MIT License
104 stars 12 forks source link

Problem when trying to autostart in rootless mode #12

Closed manueldeljesus closed 1 year ago

manueldeljesus commented 1 year ago

I am following the instruction that you provide to have systemd autostarting Paperless on boot. However, I received first a deprecation warning when running podman generate systemd --new --files --container-prefix='' --name paperless:

DEPRECATED command:
It is recommended to use Quadlets for running containers and pods under systemd.

And then, when running systemctl enable --user --now pod-paperless.service I get the following error:

Job for pod-paperless.service failed because the service did not take the steps required by its unit configuration.
See "systemctl --user status pod-paperless.service" and "journalctl --user -xeu pod-paperless.service" for details.

Any idea on what could be the problem?

jdoss commented 1 year ago

What does

journalctl --user -xeu pod-paperless.service

output?

manueldeljesus commented 1 year ago
dic 01 17:42:51 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1380.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: New main PID 76437 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: New main PID 76437 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:51 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1380 and the job result is failed.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 17:42:51 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1428.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76562 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76562 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:52 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1428 and the job result is failed.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 17:42:52 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1601.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76686 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76686 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:53 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1601 and the job result is failed.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:53 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1774 and the job result is failed.
jdoss commented 1 year ago

Can you show me the generated pod-paperless.service file?

manueldeljesus commented 1 year ago
# pod-paperless.service
# autogenerated by Podman 4.8.0
# Fri Dec  1 17:42:10 CET 2023

[Unit]
Description=Podman pod-paperless.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=/run/user/1000/containers
Wants=paperless-gotenberg.service paperless-postgresql.service paperless-redis.service paperless-sftpgo.service paperless-tika.service paperless-webserver.service
Before=paperless-gotenberg.service paperless-postgresql.service paperless-redis.service paperless-sftpgo.service paperless-tika.service paperless-webserver.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/usr/bin/podman pod create \
    --infra-conmon-pidfile %t/pod-paperless.pid \
    --pod-id-file %t/pod-paperless.pod-id \
    --exit-policy=stop \
    --replace \
    --name paperless \
    -p 8000:8000 \
    -p 2022:2022 \
    -p 8022:8022
ExecStart=/usr/bin/podman pod start \
    --pod-id-file %t/pod-paperless.pod-id
ExecStop=/usr/bin/podman pod stop \
    --ignore \
    --pod-id-file %t/pod-paperless.pod-id  \
    -t 10
ExecStopPost=/usr/bin/podman pod rm \
    --ignore \
    -f \
    --pod-id-file %t/pod-paperless.pod-id
PIDFile=%t/pod-paperless.pid
Type=forking

[Install]
WantedBy=default.target
jdoss commented 1 year ago

What distro are you running this on?

Maybe it is a SELinux issue. Let's temporarily disable and and see:

getenforce
sudo setenforce 0
systemctl stop --user pod-paperless.service
systemctl start --user pod-paperless.service
manueldeljesus commented 1 year ago

I'm on Fedora 39.

It does seem to generate the same error. I copy the output in the next comment.

manueldeljesus commented 1 year ago
dic 01 17:42:51 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1380.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: New main PID 76437 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: New main PID 76437 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:51 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1380 and the job result is failed.
dic 01 17:42:51 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 17:42:51 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1428.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76562 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76562 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:52 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1428 and the job result is failed.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 17:42:52 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 1601.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76686 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:52 MyComputer systemd[3080]: pod-paperless.service: New main PID 76686 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:53 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1601 and the job result is failed.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 17:42:53 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 17:42:53 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 1774 and the job result is failed.
dic 01 18:13:10 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 2091.
dic 01 18:13:10 MyComputer systemd[3080]: pod-paperless.service: New main PID 168864 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:10 MyComputer systemd[3080]: pod-paperless.service: New main PID 168864 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:10 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 18:13:10 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 2091 and the job result is failed.
dic 01 18:13:11 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 18:13:11 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 2139.
dic 01 18:13:11 MyComputer systemd[3080]: pod-paperless.service: New main PID 169020 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:11 MyComputer systemd[3080]: pod-paperless.service: New main PID 169020 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:11 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 18:13:11 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 2139 and the job result is failed.
dic 01 18:13:11 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
dic 01 18:13:11 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has begun execution.
░░ 
░░ The job identifier is 2312.
dic 01 18:13:12 MyComputer systemd[3080]: pod-paperless.service: New main PID 169145 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:12 MyComputer systemd[3080]: pod-paperless.service: New main PID 169145 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:13:12 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 18:13:12 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 2312 and the job result is failed.
dic 01 18:13:12 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 18:13:12 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'protocol'.
dic 01 18:13:12 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit UNIT has finished with a failure.
░░ 
░░ The job identifier is 2485 and the job result is failed.
jdoss commented 1 year ago

Ok let's turn SELinux back on

sudo setenforce 1

and see if this gives us any better information

journalctl --user -u pod-paperless.service --since "3 min ago"
manueldeljesus commented 1 year ago
-- No entries --
dic 01 18:21:28 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:28 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:28 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:28 MyComputer systemd[3080]: pod-paperless.service: New main PID 193726 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 1.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: New main PID 193856 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:29 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:29 MyComputer systemd[3080]: pod-paperless.service: Scheduled restart job, restart counter is at 2.
dic 01 18:21:29 MyComputer systemd[3080]: Starting pod-paperless.service - Podman pod-paperless.service...
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: New main PID 194004 does not belong to service, and PID file is not owned by root. Refusing.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Start request repeated too quickly.
dic 01 18:21:30 MyComputer systemd[3080]: pod-paperless.service: Failed with result 'protocol'.
dic 01 18:21:30 MyComputer systemd[3080]: Failed to start pod-paperless.service - Podman pod-paperless.service.
jdoss commented 1 year ago

Are you running this as rootful Podman?

manueldeljesus commented 1 year ago

Not that I know. It should be rootless. It has never asked for my root password and I have not even activated the Docker compatibility layer. I run it directly from my user.

Indeed, I try to use Podman to avoid the root requirement.

Is there any way in which I can double check? I am not very experienced with containers, so I may be doing something wrong...

jdoss commented 1 year ago

Did you copy the unit files into $HOME/.config/systemd/user/?

ls -lah $HOME/.config/systemd/user/
manueldeljesus commented 1 year ago

No, they are there because, following the steps that you present in the GitHub page, I run the command within that folder. I didn't copy them from elsewhere.

Captura desde 2023-12-01 18-33-43-obfuscated

Edited to make my response have sense.

jdoss commented 1 year ago

Maybe this is related? https://github.com/containers/podman/issues/18551 I see you have a protonvpn_reconnect.service and maybe that is mucking things up like this user reported?

Here is my mount for cgroup

$ mount | grep cgroup
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot)

What does mount | grep cgroup show for you?

manueldeljesus commented 1 year ago

I will have a look onto the link.

The mount | grep cgroup shows the following:

cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot)
net_cls on /sys/fs/cgroup/net_cls type cgroup (rw,relatime,seclabel,net_cls)
jdoss commented 1 year ago

I bet that net_cls mount is causing the issue. If you do a systemd-cgls as your user I bet you will see a net_cls entry that has processes owned by root as reported in https://github.com/systemd/systemd/issues/21945

Try disabling the ProtonVPN service, and unmount /sys/fs/cgroup/net_cls and see if the issue with starting the pod unit persists.

manueldeljesus commented 1 year ago

Indeed, disabling the VPN and unmounting the cgroup seems to work.

From the last link to the systemd issue that you shared, I understand that the problem is the way in which the VPN service is implemented and that there is no way around it, right? That is, if the VPN creates that service and the cgroup, rootless podman will fail, am I right?

jdoss commented 1 year ago

Yeah that is my take on the issue. It is a problem with how ProtonVPN is handling their service. Mullvad seems to have a work around with using a different directory for their VPN service https://github.com/mullvad/mullvadvpn-app/issues/3299 but you'd have to contact ProtonVPN to see if their systemd service can be changed to work around this problem.

manueldeljesus commented 1 year ago

Just to make this issue as complete as possible if someone finds the same problem:

The problem is created by Mullvad VPN daemon which seems to mount net_cls by default in a directory that creates problems. As they specify in their README, there is an ENV variable called TALPID_NET_CLS_MOUNT_DIR to configure the mount point. Setting this mount point outside where systemd is mounting its cgroup2 should make things work.

@jdoss Thank you very much for your help.

jdoss commented 1 year ago

You are welcome @manueldeljesus. 😄