File Sharing stack overflow, memory issue, crash, CSRF issue on 9.1.0
Steps to reproduce
- Upgrade to owncloud 9.1
- Login
- It shows CSRF check failed
- Deactivated files_sharing via occ
- Login workes
Expected behaviour
Login and works
Actual behaviour
shows CSRF check failed
Server configuration
Operating system:
Web server: all-inkl.com Database: 5.6.30 PHP version: 5.6.23 ownCloud version: (see ownCloud admin page) 9.1 Updated from an older ownCloud or fresh install: updated from 9.0.3 Where did you install ownCloud from: Install from tar.bz2 Signing status (ownCloud 9.0 and above):
Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
List of activated apps:
Enabled:
- activity: 2.3.2
- calendar: 1.2.2
- comments: 0.3.0
- contacts: 1.3.1.0
- dav: 0.2.5
- federatedfilesharing: 0.3.0
- federation: 0.1.0
- files: 1.5.1
- files_pdfviewer: 0.8.1
- files_texteditor: 2.1
- files_trashbin: 0.9.0
- files_sharing 0.10.0
- files_versions: 1.3.0
- files_videoplayer: 0.9.8
- gallery: 15.0.0
- notifications: 0.3.0
- provisioning_api: 0.5.0
- systemtags: 0.3.0
- updatenotification: 0.2.1 Disabled:
- encryption
- external
- files_antivirus
- files_external
- firstrunwizard
- templateeditor
- user_external
- user_ldap
The content of config/config.php:
$CONFIG = array ( 'trusted_domains' => array ( 0 => 'owncloud..de', 1 => 'owncloud..de', 2 => '.de', 3 => 'www.owncloud..de', 4 => 'www.owncloud..de', 5 => '.de', ), 'datadirectory' => '/www/htdocs///ownclouddata/data', 'tempdirectory' => '/www/htdocs///ownclouddata/tmp', 'overwrite.cli.url' => 'http://.de/cloud/owncloud', 'dbtype' => 'mysql', 'version' => '9.1.0.15', 'dbname' => 'd01cd1d3', 'dbhost' => '127.0.0.1', 'dbtableprefix' => 'oc_', 'filesystem_check_changes' => 0, 'dbuser' => 'd01cd1d3', 'dbpassword' => '', 'installed' => true, 'forcessl' => true, 'theme' => '', 'maintenance' => false, 'loglevel' => 3, 'mail_smtpmode' => 'smtp', 'appstore.experimental.enabled' => true, 'mail_from_address' => 'info', 'mail_domain' => 'owncloud.de', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtphost' => 'w01078ba.kasserver.com', 'mail_smtpport' => '465', 'mail_smtpauth' => 1, 'mail_smtpname' => '', 'mail_smtppassword' => '', 'trashbin_retention_obligation' => 'auto', 'enabledPreviewProviders' => array ( 0 => 'OC\Preview\Image', 1 => 'OC\Preview\MP3', 2 => 'OC\Preview\TXT', 3 => 'OC\Preview\MarkDown', 4 => 'OC\Preview\Epub', 5 => 'OC\Preview\PDF', 6 => 'OC\Preview\OpenDocument', 7 => 'OC\Preview\StarOffice', 8 => 'OC\Preview\MSOfficeDoc', 9 => 'OC\Preview\MSOffice2003', 10 => 'OC\Preview\MSOffice2007', ), 'updater.secret' => '', 'mail_smtpsecure' => 'ssl', );
Are you using external storage, if yes which one: local/smb/sftp/...
Are you using encryption: yes/no no Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Client configuration
Browser: Chrome Operating system: Mac OSX 10.11.6
Logs
Web server error log
{"reqId":"V5DHUlUNh8EAAC3bt5kAAAAk","remoteAddr":"217.93.9.75","app":"core","message":"starting upgrade from 9.0.1.3 to 9.1.0.15","level":0,"time":"2016-07-21T13:00:03+00:00","method":"GET","url":"/core/ajax/update.php?requesttoken=%3D%%3D","user":"--"} {"reqId":"V5DHUlUNh8EAAC3bt5kAAAAk","remoteAddr":"217.93.9.75","app":"core","message":"Exception: {"Exception":"Exception","Message":"Die Anwendung konnte nicht installiert werden, weil Sie nicht mit dieser Version von ownCloud kompatibel ist.","Code":0,"Trace":"#grity(Array, '\/www\/htdocs\/w01...', '\/www\/htdocs\/w01...', false)\n#1 \/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/lib\/private\/Installer.php(263): OC\Installer::updateApp(Array)\n#2 \/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/lib\/private\/Updater.php(454): OC\Installer::updateAppByOCSId('164356')\n#3 \/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/lib\/private\/Updater.php(254): OC\Updater->upgradeAppStoreApps(Array)\n#4 \/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/lib\/private\/Updater.php(150): OC\Updater->doUpgrade('9.1.0.15', '9.0.1.3')\n#5 \/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/core\/ajax\/update.php(193): OC\Updater->upgrade()\n#6 {main}","File":"\/www\/htdocs\/w01078ba\/simon\/cloud\/owncloud\/lib\/private\/Installer.php","Line":377}","level":3,"time":"2016-07-21T13:02:21+00:00","method":"GET","url":"/core/ajax/update.php?requesttoken=I3g2NToLJgUlehQpPikjBWMvOQMBV2wbOgQyOzwgN2U%3D%3AfSRxkQHLRIfSJLAsZFmNMb4BcfhZfNO5pfFUDm96pio%3D","user":"--"}
ownCloud log (data/owncloud.log)
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
I have the same issue. deactivating files_sharing via occ solved the issue of not being able to log in, but now the file sharing feature is missing.
hello, happens to me ... when I activate the ldap module, an answer to this problem?
Please all tell us how did you update.
From looking at the messages above it looks like the source code hasn't been properly replaced.
Hello, I Downloaded tar.bz2, extracted on the Server, copy over config.php and started update process.
Thanks for help
@Revisor01 did you delete the old source code before extracting ?
Yes.
In an Otter Installation i tried to replace files. Same Error.
@Revisor01 can you confirm that there are no errors on this page: http://example.com/index.php/settings/integrity/failed and on the admin page (setup check) ?
I'm not at the pc right now. But there were no errors or integrity massages after disabling files_sharing.
Could all the reporters answer the same questions ? The more details we have about the different setups, the closer we can get to a soluton. Thank you !
Does clearing the cookies make the CSRF failed message disappear ?
So far I don't see any correlation between this and the files_sharing app.
Deleted the cache, tried different browsers (safari, Firefox, chrome) users, computers, tablets.
I updated from a working latest 9.0.x release to 9.1 via apt-get update & apt-get upgrade. Then did a occ upgrade -> no errors shown in console. next: turned off maintenance mode via occ, too.
After that I could not log in to owncloud anymore via web. CSRF check failed message. After disabling files_sharing via occ it works again.
Cookies are always turned on. integrity check page shows: No errors have been found.
And I guess there is no specific error in owncloud.log or error_log when you get the CSRF failed page ? Even with "loglevel" set to 0 ?
nothing specific, just: {"reqId":"0/clTBSYhuMIUJ4JIfrh","remoteAddr":"##.###.###.###","app":"no app in context","message":"CSRF check failed","level":0,"time":"2016-07-21T16:20:54+00:00","method":"POST","url":"/index.php/login","user":"--"}
Hmmm... the way how CSRF check works: whenever the login page is rendered, it will first generate the token and then store it into the current session. Also it will append the token into a hidden field "requesttoken". You can see it if you inspect the source code of the login page. Then, when you login, it will POST username/password but also send that token to the server. Then the server compares the token with the one it has in the session. If they don't match, you get this error.
Not sure yet where the files_sharing app would disturb this process.
Hi, I had written the post above about ldap, after testing off the modules one by one, Ldap works ok, but the module "sharing files" does not work. If I disable ldap "sharing files" works, by trying to turn it on, the CPU goes up and the server goes down, I think the error is the loading order of each of the modules in this version, the 9.0 had no problem .
I have 1500 users, 64GB of RAM, Xeon g4
Are you guys using the standard PHP session or did you deploy clustered environments ? In the latter case the session management might be slightly different.
It should be standard, I do not cluster. I happened in php5.5, upgrade to php7.0 but I have the same problem
In my particular case apache generates a "segmentation fault". if one of the modules is on and the other is active.