-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
complete config reset with filled disk #18620
Comments
When you say "entire disk space" are you talking about server space (can't write anything) or data folder only? |
All available system storage full, though I have both on the same file system |
Being able to reproduce here.
|
Is this Issue still valid? If not, please close this issue. Thanks! :) |
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions. |
Gasp. Happened to me right now. I don't have a backup of this config file !! How can I get it back ? |
Can we please reopen this? (To clarify, I'm not angry at anyone personally; from my own work I know well enough that important tickets can slip. Just want to draw attention to a triaging fail like this, so processes can be improved).
@BENETNATH You can try and see if |
This comment was marked as off-topic.
This comment was marked as off-topic.
I guess this would be a possible solution to this problem: #27492 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I don't see how #27492 would address this problem. I'm not familiar with the code base, so I don't know about the reasons for this behavior, but the underlying problems I see are:
|
cc @PVince81 |
This just happened to me. I think this bug should be escalated. If find it very unsual that the config file is even opened in r/w mode and written to in the first place.. There is also a bunch of duplicates: |
idea: when writing config.php perhaps it first needs to be written into a part file "config.php.part" to make sure that the file was fully writable (and not truncated). and if there was no error, do a rename+overwrite onto config.php |
@PVince81 I agree that an atomic write would be the way to go. Heres some more issues on the forums, with people losing even access to their encrypted files:
|
This sounds good. Might still want to add a nonce to the name. Otherwise two write operations could still create a race condition:
This is much less likely to happen - but i think including a random string or the request id or so in the file name would avoid it entirely. |
Config file is only opened in write mode if data needs to be written, meaning a configuration var was modified and
What I can see is that if reading the configuration file fails, it will still write the configuration data if a var is set, meaning it will write an empty configuration object. I was unable to reproduce the problem on master using a small tmpfs as config directory and filling it. Does the data directory needs to be full to trigger the problem? |
It is the call to |
@come-nc thanks for looking into this! 🎉
Yes I think so, though I didn't reproduce for a while myself. #18620 (comment) mentions that having the data dir full / unavailable made it reproducable |
Steps to reproduce
Expected behaviour
Config should never be reset, even in edgecases.
Config should never ever be opened with write-permission from a public / non-admin endpoint.
Actual behaviour
Find your
config/config.php
truncated to a minimal config file with only theinstanceid
key filled in. This is serious.Landing page says something like "Looks like you're trying to reinstall nextcloud but file CAN_INSTALL was not found"
Server configuration
Operating system: debian 9
Web server: nginx
Database: mysql
PHP version: 7.3
Nextcloud version: (see Nextcloud admin page) 17.0.1
Updated from an older Nextcloud/ownCloud or fresh install: updated since NC 15
Where did you install Nextcloud from: source tarball
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: yes
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: latest firefox
Operating system: linux
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
At the point of config-reset, nothing is logged. Beforehand, redis complains about unavailable storageThe text was updated successfully, but these errors were encountered: