rotdrop / nextcloud-app-files-archive

Archive inspection and extraction as Nextcloud app.
Other
9 stars 4 forks source link

PHP errors under Nextcloud 29.* #47

Closed rcfa closed 4 months ago

rcfa commented 4 months ago

Something doesn’t seem right…

Nextcloud Hub 8 (29.0.2 RC2) arm64 Debian Linux

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/nextcloud/apps/files_archive/lib/Migration/RegisterMimeTypes.php on line 95 PHP Stack trace: PHP 1. {main}() /var/www/nextcloud/occ:0 PHP 2. require_once() /var/www/nextcloud/occ:11 PHP 3. OC\Console\Application->run($input = *uninitialized*, $output = *uninitialized*) /var/www/nextcloud/console.php:102 PHP 4. Symfony\Component\Console\Application->run($input = NULL, $output = NULL) /var/www/nextcloud/lib/private/Console/Application.php:213 PHP 5. Symfony\Component\Console\Application->doRun($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'maintenance:repair']; protected $interactive = TRUE; private $tokens = [0 => 'maintenance:repair']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php:171 PHP 6. Symfony\Component\Console\Application->doRunCommand($command = class OC\Core\Command\Maintenance\Repair { private ${Symfony\Component\Console\Command\Command}application = class Symfony\Component\Console\Application { private $commands = [...]; private $wantHelps = FALSE; private $runningCommand = ...; private $name = 'Nextcloud'; private $version = '29.0.2 RC2'; private $commandLoader = NULL; private $catchExceptions = TRUE; private $autoExit = TRUE; private $definition = class Symfony\Component\Console\Input\InputDefinition { ... }; private $helperSet = class Symfony\Component\Console\Helper\HelperSet { ... }; private $dispatcher = NULL; private $terminal = class Symfony\Component\Console\Terminal { ... }; private $defaultCommand = 'list'; private $singleCommand = FALSE; private $initialized = TRUE; private $signalRegistry = class Symfony\Component\Console\SignalRegistry\SignalRegistry { ... }; private $signalsToDispatchEvent = [...] }; private ${Symfony\Component\Console\Command\Command}name = 'maintenance:repair'; private ${Symfony\Component\Console\Command\Command}processTitle = NULL; private ${Symfony\Component\Console\Command\Command}aliases = []; private ${Symfony\Component\Console\Command\Command}definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 0; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}hidden = FALSE; private ${Symfony\Component\Console\Command\Command}help = ''; private ${Symfony\Component\Console\Command\Command}description = 'repair this installation'; private ${Symfony\Component\Console\Command\Command}fullDefinition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; private ${Symfony\Component\Console\Command\Command}ignoreValidationErrors = FALSE; private ${Symfony\Component\Console\Command\Command}code = NULL; private ${Symfony\Component\Console\Command\Command}synopsis = []; private ${Symfony\Component\Console\Command\Command}usages = []; private ${Symfony\Component\Console\Command\Command}helperSet = class Symfony\Component\Console\Helper\HelperSet { private $helpers = [...]; private $command = NULL }; private Symfony\Component\Console\Helper\ProgressBar $progress = *uninitialized*; private Symfony\Component\Console\Output\OutputInterface $output = *uninitialized*; protected bool $errored = FALSE; protected OC\Repair $repair = class OC\Repair { private array $repairSteps = [...]; private string $currentStep = *uninitialized*; private OCP\EventDispatcher\IEventDispatcher $dispatcher = class OC\EventDispatcher\EventDispatcher { ... }; private Psr\Log\LoggerInterface $logger = class OC\Log\PsrLoggerAdapter { ... } }; protected OCP\IConfig $config = class OC\AllConfig { private ?OCP\IDBConnection $connection = class OC\DB\ConnectionAdapter { ... }; private OCP\Cache\CappedMemoryCache $userCache = class OCP\Cache\CappedMemoryCache { ... }; private OC\SystemConfig $systemConfig = class OC\SystemConfig { ... } }; private OCP\EventDispatcher\IEventDispatcher $dispatcher = class OC\EventDispatcher\EventDispatcher { private Symfony\Component\EventDispatcher\EventDispatcher $dispatcher = class Symfony\Component\EventDispatcher\EventDispatcher { ... }; private OCP\IServerContainer $container = class OC\Server { ... }; private Psr\Log\LoggerInterface $logger = class OC\Log\PsrLoggerAdapter { ... } }; private OCP\App\IAppManager $appManager = class OC\App\AppManager { protected $protectedAppTypes = [...]; private array $installedAppsCache = [...]; private ?array $shippedApps = [...]; private array $alwaysEnabled = [...]; private array $defaultEnabled = [...]; private array $appInfos = [...]; private array $appVersions = [...]; private array $autoDisabledApps = [...]; private array $appTypes = [...]; private array $loadedApps = [...]; private OCP\IUserSession $userSession = class OC\User\Session { ... }; private OCP\IConfig $config = class OC\AllConfig { ... }; private OC\AppConfig $appConfig = class OC\AppConfig { ... }; private OCP\IGroupManager $groupManager = class OC\Group\Manager { ... }; private OCP\ICacheFactory $memCacheFactory = class OC\Memcache\Factory { ... }; private OCP\EventDispatcher\IEventDispatcher $dispatcher = class OC\EventDispatcher\EventDispatcher { ... }; private Psr\Log\LoggerInterface $logger = class OC\Log\PsrLoggerAdapter { ... }; private OCP\IURLGenerator $urlGenerator = class OC\URLGenerator { ... } } }, $input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'maintenance:repair']; protected $interactive = TRUE; private $tokens = [0 => 'maintenance:repair']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php:301 PHP 7. Symfony\Component\Console\Command\Command->run($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'maintenance:repair']; protected $interactive = TRUE; private $tokens = [0 => 'maintenance:repair']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php:1040 PHP 8. OC\Core\Command\Maintenance\Repair->execute($input = class Symfony\Component\Console\Input\ArgvInput { protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $lastArrayArgument = NULL; private $lastOptionalArgument = NULL; private $options = [...]; private $negations = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'maintenance:repair']; protected $interactive = TRUE; private $tokens = [0 => 'maintenance:repair']; private $parsed = [] }, $output = class Symfony\Component\Console\Output\ConsoleOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { private $decorated = TRUE; private $styles = [...]; private $styleStack = class Symfony\Component\Console\Formatter\OutputFormatterStyleStack { ... } }; private ${Symfony\Component\Console\Output\StreamOutput}stream = resource(2) of type (stream); private $stderr = class Symfony\Component\Console\Output\StreamOutput { private ${Symfony\Component\Console\Output\Output}verbosity = 32; private ${Symfony\Component\Console\Output\Output}formatter = class Symfony\Component\Console\Formatter\OutputFormatter { ... }; private $stream = resource(3) of type (stream) }; private $consoleSectionOutputs = [] }) /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Command/Command.php:298 PHP 9. OC\Repair->addStep($repairStep = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/core/Command/Maintenance/Repair.php:98 PHP 10. OC\AppFramework\Utility\SimpleContainer->get($id = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/lib/private/Repair.php:141 PHP 11. OC\ServerContainer->query($name = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes', $autoload = *uninitialized*) /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:64 PHP 12. OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback($name = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/lib/private/ServerContainer.php:155 PHP 13. OC\AppFramework\Utility\SimpleContainer->query($name = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes', $autoload = *uninitialized*) /var/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php:470 PHP 14. OC\AppFramework\Utility\SimpleContainer->resolve($name = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:146 PHP 15. ReflectionClass->__construct($objectOrClass = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:126 PHP 16. Composer\Autoload\ClassLoader->loadClass($class = 'OCA\\FilesArchive\\Migration\\RegisterMimeTypes') /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php:126 PHP 17. Composer\Autoload\{closure:/var/www/nextcloud/lib/composer/composer/ClassLoader.php:575-577}($file = '/var/www/nextcloud/apps/files_archive/lib//Migration/RegisterMimeTypes.php') /var/www/nextcloud/lib/composer/composer/ClassLoader.php:427

rotdrop commented 4 months ago

PHP warnings, not errors. Anyhow, continue 2 would have been correct.

rotdrop commented 4 months ago

8e59215

rcfa commented 2 months ago

Looks like your changes haven’t been pushed out into a public update, yet, as I keep getting these warnings.

Also, today I got this when updating apps:

An unhandled exception has been thrown:
Error: Call to undefined method OCA\Mail\Db\MessageMapper::deleteDuplicateUids() in /var/www/nextcloud/apps/mail/lib/Migration/DeleteDuplicateUids.php:27
Stack trace:
#0 /var/www/nextcloud/lib/private/Repair.php(125): OCA\Mail\Migration\DeleteDuplicateUids->run()
#1 /var/www/nextcloud/lib/private/legacy/OC_App.php(838): OC\Repair->run()
#2 /var/www/nextcloud/lib/private/legacy/OC_App.php(779): OC_App::executeRepairSteps()
#3 /var/www/nextcloud/lib/private/Installer.php(184): OC_App::updateApp()
#4 /var/www/nextcloud/core/Command/App/Update.php(106): OC\Installer->updateAppstoreApp()
#5 /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Command/Command.php(298): OC\Core\Command\App\Update->execute()
#6 /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
#7 /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#8 /var/www/nextcloud/apps/files_archive/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#9 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#10 /var/www/nextcloud/console.php(102): OC\Console\Application->run()
#11 /var/www/nextcloud/occ(11): require_once('...')
#12 {main}                                                                                                                                     
rotdrop commented 2 months ago

Sorry, but is not this a bug in the Mail app? True, PHP uses files from the vendor repository of the files_archive app, but just because it happens to find them first there (instead of in apps/mail/vendor/ or 3rdparty/).

rcfa commented 2 months ago

I’m by far not sufficietly knowledable about the workings of Nextcloud to make any assessments. I just noticed that "apps/files_archive" is the only app mentioned, the rest being libraries and core components, so I figure I bring it to your attention. I also didn’t open a new bug, as I was a bit confused why updating Mail app would involve your code

rotdrop commented 2 months ago

I’m by far not sufficietly knowledable about the workings of Nextcloud to make any assessments. I just noticed that "apps/files_archive" is the only app mentioned, the rest being libraries and core components, so I figure I bring it to your

Second line of the error messages that you have posted in your comment https://github.com/rotdrop/nextcloud-app-files-archive/issues/47#issuecomment-2228241636

Error: Call to undefined method OCA\Mail\Db\MessageMapper::deleteDuplicateUids() in /var/www/nextcloud/apps/mail

This is were the error occurs, and this directly referes to the mail app, not files_archive. Indeed, the stuff below the vendor/ directory in each app is what you call being components and libraries and core components. The only piece of code which directly refers to the source code of one specific app is that said second line of the error messages quoted in your comment.