-
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
occ files:scan error undefined method get #31077
Comments
@butonic please check |
GitMate.io thinks the contributor most likely able to help you is @PVince81. Possibly related issues are #14681 (Internal Server Error after attempting to do "occ files:scan"), #23333 (occ file:scan reports error if user never logged on), #15877 (When occ had an error, move back the files), #19115 (occ files:scan's memory consumption grows with amount of files scanned), and #26902 (error). |
next: provides three lines of patch to log the pathes |
We have this two patches to have better logs:
|
In https://github.com/owncloud/core/blob/v10.0.7/lib/private/Files/Node/Root.php#L338 you are looking at the virtual filesystem inside owncloud, which for users files always starts with the actual file location is determined by the mount points. |
scanning files for ldap users works fine with oc 10.0.7 and ldap 0.10.0 |
@butonic indeed this does not happen for all users, but randomly for some of them. 2 LDAP users are affected until now |
Reading the error message properly helps:
true OC\Files\Node\File is a file and has no get method to get children like a directory has. Let us have a look at /var/www/html/owncloud/lib/private/Files/Node/Root.php on line 360: core/lib/private/Files/Node/Root.php Lines 338 to 367 in f10d105
in line 360 we assume that |
an intact filecache should allow scanning, even if home folder naming rule was used: % echo 'SELECT user_id, home FROM oc_accounts WHERE user_id="B5275C13-6466-43FD-A129-A12A6D3D9A0D"' | mysql -u root --password=123 -h 127.0.0.1 core
user_id home
B5275C13-6466-43FD-A129-A12A6D3D9A0D /var/www/html/core/data2/alicia@example.org
% echo 'SELECT s.id, storage, fileid, path, m.mimetype FROM oc_filecache f JOIN oc_storages s ON f.storage=s.numeric_id JOIN oc_mimetypes m ON f.mimetype = m.id WHERE s.id="home::B5275C13-6466-43FD-A129-A12A6D3D9A0D" ORDER BY fileid' | mysql -u root --password=123 -h 127.0.0.1 core
id storage fileid path mimetype
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 230 httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 231 cache httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 232 files httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 233 files/welcome.txt text/plain
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 234 thumbnails httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 235 thumbnails/233 httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 236 thumbnails/233/2048-2048-max.png image/png
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 237 thumbnails/233/32-32.png image/png
predator% echo 'SELECT user_id, home FROM oc_accounts WHERE user_id="B5275C13-6466-43FD-A129-A12A6D3D9A0D"' | mysql -u root --password=123 -h 127.0.0.1 core
user_id home
B5275C13-6466-43FD-A129-A12A6D3D9A0D /var/www/html/core/data2/alicia@example.org
% echo 'SELECT s.id, storage, fileid, path, m.mimetype FROM oc_filecache f JOIN oc_storages s ON f.storage=s.numeric_id JOIN oc_mimetypes m ON f.mimetype = m.id WHERE s.id="home::B5275C13-6466-43FD-A129-A12A6D3D9A0D" ORDER BY fileid' | mysql -u root --password=123 -h 127.0.0.1 core
id storage fileid path mimetype
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 230 httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 231 cache httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 232 files httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 233 files/welcome.txt text/plain
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 234 thumbnails httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 235 thumbnails/233 httpd/unix-directory
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 236 thumbnails/233/2048-2048-max.png image/png
home::B5275C13-6466-43FD-A129-A12A6D3D9A0D 41 237 thumbnails/233/32-32.png image/png
% ./occ file:scan B5275C13-6466-43FD-A129-A12A6D3D9A0D -vvv
Starting scan for user 1 out of 1 (B5275C13-6466-43FD-A129-A12A6D3D9A0D)
Folder /B5275C13-6466-43FD-A129-A12A6D3D9A0D/
Folder /B5275C13-6466-43FD-A129-A12A6D3D9A0D/files
File /B5275C13-6466-43FD-A129-A12A6D3D9A0D/files/welcome.txt
Folder /B5275C13-6466-43FD-A129-A12A6D3D9A0D/thumbnails
Folder /B5275C13-6466-43FD-A129-A12A6D3D9A0D/thumbnails/233
File /B5275C13-6466-43FD-A129-A12A6D3D9A0D/thumbnails/233/32-32.png
File /B5275C13-6466-43FD-A129-A12A6D3D9A0D/thumbnails/233/2048-2048-max.png
Folder /B5275C13-6466-43FD-A129-A12A6D3D9A0D/cache
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 5 | 3 | 00:00:00 |
+---------+-------+--------------+
% tree data2
data2
└── alicia@example.org
├── cache
├── files
│ └── welcome.txt
└── thumbnails
└── 233
├── 2048-2048-max.png
└── 32-32.png
5 directories, 3 files |
manually corrupting the filecache by setting the mimtype and mimepart of the root of the home storage to |
same with the files folder without a filecache dump for the user cannot continue. please also double check the path in oc_accounts points to the correct location in the filesystem. trying to put a file in place of the users home folder does not break but produces an error message: % tree data2
data2
├── alicia@example.org
└── alicia@example.org.bak
├── cache
├── files
│ └── welcome.txt
└── thumbnails
└── 233
├── 2048-2048-max.png
└── 32-32.png
5 directories, 4 files
% ./occ file:scan B5275C13-6466-43FD-A129-A12A6D3D9A0D -vvv
Starting scan for user 1 out of 1 (B5275C13-6466-43FD-A129-A12A6D3D9A0D)
Home storage for user B5275C13-6466-43FD-A129-A12A6D3D9A0D not writable
Make sure you're running the scan command only as the user the web server runs as
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+ same for replacing the file folder with a file: % tree data2
data2
├── alicia@example.org
│ └── files
└── alicia@example.org.bak
├── cache
├── files
│ └── welcome.txt
└── thumbnails
└── 233
├── 2048-2048-max.png
└── 32-32.png
6 directories, 4 files
% ./occ file:scan B5275C13-6466-43FD-A129-A12A6D3D9A0D -vvv
Starting scan for user 1 out of 1 (B5275C13-6466-43FD-A129-A12A6D3D9A0D)
Home storage for user B5275C13-6466-43FD-A129-A12A6D3D9A0D not writable
Make sure you're running the scan command only as the user the web server runs as
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
|
what's the next steps ? is this not reproducible ? |
this was caused by filecache corruption due to storage outage. Yes, closing - thanks |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
https://github.com/owncloud/core/blob/v10.0.7/lib/private/Files/Node/Root.php#L338
assumes to have user home like: userId/files
but with homeFolderNamingRule the user home is not like that.
https://github.com/owncloud/user_ldap/blame/master/lib/User/UserEntry.php#L258
getHome() is not used in Root.php ??
occ files:scan throws error:
Server v10.0.7
LDAP v0.10.0
The text was updated successfully, but these errors were encountered: