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

Activity Log says folder is Deleted but deletion actually failed #10300

Closed
Germs2004 opened this issue Jul 19, 2018 · 9 comments
Closed

Activity Log says folder is Deleted but deletion actually failed #10300

Germs2004 opened this issue Jul 19, 2018 · 9 comments
Labels

Comments

@Germs2004
Copy link

Steps to reproduce

  1. Install brand new NextCloud server
  2. Select all the default files and folders
  3. Click the Delete icon

Expected behaviour

I expect all those files and folders to be deleted. If deletion fails, I expect the Activity Log for those folders to NOT say that they were deleted.

Actual behaviour

An error popped up saying that the Documents and Photos folders could not be deleted. Also, when I select the Documents folder and view details, the Activity Log says "You deleted Documents" though clearly it has not been deleted, so apparently it logs the deletion even when the deletion did not successfully occur.

Server configuration

appliance from Tech and Me

Operating system:
Ubuntu?

Web server:
Apache?

Database:
PostgreSQL?

PHP version:
?

Nextcloud version: (see Nextcloud admin page)
13.0.4

Updated from an older Nextcloud/ownCloud or fresh install:
fresh install

Where did you install Nextcloud from:
came on the appliance

Signing status:
"No errors have been found."

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

LDAP configuration (delete this part if not used)

none

Client configuration

Chrome

Operating system:
Win10

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #6092 (Cant delete Folder), #9697 (Log failed logins to activity log), #4375 (User deletion fails in some circumstances), #1354 (Failed to restore deleted folder Snafu, because of insufficient storage?), and #9812 (All shared folders deleted when deleting one shared folder).

@MorrisJobke
Copy link
Member

Is there anything in the nextcloud.log in your data directory?

@MorrisJobke
Copy link
Member

cc @nickvergessen

@nickvergessen
Copy link
Member

nickvergessen commented Jul 20, 2018

Activity listens to the pre hook, because afterwards paths could not be build anymore 🤷‍♂️

@Germs2004
Copy link
Author

Germs2004 commented Jul 20, 2018

log file attached. Looks like maybe line 38 mentions trying to delete the Photos folder.

nextcloud.log

Also, I should say that when I went back and tried to delete those folders later on, the deletion happened successfully.

@MorrisJobke
Copy link
Member

{
    "reqId": "P99IcxjImruQjM122i3X",
    "level": 4,
    "time": "2018-07-19T15:42:56-04:00",
    "remoteAddr": "192.168.4.1",
    "user": "Jeremy",
    "app": "webdav",
    "method": "DELETE",
    "url": "/remote.php/webdav/Photos",
    "message": {
        "Exception": "Doctrine\DBAL\Exception\UniqueConstraintViolationException",
        "Message": "An exception occurred while executing 'INSERT INTO \\\"oc_filecache\\\" (\\\"mimepart\\\",\\\"mimetype\\\",\\\"mtime\\\",\\\"size\\\",\\\"etag\\\",\\\"storage_mtime\\\",\\\"permissions\\\",\\\"checksum\\\",\\\"path_hash\\\",\\\"path\\\",\\\"parent\\\",\\\"name\\\",\\\"storage\\\") SELECT ?,?,?,?,?,?,?,?,?,?,?,?,? FROM \\\"oc_filecache\\\" WHERE \\\"storage\\\" = ? AND \\\"path_hash\\\" = ? HAVING COUNT(*) = 0' with params [1, 2, 1532029376, -1, \\\"5b50e9c0311aa\\\", 1532029376, 31, \\\"\\\", \\\"fb66dca5f27af6f15c1d1d81e6f8d28b\\\", \\\"files_trashbin\\\", 222, \\\"files_trashbin\\\", 5, 5, \\\"fb66dca5f27af6f15c1d1d81e6f8d28b\\\"]:\\n\\nSQLSTATE[23505]: Unique violation: 7 ERROR:  duplicate key value violates unique constraint \\\"fs_storage_path_hash\\\"\\nDETAIL:  Key (storage, path_hash)=(5, fb66dca5f27af6f15c1d1d81e6f8d28b) already exists.",
        "Code": 0,
        "Trace": "#0 3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractPostgreSQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
        #1 3rdparty/doctrine/dbal/lib\\/Doctrine\\/DBAL\\/Connection.php(1015): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOPgSql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO \\\"oc...', Array)
        #2 lib\\/private/DB/Connection.php(216): Doctrine\DBAL\Connection->executeUpdate('INSERT INTO \\\"oc...', Array, Array)
        #3 lib/private/DB/Adapter.php(114): OC\DB\Connection->executeUpdate('INSERT INTO \\\"oc...', Array)
        #4 lib/private/DB/Connection.php(254): OC\DB\Adapter->insertIfNotExist('*PREFIX*filecac...', Array, Array)
        #5 lib/private/Files/Cache/Cache.php(273): OC\DB\Connection->insertIfNotExist('*PREFIX*filecac...', Array, Array)
        #6 lib/private/Files/Cache/Wrapper/CacheWrapper.php(128): OC\Files\Cache\Cache->insert('files_trashbin', Array)
        #7 lib/private/Files/Cache/Wrapper/CacheWrapper.php(114): OC\Files\Cache\Wrapper\CacheWrapper->insert('files_trashbin', Array)
        #8 lib/private/Files/Cache/Scanner.php(292): OC\Files\Cache\Wrapper\CacheWrapper->put('files_trashbin', Array)
        #9 lib/private/Files/Cache/Scanner.php(221): OC\Files\Cache\Scanner->addToCache('files_trashbin', Array, -1)
        #10 lib/private/Files/Cache/Scanner.php(180): OC\Files\Cache\Scanner->scanFile('files_trashbin')
        #11 lib/private/Files/Cache/Scanner.php(336): OC\Files\Cache\Scanner->scanFile('files_trashbin/...', 3, -1, NULL, false)
        #12 lib/private/Files/Cache/Updater.php(124): OC\Files\Cache\Scanner->scan('files_trashbin/...', false, 3, false)
        #13 lib/private/Files/View.php(319): OC\Files\Cache\Updater->update('files_trashbin/...', 1532029376)
        #14 lib/private/Files/View.php(1163): OC\Files\View->writeUpdate(Object(OCA\FilesAccessControl\StorageWrapper), 'files_trashbin/...')
        #15 lib/private/Files/View.php(267): OC\Files\View->basicOperation('mkdir', '/files_trashbin...', Array)
        #16 apps/files_trashbin/lib/Trashbin.php(159): OC\Files\View->mkdir('files_trashbin/...')
        #17 apps/files_trashbin/lib/Trashbin.php(230): OCA\Files_Trashbin\Trashbin::setUpTrash('Jeremy')
        #18 apps/files_trashbin/lib/Storage.php(289): OCA\Files_Trashbin\Trashbin::move2trash('Photos', false)
        #19 apps/files_trashbin/lib/Storage.php(208): OCA\Files_Trashbin\Storage->doDelete('files/Photos', 'rmdir')
        #20 apps/files_accesscontrol/lib/StorageWrapper.php(75): OCA\Files_Trashbin\Storage->rmdir('files/Photos')
        #21 lib/private/Files/View.php(1148): OCA\FilesAccessControl\StorageWrapper->rmdir('files/Photos')
        #22 lib/private/Files/View.php(346): OC\Files\View->basicOperation('rmdir', '/Photos', Array)
        #23 apps/dav/lib/Connector/Sabre/Directory.php(312): OC\Files\View->rmdir('/Photos')
        #24 3rdparty/sabre/dav/lib/DAV/Tree.php(179): OCA\DAV\Connector\Sabre\Directory->delete()
        #25 3rdparty/sabre/dav/lib/DAV/CorePlugin.php(291): Sabre\DAV\Tree->delete('Photos')
        #26 [internal function]: Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
        #27 3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
        #28 3rdparty/sabre/dav/lib/DAV/Server.php(479): Sabre\Event\EventEmitter->emit('method:DELETE', Array)
        #29 3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
        #30 apps/dav/appinfo/v1/webdav.php(80): Sabre\DAV\Server->exec()
        #31 remote.php(164): require_once('/var/www/nextcl...')
        #32 {main}",
        "File": "3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php",
        "Line": 64
    },
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
    "version": "13.0.4.0"
}

Duplicate of #6160

@Germs2004
Copy link
Author

Is this really a duplicate? This ticket is about the fact that the Activity Log says the delete happened even though it hasn't. The 6160 ticket seems to be just about the failure to delete, which I believe is a separate bug. It seems that both issues ought to be addressed so that, even if a delete fails, at least the activity log will always be accurate.

@MorrisJobke
Copy link
Member

This ticket is about the fact that the Activity Log says the delete happened even though it hasn't.

This is only the symptom and not the cause. The cause is the DB error.

@Germs2004
Copy link
Author

Ok, I understand. I was just thinking that defensive programming would say to also improve the logging code so that it doesn't log things incorrectly. If your code always expects everything to work perfectly and flow from one function to the next without error checking in between, then one error (failure to delete) can lead to other problems (mistake in the log). It's fragile code.

I'm still looking for our ideal DMS so I'll get out of your way. Thanks for the quick responses to my tickets. I think NextCloud has the best looking UI of all the systems I've seen so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants