Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

During initial backup, paths are always null

オープン
#635 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
docker, php
領域
backend

調査の方向性

custom_apps/backup/lib/Service/PointService.php から始め、特に initBackupFS() と scanFoldersFromAppData() を確認し、その後 BeforeNodeWrittenEvent を apps/files_versions/lib/Listener/FileEventsListener.php と getPathForNode まで追跡します。提供されたスタックトレースを使って、初回バックアップの失敗を再現します。バックアップパスが null として渡されなくなり、初回バックアップを続行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

0. Needs triage bug

I've just installed the app recently, and have been unable to take a backup so far.

I run the standard Nextcloud image inside a Docker container. I have both stages of the backup pointed to an NFS mount in the container. Double checked that the permissions are correct, but it's not even able to get to the point of actually storing anything.

It can't even read files because it keeps pulling up the path of whatever file it's trying to look at as null. This causes an error with one of the functions that is expecting a path string. I don't really know PHP so this has been difficult for me to try to debug, but I'm pretty sure it is deriving the user session as null in /var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php. I added some logging to getPathForNode, and the $user and $owner variables both come up null. As a result, the function returns null, and that value is plugged into OC\Files\View->file_exists(), which is not expecting a null value. Full log:

An unhandled exception has been thrown:
TypeError: OC\Files\View::basicOperation(): Argument #2 ($path) must be of type string, null given, called in /var/www/html/lib/private/Files/View.php on line 528 and defined in /var/www/html/lib/private/Files/View.php:1128
Stack trace:
#0 /var/www/html/lib/private/Files/View.php(528): OC\Files\View->basicOperation('file_exists', NULL)
#1 /var/www/html/lib/private/Files/Filesystem.php(545): OC\Files\View->file_exists(NULL)
#2 /var/www/html/apps/files_versions/lib/Storage.php(189): OC\Files\Filesystem::file_exists(NULL)
#3 /var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php(196): OCA\Files_Versions\Storage::store(NULL)
#4 /var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php(102): OCA\Files_Versions\Listener\FileEventsListener->write_hook(Object(OC\Files\Node\File))
#5 /var/www/html/lib/private/EventDispatcher/ServiceEventListener.php(86): OCA\Files_Versions\Listener\FileEventsListener->handle(Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent))
#6 /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php(230): OC\EventDispatcher\ServiceEventListener->__invoke(Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent), 'OCP\\Files\\Event...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#7 /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php(59): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'OCP\\Files\\Event...', Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent))
#8 /var/www/html/lib/private/EventDispatcher/EventDispatcher.php(94): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent), 'OCP\\Files\\Event...')
#9 /var/www/html/lib/private/EventDispatcher/EventDispatcher.php(106): OC\EventDispatcher\EventDispatcher->dispatch('OCP\\Files\\Event...', Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent))
#10 /var/www/html/lib/private/Files/Node/HookConnector.php(100): OC\EventDispatcher\EventDispatcher->dispatchTyped(Object(OCP\Files\Events\Node\BeforeNodeWrittenEvent))
#11 /var/www/html/lib/private/legacy/OC_Hook.php(105): OC\Files\Node\HookConnector->write(Array)
#12 /var/www/html/lib/private/Files/View.php(1270): OC_Hook::emit('OC_Filesystem', 'write', Array)
#13 /var/www/html/lib/private/Files/View.php(1144): OC\Files\View->runHooks(Array, '/backup/staging...')
#14 /var/www/html/lib/private/Files/View.php(680): OC\Files\View->basicOperation('file_put_conten...', '/adam/files/bac...', Array, '')
#15 /var/www/html/lib/private/Files/Node/Folder.php(188): OC\Files\View->file_put_contents('/adam/files/bac...', '')
#16 /var/www/html/lib/private/Files/SimpleFS/SimpleFolder.php(89): OC\Files\Node\Folder->newFile('.nobackup', '')
#17 /var/www/html/custom_apps/backup/lib/Service/PointService.php(796): OC\Files\SimpleFS\SimpleFolder->newFile('.nobackup', '')
#18 /var/www/html/custom_apps/backup/lib/Service/PointService.php(642): OCA\Backup\Service\PointService->initBackupFS()
#19 /var/www/html/custom_apps/backup/lib/Command/PointScan.php(129): OCA\Backup\Service\PointService->scanFoldersFromAppData()
#20 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\Backup\Command\PointScan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/html/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/html/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Backup\Command\PointScan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /var/www/html/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /var/www/html/console.php(100): OC\Console\Application->run()
#27 /var/www/html/occ(11): require_once('/var/www/html/c...')
#28 {main}%                                                      

I'm kind of not sure where to go from there. I'm not sure where this user session is coming from, and I don't have experience debugging PHP. Some help would be immensely appreciated.

主要言語
PHP
スター
272
フォーク
37
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/backup のほかの issue

nextcloud/backup の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。