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

converted wildfly and dotnet application error out with permission denied #4623

Closed
4 tasks
girishramnani opened this issue Apr 15, 2021 · 2 comments · Fixed by #4918
Closed
4 tasks

converted wildfly and dotnet application error out with permission denied #4623

girishramnani opened this issue Apr 15, 2021 · 2 comments · Fixed by #4918
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@girishramnani
Copy link
Contributor

girishramnani commented Apr 15, 2021

/kind bug

What versions of software are you using?

Operating System: MacOS

Output of odo version:

How did you run odo exactly?

"odo", "create", "--s2i", "wildfly", "wildfly-app"
"odo", "create", "--s2i", "dotnet:2.0"

Actual behavior

 + PV_MNT_PT=/opt/app-root              
INFO[2021-04-14T23:04:26Z] [odo] + ODO_UTILS_DIR=/opt/odo               
INFO[2021-04-14T23:04:26Z] [odo] + '[' '!' -f /opt/app-root/conf/supervisor.conf ']' 
INFO[2021-04-14T23:04:26Z] [odo] + cp -rp /opt/odo/conf /opt/app-root   
INFO[2021-04-14T23:04:26Z] [odo] cp: cannot create directory '/opt/app-root/conf': Permission denied 
INFO[2021-04-14T23:04:26Z] [odo]  ✗  Executing s2i-assemble command "/opt/odo/bin/s2i-setup && /opt/odo/bin/assemble-and-restart" [179ms] 
INFO[2021-04-14T23:04:26Z] [odo]  ✗  Failed to start component with name wildfly-app. Error: Failed to create the component: command execution failed: unable to execute the run command: unable to exec command [/bin/sh -c /opt/odo/bin/s2i-setup && /opt/odo/bin/assemble-and-restart]:  
INFO[2021-04-14T23:04:26Z] [odo] + set -eo pipefail                     
INFO[2021-04-14T23:04:26Z] [odo] + PV_MNT_PT=/opt/app-root              
INFO[2021-04-14T23:04:26Z] [odo] + ODO_UTILS_DIR=/opt/odo               
INFO[2021-04-14T23:04:26Z] [odo] + '[' '!' -f /opt/app-root/conf/supervisor.conf ']' 
INFO[2021-04-14T23:04:26Z] [odo] + cp -rp /opt/odo/conf /opt/app-root   
INFO[2021-04-14T23:04:26Z] [odo] cp: cannot create directory '/opt/app-root/conf': Permission denied 
INFO[2021-04-14T23:04:26Z] [odo] : error while streaming command: command terminated with exit code 1 
INFO[2021-04-14T23:04:26Z] Deleting project: e2e-source-test36ipy       
INFO[2021-04-14T23:04:26Z] Running odo with args [odo project delete e2e-source-test36ipy -f] `
   Generating MSBuild file /opt/app-root/src/obj/asp-net-hello-world.csproj.nuget.g.targets.
[odo]   Restore completed in 4.99 sec for /opt/app-root/src/asp-net-hello-world.csproj.
[odo] ---> Publishing application...
[odo] Microsoft (R) Build Engine version 15.4.8.50081 for .NET Core
[odo] Copyright (C) Microsoft Corporation. All rights reserved.
[odo] 
[odo]   asp-net-hello-world -> /opt/app-root/src/bin/Release/netcoreapp2.0/asp-net-hello-world.dll
[odo]   asp-net-hello-world -> /opt/app-root/app/
[odo] chmod: changing permissions of '/opt/app-root/app/default-cmd.sh': Operation not permitted
[odo] : error while streaming command: command terminated with exit code 1

Expected behavior

Component should be working

  • Persistent volumes should be mounted into /opt/app-root and in $DEPLOYMENTS_DIR
  • $DEPLOYMENTS_DIR can be inside /opt/app-root, in this case mount only one PV in /opt/app-root
  • An init container should copy the content of the original /opt/app-root into the persistent volume mounted on this endpoint
  • Declare a preStart event in the devfile to run this init container (blocked by preStart lifecyle event support #4901)

Any logs, error output, etc?

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 15, 2021
@girishramnani
Copy link
Contributor Author

A test in the code has been comment out due to this error, once fixed uncomment the test
PR - #4518

@girishramnani girishramnani changed the title converted wildfly application error out with permission denied converted wildfly and dotnet application error out with permission denied Apr 15, 2021
@girishramnani girishramnani self-assigned this Apr 26, 2021
@kadel kadel added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Apr 29, 2021
@feloy
Copy link
Contributor

feloy commented Jul 8, 2021

Images running the component have an /opt/app-root directory. Some images (ex: nodejs) have this directory with g+w file permission, some others (ex: wildfly) without this permission (g-w).

In s2i mode, a persistent volume were mounted into this /opt/app-root, so the permissions were not taken into account.

In normal mode, the persistent volume is not mounted anymore, and the permissions are now taken into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants