docker-oracle-xe icon indicating copy to clipboard operation
docker-oracle-xe copied to clipboard

su - cannot open session

Open ratcashdev opened this issue 7 years ago • 17 comments

Building fails:

Running transaction
  Installing : file-5.11-33.el7.x86_64                                      1/2 
su: cannot open session: Permission denied
[SEVERE] The su command is not configured properly or the oracle user does not have the required privileges to install the Oracle database. If you are running in a Docker environment, ensure to set the environment variable ORACLE_DOCKER_INSTALL=true and try again.
error: %pre(oracle-database-xe-18c-1.0-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package oracle-database-xe-18c-1.0-1.x86_64

the fact that the ORACLE_DOCKER_INSTALL is already set does not help :(

ratcashdev avatar Oct 31 '18 17:10 ratcashdev

@ratcashdev Thanks for your feedback. What OS are you running Docker on? What was the full Docker command that you used to build the image?

fuzziebrain avatar Nov 01 '18 00:11 fuzziebrain

OS: elementary OS 5.0 (Juno), built on Ubuntu 18.04. docker-ce 18.0.1 installed as a SNAP package build command: sudo docker build -t oracle-xe:18c . - since the current user is not in the appropriate group for docker.

ratcashdev avatar Nov 01 '18 06:11 ratcashdev

@fuzziebrain : I experience exactly the same issue on a new ubuntu machine (18.04 bionic, Linux xxx 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux) with installed docker from ubuntu install using the command : docker build -t oracle-xe:18c .

running transaction
  Installing : file-5.11-33.el7.x86_64                                      1/2
su: cannot open session: Permission denied
[SEVERE] The su command is not configured properly or the oracle user does not have the required privileges to install the Oracle database. If you are running in a Docker environment, ensure to set the environment variable ORACLE_DOCKER_INSTALL=true and try again.
error: %pre(oracle-database-xe-18c-1.0-1.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package oracle-database-xe-18c-1.0-1.x86_64
  Verifying  : file-5.11-33.el7.x86_64                                      1/2
  Verifying  : oracle-database-xe-18c-1.0-1.x86_64                          2/2

Dependency Installed:
  file.x86_64 0:5.11-33.el7

Failed:
  oracle-database-xe-18c.x86_64 0:1.0-1

Complete!
The command '/bin/sh -c yum install -y oracle-database-preinstall-18c &&   yum install -y /tmp/${ORACLE_XE_RPM} &&   rm -rf /tmp/${ORACLE_XE_RPM}' returned a non-zero code: 1

hg-smart avatar Nov 02 '18 11:11 hg-smart

Had the same problem on Ubuntu 18.04 with the snap package. Tried it with the "docker.io" package supplied via apt-get, and it works.

tensau avatar Nov 02 '18 16:11 tensau

Thanks everyone for the feedback. @tensau good point about which version or where you installed Docker from. I'm on Ubuntu 18.04 as well and had nothing but successes. I did install the latest engine from Docker using the these instructions. The user I use does belong to the docker group, so I don't use sudo to do the build or run the container. @martindsouza of course, does everything on a Mac and he hasn't had problems either.

This is probably an issue/diferences with how we obtain or use Docker and not necesarily problems with the image or RPMs from Oracle. If everyone's agreeable, the only "fix" I can think of is to provide some text in the README that suggest users do the same as I did and what are the potential issues with other approaches.

fuzziebrain avatar Nov 02 '18 19:11 fuzziebrain

With the docker.io apt package, the group problem existed, too. But if I ran the commands with sudo, it worked perfectly.

tensau avatar Nov 02 '18 22:11 tensau

@tensau thx a lot, it is really related to the docker installation.

this helped me 👍 sudo snap remove docker , but take care this removes all docker images and containers...

  • https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04

hg-smart avatar Nov 05 '18 17:11 hg-smart

Thanks all. We'll look into adding some notes in the documentation on this issue.

fuzziebrain avatar Nov 05 '18 18:11 fuzziebrain

Indeed, after remove the docker snap package and installing it using apt, it worked.

ratcashdev avatar Nov 08 '18 19:11 ratcashdev

Ubuntu 14.04 - the same error. I don't have any 'snap' install on my ubuntu.

[SEVERE] The su command is not configured properly or the oracle user does not have the required privileges to install the Oracle database. If you are running in a Docker environment, ensure to set the environment variable ORACLE_DOCKER_INSTALL=true and try again. error: %pre(oracle-database-xe-18c-1.0-1.x86_64) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package oracle-database-xe-18c-1.0-1.x86_64

Since it's a build process i can't use 'priveleged' flag there..

gerbil avatar Jan 07 '19 09:01 gerbil

Before installing oracle, you need to comment session include system-auth line in /etc/pam.d/su file of your linux image.

Arsis247 avatar Jul 31 '19 20:07 Arsis247

There is no /etc/pam.d/su in oraclelinux

devalru avatar Aug 20 '19 15:08 devalru

I had the same problem running on RHEL 8.0 host with Docker 19.03.2. I've solved the problem with comment @Arsis247 suggested. I have edited Dockerfile: switched to oraclelinux and removed mentioned line from /etc/pam.d/su line. No problems after that, image successfully built and container is happily running.

This are the changes I made to Dockerfile: -FROM oraclelinux:7-slim +FROM oraclelinux

-RUN yum install -y oracle-database-preinstall-18c && \ +RUN yum install -y oracle-database-preinstall-18c && sed -i '12d' /etc/pam.d/su && \

h00s avatar Sep 23 '19 21:09 h00s

There is no /etc/pam.d/su in oraclelinux

It's not in the base image but it's added once you run yum install -y oracle-database-preinstall-18c

Similarly to @h00s , I used this command to remove the line pointed by @Arsis247 sed -i -r '/session\s+include\s+system-auth/d' /etc/pam.d/su

KowKiller avatar Oct 18 '19 10:10 KowKiller

it's not only about "su", "runuser" also has the same problem: runuser: cannot open session: Permission denied i've localized it, "pam_limits.so" is a reason (OL 7.7) so, my workaround (in "Dokerfile"):

    ... oracle-database-preinstall-18c && \
    sed -i -r 's/^(session\s+required\s+pam_limits.so)/#\1/' /etc/pam.d/* && \
    ...

big thanks to @Arsis247 (!), @h00s and @KowKiller

difr avatar Jan 25 '20 23:01 difr

sed -i -r 's/^(session\s+required\s+pam_limits.so)/#\1/' /etc/pam.d/* && \

hey @difr, wanted to tell you that I just used this and it worked for me on a COMPLETELY separate issue I was having but same concept, su and runuser not working on Dockerfile based on oracle linux.

Thanks for doing the work on this.

qwertycody avatar Mar 24 '20 13:03 qwertycody

it's not only about "su", "runuser" also has the same problem: runuser: cannot open session: Permission denied i've localized it, "pam_limits.so" is a reason (OL 7.7) so, my workaround (in "Dokerfile"):

    ... oracle-database-preinstall-18c && \
    sed -i -r 's/^(session\s+required\s+pam_limits.so)/#\1/' /etc/pam.d/* && \
    ...

big thanks to @Arsis247 (!), @h00s and @KowKiller

Thanks I confirm your workaround works for me, the issue is present with the last version of 18.4.0 XE at this time.

pazfernando avatar Aug 29 '21 15:08 pazfernando