Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied issue when starting node-chrome pod #3

Closed
alatyshev opened this issue Apr 7, 2017 · 14 comments
Closed

Permission denied issue when starting node-chrome pod #3

alatyshev opened this issue Apr 7, 2017 · 14 comments

Comments

@alatyshev
Copy link

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
Copy link
Owner

ddavison commented Apr 7, 2017

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

@ddavison
Copy link
Owner

ddavison commented Apr 7, 2017

the yaml*

@alatyshev
Copy link
Author

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
Copy link
Owner

ddavison commented Apr 7, 2017

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
Copy link

@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
Copy link
Owner

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

@ddavison
Copy link
Owner

ddavison commented Apr 26, 2017

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
Copy link

Remi-p commented Jun 6, 2017

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
Copy link
Owner

ddavison commented Jun 6, 2017

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
Copy link

Remi-p commented Jun 7, 2017

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
Copy link
Owner

ddavison commented Jun 7, 2017

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

@jr00n
Copy link

jr00n commented Oct 18, 2017

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

@ilusi0npl
Copy link

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
Copy link
Author

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

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

No branches or pull requests

6 participants