При работе в Nextcloud возникают ошибки.
Для их устранения необходимо перевести облачное хранилище в режим обслуживания. Сделаем это с помощью утилиты occ находящаяся в корне web-проекта.
Переводим в режим обслуживания выполнив команду:
# sudo -u www-data php occ maintenance:mode --on
Для отключения режима обслуживания выполним команду:
# sudo -u www-data php occ maintenance:mode --off
В режиме обслуживания на Desktop-клиентах будет запрошен пароль пользователя.
Ошибка «File is locked»
Ошибка при использовании серверов с медленной дисковой подсистемой.
Для исправления потребует перевести хранилища в режим обслуживания и выполненить SQL-запрос по очистке таблицы блокировок.
> delete from oc_file_locks;
Ошибка «Файл был удален с сервера» («File was deleted from server»)
Это довольно распространенная не блокирующая ошибка и синхронизация будет продолжаться, но в логах клиента будут присутствовать соответствующие ошибки.
Для устранения этой ошибки необходимо воспользоваться встроенной функцией сканирования файлового хранилища. Эта функция может быть запущена для всех пользователей:
# sudo -u www-data php occ files:scan --all
Это доволно длительная операция и зависящая от того сколько пользователей и файлов и для устранения проблем у одного пользователя можно указать вместо параметра его имя или идентификатор из Active Directory:
# sudo -u www-data php occ files:scan 2718B513-40C2-497A-8461-5CA930CEC4E9
Если вам известно расположение сбойного файла, то можно указать какой каталог требуется пересканировать:
# sudo -u www-data php occ files:scan 2718B513-40C2-497A-8461-5CA930CEC4E9 --path="2718B513-40C2-497A-8461-5CA930CEC4E9/files_versions/"
Когда штатные средства не помогают, придется удалить записи о файлах напрямую из базы данных, подключаемся базе данных mysql и выполняем запрос файлового идентификатора искомого файла.
> select fileid,path from oc_filecache where path like '%data/4.%';
Где, ‘%data/4.%’ — это запрос части имени файла вызывающего ошибку.
Следующим этапом удаляем идентификаторы сбойных файлов:
> delete from oc_filecache where fileid=589434;
589434 — соответственно идентификатор сбойного файла.
Ошибка «Precondition failed (An If-Match header was specified and the resource did not exist)»
Ошибка возникает на стороне клиента и оптимальным решением является переместить файл на временное хранение в другой каталог и после окончания синхронизации переместить файл обратно.
Steps to reproduce
- Login as Admin
- Go to Settings -> Administration -> Overview
Expected behaviour
Checking server setup should pass.
Actual behaviour
Get error under «Security & setup warning»
Server configuration
Operating system: CentsOS 7.5
Web server: nginx 1.15.3
Database: mariadb 10.3.9
PHP version: 7.2.9
Nextcloud version: 14.0.0
Updated from an older Nextcloud/ownCloud or fresh install: yes
Where did you install Nextcloud from: docker image
Signing status:
The error is about the server setup checking.
Are you using encryption: No
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Firefox 62.0
Operating system: ArchLinux
Logs
Web server error log
nothing here
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"qruZgYucXWF7sk27q0O9","level":3,"time":"2018-09-06T12:57:27+02:00","remoteAddr":"xx.xx.xx.x","user":"admin_user","app":"index","method":"GET","url":"/settings/ajax/checksetup","message":"Exception":"TypeError","Message":"Argument 1 passed to OC\SettingsController\CheckSetupController::getAppDirsWithDifferentOwnerForAppRoot() must be of the type array, boolean given, called in /nextcloud/settings/Controller/CheckSetupController.php on line 551","Code":0,"Trace":[{"file":"/nextcloud/settings/Controller/CheckSetupController.php","line":551,"function":"getAppDirsWithDifferentOwnerForAppRoot","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[false,{"path":"/apps2","url":"/apps2","writable":true}]},{"file":"/nextcloud/settings/Controller/CheckSetupController.php","line":624,"function":"getAppDirsWithDifferentOwner","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[]},{"file":"/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":166,"function":"check","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[]},{"file":"/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"__class__":"OC\Settings\Controller\CheckSetupController"},"check"]},{"file":"/nextcloud/lib/private/AppFramework/App.php","line":118,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"__class__":"OC\Settings\Controller\CheckSetupController"},"check"]},{"file":"/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OC\Settings\Controller\CheckSetupController","check",{"__class__":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"settings.CheckSetup.check"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":{"_route":"settings.CheckSetup.check"}]},{"file":"/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\AppFramework\Routing\RouteActionHandler"},{"_route":"settings.CheckSetup.check"}]},{"file":"/nextcloud/lib/base.php","line":989,"function":"match","class":"OC\Route\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/nextcloud/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/nextcloud/settings/Controller/CheckSetupController.php","Line":568,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0","version":"14.0.0.19"}
Browser log
nothing
Steps to reproduce
- Login as Admin
- Go to Settings -> Administration -> Overview
Expected behaviour
Checking server setup should pass.
Actual behaviour
Get error under «Security & setup warning»
Server configuration
Operating system: CentsOS 7.5
Web server: nginx 1.15.3
Database: mariadb 10.3.9
PHP version: 7.2.9
Nextcloud version: 14.0.0
Updated from an older Nextcloud/ownCloud or fresh install: yes
Where did you install Nextcloud from: docker image
Signing status:
The error is about the server setup checking.
Are you using encryption: No
Are you using an external user-backend, if yes which one: No
Client configuration
Browser: Firefox 62.0
Operating system: ArchLinux
Logs
Web server error log
nothing here
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"qruZgYucXWF7sk27q0O9","level":3,"time":"2018-09-06T12:57:27+02:00","remoteAddr":"xx.xx.xx.x","user":"admin_user","app":"index","method":"GET","url":"/settings/ajax/checksetup","message":"Exception":"TypeError","Message":"Argument 1 passed to OC\SettingsController\CheckSetupController::getAppDirsWithDifferentOwnerForAppRoot() must be of the type array, boolean given, called in /nextcloud/settings/Controller/CheckSetupController.php on line 551","Code":0,"Trace":[{"file":"/nextcloud/settings/Controller/CheckSetupController.php","line":551,"function":"getAppDirsWithDifferentOwnerForAppRoot","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[false,{"path":"/apps2","url":"/apps2","writable":true}]},{"file":"/nextcloud/settings/Controller/CheckSetupController.php","line":624,"function":"getAppDirsWithDifferentOwner","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[]},{"file":"/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":166,"function":"check","class":"OC\Settings\Controller\CheckSetupController","type":"->","args":[]},{"file":"/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"__class__":"OC\Settings\Controller\CheckSetupController"},"check"]},{"file":"/nextcloud/lib/private/AppFramework/App.php","line":118,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"__class__":"OC\Settings\Controller\CheckSetupController"},"check"]},{"file":"/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OC\Settings\Controller\CheckSetupController","check",{"__class__":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"settings.CheckSetup.check"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":{"_route":"settings.CheckSetup.check"}]},{"file":"/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\AppFramework\Routing\RouteActionHandler"},{"_route":"settings.CheckSetup.check"}]},{"file":"/nextcloud/lib/base.php","line":989,"function":"match","class":"OC\Route\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/nextcloud/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/nextcloud/settings/Controller/CheckSetupController.php","Line":568,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0","version":"14.0.0.19"}
Browser log
nothing
Задача:
Troubleshooting – Найти причину возникновения ошибки и устранить
—————————————————————
После обновления nextcloud появилась ошибка:
Некоторые файлы не прошли проверку целостности. Дополнительная информация о способах решения этой проблемы содержится в документации. (Список проблемных файлов… / Выполнить повторное сканирование…)
Если перейти по ссылке “Список проблемных файлов”, получим более детальную информацию об ошибке
Technical information ===================== The following list covers which files have failed the integrity check. Please read the previous linked documentation to learn more about the errors and how to fix them. Results ======= - user_external - INVALID_HASH - appinfo/info.xml - lib/smb.php Raw output ========== Array ( [user_external] => Array ( [INVALID_HASH] => Array ( [appinfo/info.xml] => Array ( [expected] => 06b250c3a2c2ae01c8a2c4b963d6449c99645dca36ee197c3aa513fb74243dac3e90e42dc1408ee6957408d85f9f9a973b8983719e9c15125d42211d43f0853c7bf75 [current] => e5da848ca44b3b60abb1c99a3d26455d78464f94ea1f5f522b0234d2345d7d642096a771dcde9a1a5289e271805292659edc42925a86b5d6ad22ffa98b79ecec5bfed69ff ) [lib/smb.php] => Array ( [expected] => 283a99667fd865e54423d575953423bc6e15862b7683885cb567234d234d55aafdb3b2cbc1400a1318ec81cdbd90ce827c3f839aa6daf6a0f6e3ac6bd2742947498dd14f9 [current] => 1c12005d92f88017564fb4135a53s234522810aab33ffab22eac67c19501a59d213518e417cceb83f5e9ea4b448ea81fff3149da37eefb0100a61bce3140ce67f8decc ) ) ) )
Проверяем версию установленного nextcloud
root@cloud:/ # sudo -u www php /usr/local/www/nextcloud/occ status The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php - installed: true - version: 18.0.1.3 - versionstring: 18.0.1 - edition: root@cloud:/ #
Проверяем установленные приложения
root@cloud:~ # sudo -u www php /usr/local/www/nextcloud/occ app:list The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php Enabled: - accessibility: 1.4.0 - activity: 2.11.0 - admin_audit: 1.8.0 - audioplayer_editor: 0.2.0 - audioplayer_sonos: 1.1.0 - bruteforcesettings: 1.5.0 - checksum: 0.4.4 - cloud_federation_api: 1.1.0 - comments: 1.8.0 - dav: 1.14.0 - extract: 1.2.3 - federatedfilesharing: 1.8.0 - federation: 1.8.0 - files: 1.13.1 - files_external: 1.9.0 - files_pdfviewer: 1.7.0 - files_sharing: 1.10.1 - files_trashbin: 1.8.0 - files_versions: 1.11.0 - files_videoplayer: 1.7.0 - firstrunwizard: 2.7.0 - impersonate: 1.5.0 - logreader: 2.3.0 - lookup_server_connector: 1.6.0 - mail: 1.1.2 - music: 0.13.0 - news: 14.1.3 - nextcloud_announcements: 1.7.0 - notifications: 2.6.0 - oauth2: 1.6.0 - onlyoffice: 4.1.4 - password_policy: 1.8.0 - passwords: 2020.2.1 - photos: 1.0.0 - privacy: 1.2.0 - provisioning_api: 1.8.0 - richdocuments: 3.5.2 - serverinfo: 1.8.0 - settings: 1.0.0 - sharebymail: 1.8.0 - support: 1.1.0 - survey_client: 1.6.0 - systemtags: 1.8.0 - text: 2.0.0 - theming: 1.9.0 - twofactor_backupcodes: 1.7.0 - twofactor_gateway: 0.15.1 - twofactor_totp: 4.1.2 - twofactor_u2f: 5.0.2 - updatenotification: 1.8.0 - viewer: 1.2.0 - workflowengine: 2.0.0 Disabled: - audioplayer - encryption - files_external_gdrive - files_rightclick - keeweb - radio - recommendations - user_external - user_ldap root@cloud:~ #
Как выяснилось это отключенный плагин, поэтому можно его удалить
rmdir /usr/local/www/nextcloud/apps/user_external/
После, повторной проверки ошибка пропала. При необходимости, можно заново установить приложение.