-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Workspace files are not removed when Common PVC strategy if configured #12445
Comments
@eclipse/eclipse-che-qa During manual testing of my PR I discovered two bugs with removing workspaces data after workspaces removing (for |
@sleshchenko That's interesting... We've already found this issue while testing Codeready Workspaces, but from latest comment it seems it's no longer reproducible: https://issues.jboss.org/browse/CRW-69 |
The property CHE_INFRA_KUBERNETES_PVC_PRECREATE__SUBPATHS is required for PVC cleanup on current versions of Kubernetes/OpenShift. Without the property enabled, subpaths are created in PVCs by Kubernetes when they are needed for pods. However, only the leaf directory created in this way has write permissions for nonroot users. As a result, the cleanup pod cannot delete directories created (e.g. the workspaceX/projects) directory. For more details, see eclipse-che#12445 Signed-off-by: Angel Misevski <amisevsk@redhat.com>
After looking into this issue, it looks like this is expected behaviour on the Kubernetes side when In the common strategy, we create a pod with subpaths like:
Kubernetes will create the subpath directories in the PVC as needed. However, only the leaf directory has write permissions:
This means that the cleanup job that is created when a workspace is deleted cannot remove folders in the workspace directory. As a workaround, the setting
As further background (thanks @wongma7 for the help), AFAICT this change came about in fixing CVE-2017-1002101, as The only detail I haven't been able to figure out is why we only noticed this now -- it seems like this should have been a problem for quite some time (the commit fixing the CVE was 10 months ago). |
To be clear however, the files inside the folders are deleted successfully, so minimal space is wasted. |
PR #12513 sets precreate property to |
Created PR #12514 to grab logs from failed pods. |
The property CHE_INFRA_KUBERNETES_PVC_PRECREATE__SUBPATHS is required for PVC cleanup on current versions of Kubernetes/OpenShift. Without the property enabled, subpaths are created in PVCs by Kubernetes when they are needed for pods. However, only the leaf directory created in this way has write permissions for nonroot users. As a result, the cleanup pod cannot delete directories created (e.g. the workspaceX/projects) directory. For more details, see #12445 Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Closing issue as there's nothing more to be done on our end. |
Description
Workspace files are not removed when Common PVC strategy is configured.
P.S. Logged error message is not useful at all. It is needed to consider fething Job Pod logs if possible in case of error in this issue or a separate one.
Reproduction Steps
common
PVC strategy configured.Che 7
stack or any other.Expected: PV folder does not contain filed of removed workspace anymore. Che Server log does not container error about failing of files removing job.
Actual: PV folder still contains files of removed workspaces. Che Server log contains error that occurred during files cleaning up. See
Diagnostics
section.OS and version:
Che Server 6.18.0-SNAPSHOT
Docker image
docker.io/eclipse/che-server:nightly
(987c479083cd
16.01.2018 14:07)Single-User Che was deployed on minishift
Diagnostics:
Che Server Logs
OpenShift Events
PV folder after workspace removing
[root@minishift openshift.local.pv]# tree pv0045
pv0045
|-- workspace41yc8hv9o2pacs9i
| |-- che-logs
| | |-- che-plugin-broker
| | | |-- broker5ib5vi
| | |
-- brokerjglup9 | |
-- ws| | |-- che-machine-exec
| | |-- dev
| |
-- theia-ide | |-- plugins |
-- projectsThe text was updated successfully, but these errors were encountered: