{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/28529","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/28529/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/28529/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/28529/events","html_url":"https://github.com/owncloud/core/pull/28529","id":246369034,"number":28529,"title":"[WIP] Add foreign keys to filecache, share","user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"labels":[{"id":17709833,"url":"https://api.github.com/repos/owncloud/core/labels/2%20-%20Developing","name":"2 - Developing","color":"ededed","default":false},{"id":751771728,"url":"https://api.github.com/repos/owncloud/core/labels/status/STALE","name":"status/STALE","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"assignees":[{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/11","html_url":"https://github.com/owncloud/core/milestone/11","labels_url":"https://api.github.com/repos/owncloud/core/milestones/11/labels","id":697149,"number":11,"title":"backlog","description":"","creator":{"login":"MTRichards","id":1818977,"avatar_url":"https://avatars2.githubusercontent.com/u/1818977?v=4","gravatar_id":"","url":"https://api.github.com/users/MTRichards","html_url":"https://github.com/MTRichards","followers_url":"https://api.github.com/users/MTRichards/followers","following_url":"https://api.github.com/users/MTRichards/following{/other_user}","gists_url":"https://api.github.com/users/MTRichards/gists{/gist_id}","starred_url":"https://api.github.com/users/MTRichards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTRichards/subscriptions","organizations_url":"https://api.github.com/users/MTRichards/orgs","repos_url":"https://api.github.com/users/MTRichards/repos","events_url":"https://api.github.com/users/MTRichards/events{/privacy}","received_events_url":"https://api.github.com/users/MTRichards/received_events","type":"User","site_admin":false},"open_issues":755,"closed_issues":1210,"state":"open","created_at":"2014-06-20T19:52:03Z","updated_at":"2018-04-27T08:46:35Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2017-07-28T14:46:15Z","updated_at":"2018-04-27T08:46:35Z","closed_at":"2018-04-27T08:46:35Z","author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/28529","html_url":"https://github.com/owncloud/core/pull/28529","diff_url":"https://github.com/owncloud/core/pull/28529.diff","patch_url":"https://github.com/owncloud/core/pull/28529.patch"},"body":"Just for fun...\r\n\r\nFixes https://github.com/owncloud/core/issues/13143.\r\n\r\nSetting up the DB works but as soon as you try accessing the filesystem 💥 \r\n\r\n```\r\n{\"reqId\":\"21UH6QkWsTlqzd3QlFD9\",\"level\":4,\"time\":\"2017-07-28T14:45:44+00:00\",\"remoteAddr\":\"127.0.0.1\",\"user\":\"admin\",\"app\":\"webdav\",\"method\":\"PROPFIND\",\"url\":\"/owncloud/remote.php/webdav/\",\"message\":\"Exception: {\"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\", 1501253047, -1, \"597b4e18a28aa\", 1501253047, 23, \"\", \"d41d8cd98f00b204e9800998ecf8427e\", \"\", -1, \"\", 1, 1, \"d41d8cd98f00b204e9800998ecf8427e\"]:\\n\\nSQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`owncloud`.`oc_filecache`, CONSTRAINT `FK_D3AD7FD63D8E604F` FOREIGN KEY (`parent`) REFERENCES `oc_filecache` (`fileid`) ON DELETE CASCADE)\",\"Exception\":\"Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException\",\"Code\":0,\"Trace\":\"\r\n#0 /srv/www/htdocs/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))\r\n#1 /srv/www/htdocs/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1015): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'INSERT INTO `oc...', Array)\r\n#2 /srv/www/htdocs/owncloud/lib/private/DB/Connection.php(211): Doctrine\\DBAL\\Connection->executeUpdate('INSERT INTO `oc...', Array, Array)\r\n#3 /srv/www/htdocs/owncloud/lib/private/DB/Adapter.php(113): OC\\DB\\Connection->executeUpdate('INSERT INTO `*P...', Array)\r\n#4 /srv/www/htdocs/owncloud/lib/private/DB/Connection.php(249): OC\\DB\\Adapter->insertIfNotExist('*PREFIX*filecac...', Array, Array)\r\n#5 /srv/www/htdocs/owncloud/lib/private/Files/Cache/Cache.php(267): OC\\DB\\Connection->insertIfNotExist('*PREFIX*filecac...', Array, Array)\r\n#6 /srv/www/htdocs/owncloud/lib/private/Files/Cache/Cache.php(222): OC\\Files\\Cache\\Cache->insert('', Array)\r\n#7 /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(269): OC\\Files\\Cache\\Cache->put('', Array)\r\n#8 /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(209): OC\\Files\\Cache\\Scanner->addToCache('', Array, -1)\r\n#9 /srv/www/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(312): OC\\Files\\Cache\\Scanner->scanFile('', 3, -1, NULL, true)\r\n#10 /srv/www/htdocs/owncloud/lib/private/Files/View.php(1302): OC\\Files\\Cache\\Scanner->scan('', false)\r\n#11 /srv/www/htdocs/owncloud/lib/private/Files/View.php(1343): OC\\Files\\View->getCacheEntry(Object(OC\\Files\\Storage\\Wrapper\\Checksum), '', '/admin')\r\n#12 /srv/www/htdocs/owncloud/lib/private/Files/Node/Root.php(182): OC\\Files\\View->getFileInfo('/admin')\r\n#13 /srv/www/htdocs/owncloud/lib/private/Files/Node/Root.php(353): OC\\Files\\Node\\Root->get('/admin')\r\n#14 /srv/www/htdocs/owncloud/lib/private/Server.php(940): OC\\Files\\Node\\Root->getUserFolder('admin')\r\n#15 /srv/www/htdocs/owncloud/apps/dav/lib/Connector/Sabre/ServerFactory.php(128): OC\\Server->getUserFolder()\r\n#16 [internal function]: OCA\\DAV\\Connector\\Sabre\\ServerFactory->OCA\\DAV\\Connector\\Sabre\\{closure}(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\r\n#17 /srv/www/htdocs/owncloud/lib/composer/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Object(Closure), Array)\r\n#18 /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(466): Sabre\\Event\\EventEmitter->emit('beforeMethod', Array)\r\n#19 /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\r\n#20 /srv/www/htdocs/owncloud/apps/dav/appinfo/v1/webdav.php(63): Sabre\\DAV\\Server->exec()\r\n#21 /srv/www/htdocs/owncloud/remote.php(165): require_once('/srv/www/htdocs...')\r\n#22 {main}\",\"File\":\"/srv/www/htdocs/owncloud/lib/composer/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php\",\"Line\":60,\"User\":\"admin\"}\"}\r\n```\r\n\r\n@DeepDiver1975 @butonic @tomneedham "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/384907177","html_url":"https://github.com/owncloud/core/pull/28529#issuecomment-384907177","issue_url":"https://api.github.com/repos/owncloud/core/issues/28529","id":384907177,"user":{"login":"PVince81","id":277525,"avatar_url":"https://avatars2.githubusercontent.com/u/277525?v=4","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T08:46:35Z","updated_at":"2018-04-27T08:46:35Z","author_association":"OWNER","body":"to be redone step by step: not all tables at once"}}
{"actor":{"display_login":"PVince81"}}