{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/25933","repository_url":"https://api.github.com/repos/owncloud/core","labels_url":"https://api.github.com/repos/owncloud/core/issues/25933/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/25933/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/25933/events","html_url":"https://github.com/owncloud/core/issues/25933","id":172990749,"number":25933,"title":"Login throws SQL Exception on owncloud 9.1.1RC1 with activated file sharing plugin","user":{"login":"scroach","id":4665730,"avatar_url":"https://avatars.githubusercontent.com/u/4665730?v=3","gravatar_id":"","url":"https://api.github.com/users/scroach","html_url":"https://github.com/scroach","followers_url":"https://api.github.com/users/scroach/followers","following_url":"https://api.github.com/users/scroach/following{/other_user}","gists_url":"https://api.github.com/users/scroach/gists{/gist_id}","starred_url":"https://api.github.com/users/scroach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scroach/subscriptions","organizations_url":"https://api.github.com/users/scroach/orgs","repos_url":"https://api.github.com/users/scroach/repos","events_url":"https://api.github.com/users/scroach/events{/privacy}","received_events_url":"https://api.github.com/users/scroach/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/90","html_url":"https://github.com/owncloud/core/milestones/9.1.1","labels_url":"https://api.github.com/repos/owncloud/core/milestones/90/labels","id":1857607,"number":90,"title":"9.1.1","description":null,"creator":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","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},"open_issues":205,"closed_issues":81,"state":"open","created_at":"2016-06-30T14:57:55Z","updated_at":"2016-08-24T22:18:17Z","due_on":"2016-08-23T04:00:00Z","closed_at":null},"comments":9,"created_at":"2016-08-24T15:53:22Z","updated_at":"2016-08-25T10:37:38Z","closed_at":null,"body":"@PVince81 As you requested my issue here in a separate ticket.\r\nTo give you a little more \"history\" - we migrated our old debian server to a new ubuntu server this week. Initial plan was to move from the old installlation to using owncloud in docker - unfortunately this caused problems with our apache reverse proxy (I think WebDAV calendar sync made problems in 9.0 something like \"not in base url\" and index.phpp) and there were problems when trying to update to 9.1 - but I cannot exactly tell you what now.\r\nSo we moved back to apt-get - migrated config and data folders and ran the update to 9.1 - which wouldn't work with file sharing. I think we first got the CSRF error when trying to login in, disabled the plugin and then couldnt enable it again reporting something like \"plugin makes server unstable\".\r\nWe found your update 9.1.1 #25557 and wanted to give it a try. And here we are - (after having lots and lots of bugs and troubles) we cannot login with some of our users getting this SQL exception.\r\n\r\nI hope you could give us some advice on what we could try now. Thanks!\r\n\r\n<!--\r\nThanks for reporting issues back to ownCloud! This is the issue tracker of ownCloud, if you have any support question please check out https://owncloud.org/support\r\n\r\nThis is the bug tracker for the Server component. Find other components at https://github.com/owncloud/core/blob/master/CONTRIBUTING.md#guidelines\r\n\r\nFor reporting potential security issues please see https://owncloud.org/security/\r\n\r\nTo make it possible for us to help you please fill out below information carefully.\r\n\r\nBefore reporting any issues please make sure that you're using the latest available version for your major branch (e.g. 9.0.x), see https://owncloud.org/changelog/\r\n--> \r\n### Steps to reproduce\r\n1. Dont know :(\r\n\r\n### Expected behaviour\r\nFile sharing works and login is possible\r\n\r\n### Actual behaviour\r\nLogin does not work with activated file sharing plugin\r\n\r\n### Server configuration\r\n**Operating system**: Ubuntu 16.04\r\n\r\n**Web server:** Apache2\r\n\r\n**Database:** Mysql 5.6\r\n\r\n**PHP version:** 7.0.8\r\n\r\n**ownCloud version:** 9.1.1\r\n\r\n**Updated from an older ownCloud or fresh install:** 8.2.1.4 > 9.0 > 9.1\r\n\r\n**Where did you install ownCloud from:** apt\r\n\r\n**Signing status (ownCloud 9.0 and above):**\r\n\r\n```\r\nNo errors have been found.\r\n```\r\n\r\n**List of activated apps:**\r\n\r\n```\r\nEnabled:\r\n  - activity: 2.3.2\r\n  - calendar: 1.3.2\r\n  - comments: 0.3.0\r\n  - dav: 0.2.6\r\n  - encryption: 1.3.0\r\n  - federatedfilesharing: 0.3.0\r\n  - federation: 0.1.0\r\n  - files: 1.5.1\r\n  - files_pdfviewer: 0.8.1\r\n  - files_texteditor: 2.1\r\n  - files_trashbin: 0.9.0\r\n  - files_versions: 1.3.0\r\n  - files_videoplayer: 0.9.8\r\n  - firstrunwizard: 1.1\r\n  - gallery: 15.0.0\r\n  - notifications: 0.3.0\r\n  - provisioning_api: 0.5.0\r\n  - systemtags: 0.3.0\r\n  - templateeditor: 0.1\r\n  - updatenotification: 0.2.1\r\nDisabled:\r\n  - external\r\n  - files_antivirus\r\n  - files_external\r\n  - files_sharing\r\n  - user_external\r\n  - user_ldap\r\n```\r\n\r\n**The content of config/config.php:**\r\n\r\n```\r\n{\r\n    \"system\": {\r\n        \"instanceid\": \"oc1gg01dunez\",\r\n        \"passwordsalt\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"secret\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"trusted_domains\": [\r\n            \"xxx\",\r\n            \"xxx\"\r\n        ],\r\n        \"overwrite.cli.url\": \"xxx\",\r\n        \"dbtype\": \"mysql\",\r\n        \"version\": \"9.1.1.0\",\r\n        \"dbname\": \"owncloud\",\r\n        \"dbhost\": \"127.0.0.1:3306\",\r\n        \"dbtableprefix\": \"oc_\",\r\n        \"dbuser\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"dbpassword\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"logtimezone\": \"UTC\",\r\n        \"installed\": true,\r\n        \"mail_smtpmode\": \"smtp\",\r\n        \"mail_smtpsecure\": \"ssl\",\r\n        \"mail_from_address\": \"xxx\",\r\n        \"mail_domain\": \"xxx\",\r\n        \"mail_smtphost\": \"xxx\",\r\n        \"mail_smtpport\": \"465\",\r\n        \"mail_smtpauth\": 1,\r\n        \"mail_smtpauthtype\": \"LOGIN\",\r\n        \"mail_smtpname\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"mail_smtppassword\": \"***REMOVED SENSITIVE VALUE***\",\r\n        \"theme\": \"\",\r\n        \"maintenance\": false,\r\n        \"loglevel\": 2,\r\n        \"trashbin_retention_obligation\": \"auto\",\r\n        \"updatechecker\": false\r\n    }\r\n}\r\n```\r\n\r\n**Are you using external storage, if yes which one:** local\r\n\r\n**Are you using encryption:** yes/no\r\n\r\n**Are you using an external user-backend, if yes which one:** no\r\n\r\n### Client configuration\r\n**Browser:** Firefox\r\n\r\n**Operating system:** Windows 7\r\n\r\n### Logs\r\n\r\n#### ownCloud log (data/owncloud.log)\r\n```\r\n{\"reqId\":\"AO1OAdlnpklUTvXF6Ui4\",\"remoteAddr\":\"xxxxxx\",\"app\":\"index\",\"message\":\"Exception: {\\\"Exception\\\":\\\"Doctrine\\\\\\\\DBAL\\\\\\\\Exception\\\\\\\\DriverException\\\",\\\"Message\\\":\\\"An exception occurred while executing 'INSERT INTO oc_mounts (storage_id,root_id,user_id,mount_point) SELECT ?,?,?,? FROM oc_mounts WHERE root_id = ? AND user_id = ? HAVING COUNT(*) = 0' with params [false, 2147, \\\\\\\"winkelmayer\\\\\\\", \\\\\\\"\\\\\\\\\\\\\\/winkelmayer\\\\\\\\\\\\\\/files\\\\\\\\\\\\\\/xxxxx\\\\\\\\\\\\\\/\\\\\\\", 2147, \\\\\\\"winkelmayer\\\\\\\"]:\\\\n\\\\nSQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'storage_id' at row 1\\\",\\\"Code\\\":0,\\\"Trace\\\":\\\"#0 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/3rdparty\\\\\\/doctrine\\\\\\/dbal\\\\\\/lib\\\\\\/Doctrine\\\\\\/DBAL\\\\\\/DBALException.php(116): Doctrine\\\\\\\\DBAL\\\\\\\\Driver\\\\\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\\\\\DBAL\\\\\\\\Driver\\\\\\\\PDOException))\\\\n#1 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/3rdparty\\\\\\/doctrine\\\\\\/dbal\\\\\\/lib\\\\\\/Doctrine\\\\\\/DBAL\\\\\\/Connection.php(996): Doctrine\\\\\\\\DBAL\\\\\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\\\\\DBAL\\\\\\\\Driver\\\\\\\\PDOMySql\\\\\\\\Driver), Object(Doctrine\\\\\\\\DBAL\\\\\\\\Driver\\\\\\\\PDOException), 'INSERT INTO oc...', Array)\\\\n#2 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/DB\\\\\\/Connection.php(209): Doctrine\\\\\\\\DBAL\\\\\\\\Connection->executeUpdate('INSERT INTO oc...', Array, Array)\\\\n#3 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/DB\\\\\\/Adapter.php(113): OC\\\\\\\\DB\\\\\\\\Connection->executeUpdate('INSERT INTO oc...', Array)\\\\n#4 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/DB\\\\\\/Connection.php(247): OC\\\\\\\\DB\\\\\\\\Adapter->insertIfNotExist('*PREFIX*mounts', Array, Array)\\\\n#5 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Config\\\\\\/UserMountCache.php(144): OC\\\\\\\\DB\\\\\\\\Connection->insertIfNotExist('*PREFIX*mounts', Array, Array)\\\\n#6 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Config\\\\\\/UserMountCache.php(124): OC\\\\\\\\Files\\\\\\\\Config\\\\\\\\UserMountCache->addToCache(Object(OC\\\\\\\\Files\\\\\\\\Config\\\\\\\\LazyStorageMountInfo))\\\\n#7 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Config\\\\\\/MountProviderCollection.php(133): OC\\\\\\\\Files\\\\\\\\Config\\\\\\\\UserMountCache->registerMounts(Object(OC\\\\\\\\User\\\\\\\\User), Array)\\\\n#8 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Filesystem.php(425): OC\\\\\\\\Files\\\\\\\\Config\\\\\\\\MountProviderCollection->registerMounts(Object(OC\\\\\\\\User\\\\\\\\User), Array)\\\\n#9 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Filesystem.php(370): OC\\\\\\\\Files\\\\\\\\Filesystem::initMountPoints('winkelmayer')\\\\n#10 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/legacy\\\\\\/util.php(226): OC\\\\\\\\Files\\\\\\\\Filesystem::init('winkelmayer', '\\\\\\/winkelmayer\\\\\\/fi...')\\\\n#11 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/Filesystem.php(348): OC_Util::setupFS()\\\\n#12 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/View.php(1110): OC\\\\\\\\Files\\\\\\\\Filesystem::resolvePath('\\\\\\/files_encrypti...')\\\\n#13 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Files\\\\\\/View.php(524): OC\\\\\\\\Files\\\\\\\\View->basicOperation('file_exists', '\\\\\\/files_encrypti...')\\\\n#14 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Encryption\\\\\\/Keys\\\\\\/Storage.php(190): OC\\\\\\\\Files\\\\\\\\View->file_exists('\\\\\\/files_encrypti...')\\\\n#15 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/Encryption\\\\\\/Keys\\\\\\/Storage.php(101): OC\\\\\\\\Encryption\\\\\\\\Keys\\\\\\\\Storage->getKey('\\\\\\/files_encrypti...')\\\\n#16 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/encryption\\\\\\/lib\\\\\\/KeyManager.php(558): OC\\\\\\\\Encryption\\\\\\\\Keys\\\\\\\\Storage->getSystemUserKey('pubShare_15c297...', 'OC_DEFAULT_MODU...')\\\\n#17 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/encryption\\\\\\/lib\\\\\\/KeyManager.php(157): OCA\\\\\\\\Encryption\\\\\\\\KeyManager->getPublicShareKey()\\\\n#18 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/encryption\\\\\\/lib\\\\\\/Users\\\\\\/Setup.php(85): OCA\\\\\\\\Encryption\\\\\\\\KeyManager->validateShareKey()\\\\n#19 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/encryption\\\\\\/lib\\\\\\/AppInfo\\\\\\/Application.php(72): OCA\\\\\\\\Encryption\\\\\\\\Users\\\\\\\\Setup->setupSystem()\\\\n#20 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/apps\\\\\\/encryption\\\\\\/appinfo\\\\\\/app.php(29): OCA\\\\\\\\Encryption\\\\\\\\AppInfo\\\\\\\\Application->__construct(Array, true)\\\\n#21 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/legacy\\\\\\/app.php(186): require_once('\\\\\\/var\\\\\\/www\\\\\\/ownclo...')\\\\n#22 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/legacy\\\\\\/app.php(149): OC_App::requireAppFile('encryption')\\\\n#23 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/private\\\\\\/legacy\\\\\\/app.php(119): OC_App::loadApp('encryption')\\\\n#24 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/lib\\\\\\/base.php(875): OC_App::loadApps()\\\\n#25 \\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/index.php(39): OC::handleRequest()\\\\n#26 {main}\\\",\\\"File\\\":\\\"\\\\\\/var\\\\\\/www\\\\\\/owncloud\\\\\\/3rdparty\\\\\\/doctrine\\\\\\/dbal\\\\\\/lib\\\\\\/Doctrine\\\\\\/DBAL\\\\\\/Driver\\\\\\/AbstractMySQLDriver.php\\\",\\\"Line\\\":115}\",\"level\":3,\"time\":\"2016-08-24T10:58:45+00:00\",\"method\":\"GET\",\"url\":\"\\/owncloud\\/index.php\",\"user\":\"winkelmayer\"}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/242345164","html_url":"https://github.com/owncloud/core/issues/25933#issuecomment-242345164","issue_url":"https://api.github.com/repos/owncloud/core/issues/25933","id":242345164,"user":{"login":"scroach","id":4665730,"avatar_url":"https://avatars.githubusercontent.com/u/4665730?v=3","gravatar_id":"","url":"https://api.github.com/users/scroach","html_url":"https://github.com/scroach","followers_url":"https://api.github.com/users/scroach/followers","following_url":"https://api.github.com/users/scroach/following{/other_user}","gists_url":"https://api.github.com/users/scroach/gists{/gist_id}","starred_url":"https://api.github.com/users/scroach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scroach/subscriptions","organizations_url":"https://api.github.com/users/scroach/orgs","repos_url":"https://api.github.com/users/scroach/repos","events_url":"https://api.github.com/users/scroach/events{/privacy}","received_events_url":"https://api.github.com/users/scroach/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T10:37:37Z","updated_at":"2016-08-25T10:37:37Z","body":"Ok @PVince81, coming in with some good (at least I think so :D) news - I found old shares which referenced `file_sources `which were not present in `oc_filecache`.\r\n\r\n```\r\nselect fc.fileid, s.* from oc_share s\r\nleft join oc_filecache fc on s.file_source = fc.fileid\r\nwhere fc.fileid is null;\r\n```\r\n\r\nAfter I removed those invalid references I could login again.\r\n\r\nSome questions regarding this problem:\r\n- Is there any particular reason why no foreign keys are set on these columns?\r\n- Do you have any idea on how this invalid state might have happened? The invalid shares were quite old, from arround July 2015 - were we might just have upgraded to a new owncloud version?!\r\n- Why did this error only arrise in owncloud 9? In our old owncloud 8.2 thoses shares didn't seem to cause any problems.\r\n- Would it be possible for the owncloud server to provide better error messages or analysis tools to find those invalid configurations?"}}
{"actor":{"display_login":"scroach"}}