-
-
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
Config file truncated when low on disk space #25175
Comments
Is this Issue still valid in NC21.0.2? 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. |
cc @nextcloud/server seems like this is still happening |
I think we should probably write the new content to a temp file next to the existing one and the do a rename as any other checks for available space might still lead to scenarios where the check passes but the write then fails if the disk runs out of space in the meantime. |
What about the file permissions associated with the original config.php ? |
Fixed by #34009 |
Hi @szaimen, indeed it does, thanks. Of course there's a TOCTOU race condition there but I expect it's fine for the majority of cases. |
I see these messages in log for each web directory access in NC26beta3: disk_free_space(): No such file or directory at …/lib/private/Files/Storage/Local.php#421 full nextcloud.log entry{
"reqId": "xucm63dW56R2nOpKqqUD",
"level": 3,
"time": "2023-02-15T14:59:17+01:00",
"remoteAddr": "192.168.1.2",
"user": "MYUSER",
"app": "PHP",
"method": "PROPFIND",
"url": "/remote.php/dav/files/SOMEPATH",
"message": "disk_free_space(): No such file or directory at /DATAFOLDER/lib/private/Files/Storage/Local.php#421",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0",
"version": "26.0.0.5",
"data": {
"app": "PHP"
}
} Is that related with this enhancement? This is not a race condition, this happens on each access and should be fixed. |
It is not included in nc26beta3 yet so unrelated. |
Found the issue – it's an older one, not 26 specific. |
How to use GitHub
The bug
When the disk that Nextcloud is installed on is full (an admittedly unpredictable scenario), the config file is truncated. This happened during an update in my case.
Steps to reproduce
cat config/config.php
, observe config valuesdd if=/dev/zero of=file.dat bs=1024 count=10000000
occ maintenance:mode --on
cat config/config.php
observe an empty fileExpected behaviour
Config file is not truncated when no disk space.
Actual behaviour
Config is left empty, Nextcloud believes it is no longer installed and wants a CAN_INSTALL file.
Server configuration
Operating system:
Ubuntu 18.04.5 LTS
Web server:
apache2 2.4.29-1ubuntu4.14
Database:
mariadb 10.1.44
PHP version:
PHP 7.2.24-0ubuntu0.18.04.6
Nextcloud version: (see Nextcloud admin page)
20.0.5
The text was updated successfully, but these errors were encountered: