Cannot make/remove an entry for the specified session - cron
Asked Answered
T

1

10

I am running docker in amazon linux. I have setup a cron job for a specific action. It returns an error stating Cannot make/remove an entry for the specified session Docker Version : 1.12.6 (Client and Server) API Version : 1.24 (Client and Server)

Tomchay answered 10/4, 2017 at 12:54 Comment(1)
Please add some more information. What Docker Version (docker version)? What command are you running to get the error?Armadillo
S
25

That error is usually due to a pam security issue.

It has been fixed in debian recently: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726661 and in Ubuntu Wily (15.10).

As a workaround you can try commenting the module pam_loginuid.so inside /etc/pam.d/cron and restart cron (or the docker container).

You can use something similar to this in your Dockerfile:

RUN sed -i '/session    required     pam_loginuid.so/c\#session    required   pam_loginuid.so' /etc/pam.d/cron
Sublunary answered 18/4, 2017 at 13:39 Comment(3)
Saved my day. Thanks.Osrick
Thank you, workaround works. However, I am buffled that this is still an issue today, after more than 2 years. Bug does not occur on my docker on mac, but it does occur when run on Amazon Linux AMI, version 2018.03. Will add a remark to my Dockerfile, but I wonder how you guys document such workaround situations in your files.Selda
This solved my problem with podman, RHEL9, a ruby container with crond incl. in a legacy project. Thank you very much!Shamrock

© 2022 - 2024 — McMap. All rights reserved.