Skip to content

Deleting user with provisioning API can take a long time #21249

Closed

Description

@christopheg

When deleting a user via an API call, the answer from API can take a very long time.
Current situation:

  1. An API call to https://my_owncloud/ocs/v1.php/cloud/users/my_username (DELETE)
  2. The server deletes the data of this user (can take a very long time if the user has 200GB of small files)
  3. An answer is sent via API

Better would be:

  1. An API call to https://my_owncloud/ocs/v1.php/cloud/users/my_username (DELETE)
  2. The server marks the user as 'deleted'. The account will be blocked (no login possible)
  3. An answer is sent via API
  4. A cleanup via Cron is performed in the background

Activity

  1. added this to the backlog milestone on Dec 17, 2015
  2. PVince81 commented on Dec 17, 2015

    @PVince81
    Contributor

    @christopheg ownCloud version ?

  3. PVince81 commented on Dec 17, 2015

    @PVince81
    Contributor

    What you described under "Better would be" was implemented in OC >= 8.1.
    The slow behavior was in OC < 8.1.

  4. PVince81 commented on Dec 17, 2015

    @PVince81
    Contributor

    Ref #14644

  5. gerryd commented on Dec 18, 2015

    @gerryd

    Hi Vincent,

    I'm afraid it isn't fixed. I think you might have misunderstood the description. I'll try to explain it in another way. :)

    The ownCloud version used is 8.1.4.

    The problem is that deleting a user who has many files in his/her account takes a long time. It would be better if the actual "delete" operation was a background task and the API would immediately return an OK. See the examples below.

    User with just a few files

    [me@host ~]$ time curl -X DELETE --user username:password https://my.owncloud.install/ocs/v1.php/cloud/users/foo
    <?xml version="1.0"?>
    <ocs>
     <meta>
      <status>ok</status>
      <statuscode>100</statuscode>
      <message/>
     </meta>
     <data/>
    </ocs>
    
    real    0m0.133s
    user    0m0.010s
    sys 0m0.000s
    

    User with many files

    [me@host ~]$ time curl -X DELETE --user username:password https://my.owncloud.install/ocs/v1.php/cloud/users/bar
    <html>
    <head><title>504 Gateway Time-out</title></head>
    <body bgcolor="white">
    <center><h1>504 Gateway Time-out</h1></center>
    <hr><center>nginx/1.6.2</center>
    </body>
    </html>
    
    real    6m0.046s
    user    0m0.010s
    sys 0m0.013s
    
  6. PVince81 commented on Dec 18, 2015

    @PVince81
    Contributor

    Ah, that's more clear.
    When I saw "DELETE" I directly thought Webdav DELETE.
    I'll adjust the subject.

  7. changed the title [-]DELETE can take a long time[/-] [+]Deleting user with provisioning API can take a long time[/+] on Dec 18, 2015
  8. hodyroff commented on Mar 28, 2017

    @hodyroff

    Since we now have disable I would think that it should be put on disable first and then be deleted - so what you wanted is now reachable without changing code. Closing, please comment/reopen if I am wrong.

  9. lock commented on Aug 2, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  10. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions