Skip to content

External Storage Offline result in Deletion #11149

Closed

Description

@Green9332

Steps to reproduce

  1. Install OC and Windows Client
  2. Add SFTP external storage already containing data
  3. Wait for sync
  4. Take SFTP server offline
  5. OC Clients will start to delete local folders and files, starting with empty folders. Giving errors on folders already containing files.

Expected behaviour

If there is an external storage defined and offline, do not assume it has been deleted altogether. Rather assume it is offline and for the time being, simply ignore/skip the referenced files and folders.

Actual behaviour

OC Server seemingly assumes the worst and communicates it as such to the connected clients.

Server configuration

Operating system:
Windows 2012R2

Web server:
IIS 8.5

Database:
MariaDB 10

PHP version:
5.6

ownCloud version: (see ownCloud admin page)
ownCloud 7.0.2 (stable)

Updated from an older ownCloud or fresh install:
No

List of activated apps:
OOTB, just External Storage added

The content of config/config.php:

'E:\shares\com\oc', 'dbtype' => 'mysql', 'version' => '7.0.2.1', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'installed' => true, 'forcessl' => true, 'loglevel' => '2', ); **Are you using external storage, if yes which one:** local/smb/sftp/... SFTP **Are you using encryption:** yes/no No ### Client configuration **Browser:** FF, Chrome, IE - in that order **Operating system:** Win7Ult OC Client 1.6.3 (build 3721) ### Logs #### Web server log 2014-09-17 19:17:45 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 894 2014-09-17 19:17:50 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 2810 2014-09-17 19:17:50 1.2.3.4 PROPFIND /remote.php/webdav/ZAFSS1/Projects - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 404 0 0 2807 2014-09-17 19:17:54 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 6037 2014-09-17 19:17:56 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 4960 2014-09-17 19:17:56 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 401 0 0 359 2014-09-17 19:18:02 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 5015 2014-09-17 19:18:05 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 11264 2014-09-17 19:18:05 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 401 0 0 312 2014-09-17 19:18:22 1.2.3.4 GET /status.php - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 200 0 0 234 2014-09-17 19:18:33 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 10645 2014-09-17 19:18:40 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 20791 2014-09-17 19:18:43 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 10691 2014-09-17 19:18:44 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 38300 2014-09-17 19:18:47 1.2.3.4 PROPFIND /remote.php/webdav/ZAFSS1/Projects - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 401 0 0 328 2014-09-17 19:18:47 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 14465 2014-09-17 19:18:47 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 401 0 0 453 2014-09-17 19:18:48 1.2.3.4 PROPFIND /remote.php/webdav/ZAFSS1/Projects - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 404 0 0 1046 2014-09-17 19:18:48 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 24441 2014-09-17 19:18:50 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 2895 2014-09-17 19:18:53 1.2.3.4 PROPFIND /remote.php/webdav/ADC - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3131 2014-09-17 19:18:57 1.2.3.4 PROPFIND /remote.php/webdav/ADC/URLs - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3385 2014-09-17 19:19:00 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Training - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3399 2014-09-17 19:19:03 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Tests - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3328 2014-09-17 19:19:03 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 1265 2014-09-17 19:19:05 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 401 0 0 328 2014-09-17 19:19:06 1.2.3.4 PROPFIND /remote.php/webdav - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 1578 2014-09-17 19:19:06 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Source - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3187 2014-09-17 19:19:09 1.2.3.4 PROPFIND /remote.php/webdav/GDMS - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 2515 2014-09-17 19:19:09 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Releases - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3265 2014-09-17 19:19:11 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 1062 2014-09-17 19:19:11 1.2.3.4 PROPFIND /remote.php/webdav/GDMS/URLs - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 2781 2014-09-17 19:19:13 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Docs - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3234 2014-09-17 19:19:13 1.2.3.4 PROPFIND /remote.php/webdav/ - 443 - 1.2.3.5 Mozilla/5.0+(Windows)+mirall/1.6.3 - 207 0 0 796 2014-09-17 19:19:14 1.2.3.4 PROPFIND /remote.php/webdav/GDMS/Training - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 2671 2014-09-17 19:19:16 1.2.3.4 PROPFIND /remote.php/webdav/ADC/Docs/Workflows - 443 - 1.2.3.7 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 3218 2014-09-17 19:19:16 1.2.3.4 PROPFIND /remote.php/webdav/GDMS/Tests - 443 - 1.2.3.6 Mozilla/5.0+(Windows)+csyncoC/0.91.5+neon/0.30.0 - 207 0 0 2859 #### ownCloud log (data/owncloud.log) {"app":"PHP","message":"Cannot connect to apc.example.com. Error 10061. No connection could be made because the target machine actively refused it. at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#875","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"PHP","message":"unpack(): Type N: not enough input, need 4, have 0 at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"PHP","message":"extract() expects parameter 1 to be array, boolean given at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"PHP","message":"Undefined variable: length at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3519","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"PHP","message":"Unsupported signature format at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3638","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"core","message":"Login failed","level":3,"time":"2014-09-17T19:17:48+00:00"} {"app":"PHP","message":"Cannot connect to apc.example.com. Error 10061. No connection could be made because the target machine actively refused it. at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#875","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"unpack(): Type N: not enough input, need 4, have 0 at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"extract() expects parameter 1 to be array, boolean given at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"Undefined variable: length at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3519","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"Unsupported signature format at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3638","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"core","message":"Login failed","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"Cannot connect to apc.example.com. Error 10061. No connection could be made because the target machine actively refused it. at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#875","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"unpack(): Type N: not enough input, need 4, have 0 at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"extract() expects parameter 1 to be array, boolean given at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3518","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"Undefined variable: length at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3519","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"PHP","message":"Unsupported signature format at D:\sites\com\oc\3rdparty\phpseclib\phpseclib\phpseclib\Net\SSH2.php#3638","level":3,"time":"2014-09-17T19:17:49+00:00"} {"app":"core","message":"Login failed","level":3,"time":"2014-09-17T19:17:49+00:00"}

Activity

  1. LukasReschke commented on Sep 18, 2014

    @LukasReschke
    Contributor

    @MTRichards Might be also important for EE considering SP et al.

  2. MTRichards commented on Sep 18, 2014

    @MTRichards
    Contributor

    @jnfrmarks can we test?
    @rperezb what happens in this situation for SP and network drives?

  3. rperezb commented on Sep 18, 2014

    @rperezb

    Checked on Network Drive, it deppends on the connectivity check:

    • If you are browsing, you may see the folder empty
    • If you refresh, the connectivity check is launched and the error is detected

    From ownCloud we are not deleting anything, the thing is that we are not showing any information due to the fact that we don´t have access to it.

    screen shot 2014-09-18 at 15 21 17

  4. MTRichards commented on Sep 18, 2014

    @MTRichards
    Contributor

    I am most concerned about what happens to the desktop client. Do we delete the files? We should not, it should be a temporary error thrown...

  5. Green9332 commented on Sep 18, 2014

    @Green9332
    Author

    Only good thing about this is the folders/files end up in Deleted Items and can therefore be restored at the OC server. But if you had a 100GB repository shared with 100 clients, OC will start deleting potentially 10TB of files on the clients - which has to be replicated again. Empty folders are definitely all deleted. As mine was a production system (in which I had to restart the 50TB RAID NAS for a software update), I did not sit idly by to wait until the damage was done. In fact, I watched it very very closely since I didn't factually know what will happen and expected something iffy will probably come of the situation.

    So, I stopped the OC rather fast to prevent any further checking/replicating/propagation of the issue. What I could see in realtime was that the client also tried to delete the folders which contained files, but gave errors (most likely the only saving grace was that OC client tried to delete the folders first before deleting the contained files - thereby running into a "folder not empty" error. If not for that, I'm pretty sure the files would have been wiped eventually as well, and then the folders)

    So, whilst there may not be an issue on the web interface for a disconnected store, you may also not have anything to show after a while if the OC has moved it all to Deleted Items. And/or your files will still be on the store (since it was offline during the OC process), but OC would have "moved" it's cached references to the Deleted Items.

    Either way, it is a train smash waiting to happen.

  6. RobinMcCorkell commented on Sep 18, 2014

    @RobinMcCorkell
    Contributor

    Yes, this was noticed a while back in that issue I just linked. ownCloud currently does not differentiate between non-existent/broken storages and temporary failures. @icewind1991 what do you think, high severity?

  7. PVince81 commented on Sep 19, 2014

    @PVince81
    Contributor

    I think @icewind1991 has added some code for server to server sharing where it's possible for mount points to have the state "currently not available". The same status/code could be reused for regular external storages, assuming that the clients should be able to understand that.

    I believe it might return a 503 when propfinding that folder.

    @icewind1991 can you confirm ?

  8. icewind1991 commented on Sep 19, 2014

    @icewind1991
    Contributor

    Yes, storages can throw a \OCP\Files\StorageNotAvailableException which will be handled correctly by the webinterface and sync client

  9. rperezb commented on Sep 19, 2014

    @rperezb

    @MTRichards yes, if there is not connectivity with the mountpoint, on the desktop the data is "removed" from the desktop client. For us, it´s the same situation as your credentials have not been entered or have been modified.
    If we wanted not to be removed the data, we would have to change the plugins design; plus, check how the desktop client handles http 503.

  10. MTRichards commented on Sep 19, 2014

    @MTRichards
    Contributor

    Ok @rperezb
    As an enhancement, we should seek to use this:

    Yes, storages can throw a \OCP\Files\StorageNotAvailableException which will be handled correctly by the webinterface and sync client

    So that these files are not deleted just because the server goes down. In fact, in at least one use case (server goes down) the desktop is the only source for the files. If they get deleted, then this would be bad. So Yes, this needs to be put into that repo as an enhancement for SP and win network drives.

  11. MTRichards commented on Sep 19, 2014

    @MTRichards
    Contributor

    Also, to add, we need to consider a time based expiration. If it is offline for, say, 7 days it gets removed by the sync client. But we don't want the sync client removing things just if there is a network error that is highly temporary. Since we can't tell the difference, we should have a time window.

    This should also be reflected in all of our external storage connectors...

  12. 11 remaining items

  13. added this to the backlog milestone on Jan 27, 2017
  14. ownclouders commented on Jan 13, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  15. ownclouders commented on Feb 23, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  16. PVince81 commented on Oct 15, 2018

    @PVince81
    Contributor

    closing in favor of #32552 which has more research

  17. locked as resolved and limited conversation to collaborators on Oct 15, 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