Bug 1030777 - Delete app when userid is missing will not remove the gear dir
Delete app when userid is missing will not remove the gear dir
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jhon Honce
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-15 01:15 EST by Liang Xia
Modified: 2015-05-14 19:32 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-29 19:50:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Liang Xia 2013-11-15 01:15:54 EST
Description of problem:
Delete app when userid is missing will not remove the gear dir

Version-Release number of selected component (if applicable):
devenv_4038

How reproducible:
always

Steps to Reproduce:
1.Create an app.
2.SSH into the instance.
3.Remove the user of the gear in /etc/passwd on node.
4.Delete the app.
5.Check the gear dir in /var/lib/openshift

Actual results:
App delete successfully, but the gear dir and the link to this directory are left behind.

Expected results:
The gear dir and link should be removed.

Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=918764
Comment 1 Jakub Hadvig 2013-11-20 13:13:21 EST
I don't think that this is a bug, because if user at some point corrupts the system it is his fault. Its the same like if you delete some record from DB and then wonder where it is. 
Was looking on the platform-trace.log on the node and find that the problem might be that this two problems might be related.


...
November 20 11:48:37 INFO oo_spawn running userdel --remove -f "528ce61667bcd186be000032": {:unsetenv_others=>false, :close_others=>true, :in=>"/dev/null", :out=>#<IO:fd 13>, :err=>#<IO:fd 11>}
November 20 11:48:37 INFO oo_spawn running setquota --always-resolve -u 528ce61667bcd186be000032 0 0 0 0 -a /var: {:unsetenv_others=>false, :close_others=>true, :in=>"/dev/null", :out=>#<IO:fd 13>, :err=>#<IO:fd 11>}
November 20 11:48:37 INFO oo_spawn buffer(8/) setquota:
November 20 11:48:37 INFO oo_spawn buffer(8/) user 528ce61667bcd186be000032 does not exist.

So what I think is that I will let this bug opened and will fix the error handling that the user doesnt exists.
Comment 2 Liang Xia 2014-01-14 02:02:09 EST
"User does not exist" is gone from platform.log/platform-trace.log

Based on comment #1, move to verified.
Comment 3 Liang Xia 2014-01-14 02:13:59 EST
(In reply to Liang Xia from comment #2)
> "User does not exist" is gone from platform.log/platform-trace.log
> 
> Based on comment #1, move to verified.

Build is devenv_4217.
Comment 4 openshift-github-bot 2014-01-14 13:55:50 EST
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d5ca57a638ee7e3ede7850f890d12b5f94b83620
Bug 1030777 - Remove gear dir even if gear not in passwd file
Comment 6 Liang Xia 2014-01-14 21:35:11 EST
Verified on devenv_4223, the issue has been fixed.

1.Check whether new codes are there or not.
# grep remove_app_symlinks /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.8/lib/openshift-origin-node/model/application_container.rb
          remove_app_symlinks(@container_dir)
          remove_app_symlinks(@container_dir)
      def remove_app_symlinks(container_dir)

2.Create apps and check gears are created.
# ls /var/lib/openshift/
52d5eba01e82d3e7fb000007  915738339324026173784064       jenkins-lxia   phps-lxia
52d5ebf81e82d3e7fb000028  915738339324026173784064-lxia  last_access.log

3.Remove the users of the gears in /etc/passwd on node.

4.Delete the apps.
# rhc app delete phps --confirm
Deleting application 'phps' ... deleted
# rhc app delete jenkins --confirm 
Deleting application 'jenkins' ... deleted

5.Check the gear dir in /var/lib/openshift/
# ls /var/lib/openshift/
last_access.log

Note You need to log in before you can comment on or make changes to this bug.