ddavison / selenium-openshift-templates

OpenShift Templates for a scalable Selenium infrastructure
43 stars 64 forks source link

Permission denied issue when starting node-chrome pod #3

Closed alatyshev closed 4 years ago

alatyshev commented 7 years ago

Getting such error when starting node-chrome pod:

/opt/bin/entry_point.sh: line 4: /opt/selenium/config.json: Permission denied No Selenium Node configuration file, the node-base image is not intended to be run directly.

ddavison commented 7 years ago

hrm.. can i see the template itself youære trying to use?

ddavison commented 7 years ago

the yaml*

alatyshev commented 7 years ago

It's unmodified template from Master: https://github.com/ddavison/selenium-openshift-templates/blob/master/selenium-node-chrome.yaml

The culprit seems to be in dockerfile of chrome node, requring root privileges in OS3 project.

ddavison commented 7 years ago

good news then, im actually the maintainer of those images from selenium :P if you/i find a fix, we can get it put in. i haven't used openshift for quite some time, so not sure i can reproduce

ianwatsonrh commented 7 years ago

@ddavison this issue is due to Openshift's default restricted mode, where the container is run as a random user id. The line /opt/selenium/generate_config > /opt/selenium/config.json then attempts to write to /opt/selenium which it does not have permissions.

Fixes: change the script to allow writing to /opt/selenium from group 0 - see https://github.com/sclorg/s2i-base-container/blob/master/bin/fix-permissions as a example

ddavison commented 7 years ago

and which image version are you using of selenium/node-chrome?

ddavison commented 7 years ago

I wonder if the offending line is here: https://github.com/SeleniumHQ/docker-selenium/blob/master/NodeChrome/Dockerfile#L70

I could change this to chown -R seluser .. (instead of specifying the group)`

Remi-p commented 7 years ago

Hi, I believe another way of fixing it would be to do the same as you (@ddavison) did in move the creation of the config.json file into a RUN directive #185 ?

That's what I did for one instance of openshift I'm using :

Typically, deleting the following line in NodeBase/entry_point.sh :

/opt/selenium/generate_config > /opt/selenium/config.json

And adding in NodeChrome/Dockerfile.txt, just before the USER seluser :


RUN /opt/selenium/generate_config > /opt/selenium/config.json

See this readme.

ddavison commented 7 years ago

if you wanted to try your hand at it, go ahead and open a pull request to SeleniumHQ/docker-selenium and i'll merge it in!

Remi-p commented 7 years ago

Ok i'll try to do that today :)

Edit: So I think I did it (See this commit), I even prepared the pull request. However my company asks itself a lot of questions about contributing to an open source project (yes even for 3 lines), so I have to wait to see if I sign the CLA in my name only, or as an employee.

ddavison commented 7 years ago

typically you'll sign just your name representative of yourself, not your company

jr00n commented 6 years ago

I've changed some permissions in the images so it works on OpenShift Supporting the Arbitrary User IDs #5

ilusi0npl commented 6 years ago

Hi guys,

I'm getting the same issue as described above: openshift /opt/bin/entrypoint.sh: line 6: /opt/selenium/config.json: Permission denied

Any idea how to fix it?

alatyshev commented 4 years ago

This issue has been now resolved with newer docker images, so closing it.