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, mkdir '/headless/sakuli_test_suite/sakuli' #6

Closed
1 task
cliffle opened this issue Mar 23, 2020 · 6 comments
Closed
1 task

permission denied, mkdir '/headless/sakuli_test_suite/sakuli' #6

cliffle opened this issue Mar 23, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@cliffle
Copy link
Contributor

cliffle commented Mar 23, 2020

With the new 2.3.0 S2I Image, starting a pod cases causes following error:

Executing command: 'npm --prefix /headless/sakuli_test_suite/sakuli test'
Error: EACCES: permission denied, mkdir '/headless/sakuli_test_suite/sakuli'
TypeError: Cannot read property 'get' of undefined
    at errorMessage (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/utils/error-message.js:38:39)
    at errorHandler (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/utils/error-handler.js:201:13)
    at /headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/bin/npm-cli.js:78:20
    at cb (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/npm.js:225:22)
    at /headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/npm.js:263:24
    at /headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/config/core.js:81:7
    at Array.forEach (<anonymous>)
    at /headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/config/core.js:80:13
    at f (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/once/once.js:25:25)
    at afterExtras (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/config/core.js:171:20)
/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/utils/error-handler.js:97
  var doExit = npm.config.loaded ? npm.config.get('_exit') : true
                          ^
TypeError: Cannot read property 'loaded' of undefined
    at exit (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/utils/error-handler.js:97:27)
    at process.errorHandler (/headless/.nvm/versions/node/v12.16.1/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
    at process.emit (events.js:311:20)
    at process._fatalException (internal/process/execution.js:164:25)

With 2.2.0 the files had following permissions:

$ ls -al /headless/sakuli_test_suite
total 4
drwxrwxr-x.  3 root root  41 Jan 28 10:51 .
drwxrwxrwx. 10 root root 250 Jan 28 10:51 ..
drwxrwxr-x.  3 1000 root  73 Jan 28 10:51 cm-demo
-rw-rwxr--.  1 1000 root 455 Jan 28 10:51 package.json

with 2.3.0 it changed to:

$ ls -al /headless/sakuli_test_suite
total 4
drwxrwxr-x. 1 root 1000  41 Mar 23 13:10 .
drwxrwxrwx. 1 root root  52 Mar 23 13:10 ..
drwxrwxr-x. 3 1000 1000  73 Mar 23 13:10 cm-demo
-rw-rwxr--. 1 1000 1000 455 Mar 23 13:10 package.json

Root Cause:
Changes in ccdc09a / 366bfc1 caused the permission issue.

Acceptance Criteria:

  • change group of sakuli_test_suite directory back to root
@cliffle cliffle added the bug Something isn't working label Mar 23, 2020
@cliffle cliffle assigned cliffle and unassigned cliffle Mar 23, 2020
@svettwer
Copy link
Contributor

svettwer commented Mar 24, 2020

The permission changes from the mentioned commits are required so that the container does not use the root group anymore. See sakuli/sakuli-docker#37
Please do not change the permissions back.
I've tested the change and was able to execute a test suite without any problems. See test script in make file within this repo.

@svettwer
Copy link
Contributor

I would be helpful to provide a detailed description in which situation the error occurs. Is it an container using the s2i image on openshift? Is there an example project for this?

@svettwer
Copy link
Contributor

svettwer commented Mar 24, 2020

In the given ls command, there is no folder sakuli as mentioned in the npm command Executing command: 'npm --prefix /headless/sakuli_test_suite/sakuli test'

It seems that the cm-demo repo is the required one. Please double check the container config.

@cliffle
Copy link
Contributor Author

cliffle commented Mar 24, 2020

This was a copy/paste mistake, my bad 😅 I just bootstrapped the pink-coffee showcase with branch 18/publish-dashboard on my minishift and still got this:

Executing command: 'npm --prefix /headless/sakuli_test_suite test'
--
> cm-demo@1.0.0 test /headless/sakuli_test_suite
> sakuli run cm-demo


Initialized Sakuli with 1 Testcases
  | Error: ENOENT: no such file or directory, mkdir
  | npm ERR! Test failed.  See above for more details.

Even though the user is set to 1000:1000 in the Dockerfile, the output of Sakuli states that the user has USER_ID: 1000170000, GROUP_ID: 0

@cliffle
Copy link
Contributor Author

cliffle commented Mar 24, 2020

Also the Openshift Documentation (Chapter Support Arbitrary User IDs) states that

the container user is always a member of the root group

@svettwer
Copy link
Contributor

Yeah, the user ID is random on openshift but the 0 group is new to me.

@cliffle cliffle self-assigned this Mar 24, 2020
cliffle added a commit that referenced this issue Mar 24, 2020
cliffle added a commit that referenced this issue Mar 24, 2020
@ZNicoZ ZNicoZ closed this as completed Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants