-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Configuration randomly cleared #11070
Comments
The only content in my config/config.php seems to be
is there any chance i can restore my setup if i find a backup of the config file? would it be possible to restore the data without the config file? i think a problem could be the salt, it's stored in this file, isn't it? |
@stefan-niedermann that's very weird. The Can you post your |
To clarify: just restore the |
I found a backup and replacing the file with my backup worked very well. I have no idea what cleared the config.php-file. i can provide you my log-file, but only on private way (e.g. email). the log is 4,5 mb big, so i don't have hope you will find any information (i already read it). there are many errors, but they are "normal" because my shared hoster provides only a very old php-version. i would be fine with closing this issue - it's your choice if you want to try to figgure out what happend, i will help you. |
I'd be very interested in the log file and the webservers' access log (if available) - can you drop me a mail (lukas@owncloud.com) with it? - Thanks! |
I sent you an email. webservers' access log is deleted every day - i don't have it anymore. |
This is very unlikely. I'll dig into your log. Thanks! |
@LukasReschke and I believe that this is likely caused by a race condition while two concurrent processes write out the config.php file. |
WTF it happened again? oO I'm using OC now for years, but two times the same heavy error within 10 days?! |
DAmn, misclicked |
Can we add configuration locking ? At least a write lock ? |
@MTRichards Can you please rerate this? - "Medium" seems a little bit low for something that may trigger data loss. |
"data loss" as in "forgot to save the config.php and lost the password salt". @schiesbn are the private keys encrypted with the user's password directly or the hashed password ? |
This issue is happening for me too, lost the file 4 times in the last 24 hours. Steps to reproduce
Expected behaviourCan't specify. Just logging in and using the installation. Actual behaviourThe installation becomes fully unusable due to the config.php file being reduced to only setting the instanceid for the config array. Every other information is lost. Couldn't find a specific cause for this. Server configuration(this is a custom installation on a hosting service (all-inkl.com), info as obtained from phpinfo(); ) Operating system: Linux dd32126 3.2.0-64-generic #97-Ubuntu SMP Wed Jun 4 22:04:21 UTC 2014 x86_64 Web server: Apache Database: MySQL 5.5.35-nmm2-log - (Ubuntu) PHP version: 5.4.32-nmm1 ownCloud version: 7.0.2 (stable) Updated from an older ownCloud or fresh install: Fresh install List of activated apps: Activity, Calendar, Contacts, Deleted Files, Documents, Encryption, First Run Wizard, Full Text Search, Mail Template Editor, PDF Viewer, Pictures, Share Files, Text Editor, Updater, Versions, Video Viewer, News, Turn Off App Codechecker The content of config/config.php: Before:
After:
(left out spaces '...' for privacy, hope it's okay that way) Are you using external storage, if yes which one: none Are you using encryption: yes Client configurationBrowser: Firefox 32 for Ubuntu / Firefox 32 Windows Operating system: Lubuntu 14.04 / Windows 7 LogsWeb server error logCould not yet obtain it in original, support told me there's nothing there to be seen. ownCloud log (data/owncloud.log)Can't identify anything related, this is all that's been happening all day:
Browser loghappens without browser interaction |
Seems really to be a race condition which we also observed without the "Turn Off App Codechecker" app. - So we have to fix this. Proposal: Short-term: Let's remove the "Turn Off App Code Checker" app \cc @Raydiation |
Code of the turn off app code checker app (app.php): <?php
if (\OCP\Config::getSystemValue('appcodechecker') !== false) {
\OCP\Config::setSystemValue('appcodechecker', false);
} |
I'm happy that my app was able to discover this really obscure bug :) Shortterm goal should be a file lock which is 1 line of code since the bug severity IMO is pretty high. Please get this in before 7.0.3 |
@craigpg @MTRichards FYI ^ |
Heres the affected code https://github.com/owncloud/core/blob/master/lib/private/config.php#L161 |
Pass this as the third parameter for file_put_contents https://github.com/owncloud/core/blob/master/lib/private/config.php#L172: LOCK_EX |
This adds a file lock to the config in hope that this prevents race conditions as reported in #11070 Testplan: - [ ] Delete config.php and make it read-only => Error is thrown that it is not writeable - [ ] Installation still works - [ ] Changing config settings works (i.e. using the SMTP config switches in the administration menu) - [ ] Your PC didn't blow up - [ ] Installing the news app and the "Disable AppCode checker" app did not destroy your installation
@stefan-niedermann @jcpro It would be totally awesome if you could test if the changes in #11303 would help in your case. @stefan-niedermann Please keep the "Disable Appcode Checker App" enabled for this. Thanks! |
I don't know what you mean by that, I don't see a Disable Appcode Checker App. |
Yeah - that was only meant for Stefan. In your case it would be sufficient if you would apply my changes and report back whether nothing exploded :) |
@LukasReschke i will test this patch, but i'm not sure how to reproduce the scenario, so i can only copy the new files and see if it might happen again... |
Yeah. That would be cool - race conditions are nearly impossible to properly reproduce. Thank you! |
This adds a file lock to the config in hope that this prevents race conditions as reported in #11070 Testplan: - [ ] Delete config.php and make it read-only => Error is thrown that it is not writeable - [ ] Installation still works - [ ] Changing config settings works (i.e. using the SMTP config switches in the administration menu) - [ ] Your PC didn't blow up - [ ] Installing the news app and the "Disable AppCode checker" app did not destroy your installation Only skip the main config Otherwise read only additional configs might not be processed Test on tmpdir
Potential fix merged with #11303 Please report back if the failure persists despite using this patch. |
This adds a file lock to the config in hope that this prevents race conditions as reported in #11070 Testplan: - [ ] Delete config.php and make it read-only => Error is thrown that it is not writeable - [ ] Installation still works - [ ] Changing config settings works (i.e. using the SMTP config switches in the administration menu) - [ ] Your PC didn't blow up - [ ] Installing the news app and the "Disable AppCode checker" app did not destroy your installation Only skip the main config Otherwise read only additional configs might not be processed Test on tmpdir
from the docs you may want to mention that in the admin docs that this feature is unsupported |
@carlaschroder For our IIS docs - I don't care too much about IIS myself TBH |
other than that looks solid, just took another stab at the php docs and this seems to be the way to go |
I am baffled and lost. What feature is unsupported, and what docs? I do admin and user, so if it's a dev doc you want someone who knows what they're doing. Which is not me :) |
@carlaschroder its admin docs :) basically running owncloud on ISAPI should be pointed out as unsupported |
Well, just write that PHP and Windows together are bad and you should use Linux if possible ;-) |
@LukasReschke, I love it. I could consolidate all the Windows pages into one line. |
PR here re: documenting that ISAPI is not supported owncloud-archive/documentation#587 |
i'm using OC 7.0.2 since it is released, without any problem.
Suddenly it can not remember its admin account or any other - it shows me the init-screen, but i have already much data and files on it.
do you know something about what could cause such an issue? i did not manually manipulate files or database.
I'm running php 5.3, mysql on debian (shared hoster, so it's difficult to get more detailled information). i have 2 mounted ftps (which worked till yet without problems).
i hope you have any idea.
The text was updated successfully, but these errors were encountered: