marius-wieschollek / passwords

A simple, yet feature rich password manager for Nextcloud
GNU Affero General Public License v3.0
215 stars 45 forks source link

Passwords triggers "Parse error: syntax error" exception when casting occ command #340

Closed biguenique closed 3 years ago

biguenique commented 3 years ago

System Information

Server: Put the output of "./occ passwords:system:report debug" here or fill out the fields below

nuage5722@qc3:~/public_html$ php occ passwords:system:report debug
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
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'BackupService' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /home/cloud.redacted.com/public_html/apps/passwords/lib/Command/BackupCreateCommand.php:28
Stack trace:
#0 /home/cloud.redacted.com/public_html/lib/composer/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/home/cloud.red...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\\Passwords\\C...')
#2 [internal function]: spl_autoload_call('OCA\\Passwords\\C...')
#3 /home/cloud.redacted.com/public_html/lib/private/AppFramework/Utility/SimpleContainer.php(107): ReflectionClass->__construct('OCA\\Passwords\\C...')
#4 /home/cloud.redacted.com/public_html/lib/private/AppFramework/Utility/SimpleContainer.php(126): OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\Passwords\\C...')
#5 /home/cloud.redacted.com/public_html/lib/private/AppFramework/DependencyInjection/DIContainer.php(455): OC\AppFramework\Utility\SimpleContainer->query('OCA\\Passwords\\C...')
#6 /home/cloud.redacted.com/public_html/lib/private/ServerContainer.php(140): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback('OCA\\Passwords\\C...')
#7 /home/cloud.redacted.com/public_html/lib/private/Console/Application.php(221): OC\ServerContainer->query('OCA\\Passwords\\C...')
#8 /home/cloud.redacted.com/public_html/lib/private/Console/Application.php(136): OC\Console\Application->loadCommandsFromInfoXml(Array)
#9 /home/cloud.redacted.com/public_html/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /home/cloud.redacted.com/public_html/occ(11): require_once('/home/nuage.fia...')````

Nextcloud Version: 20.0.6 PHP Version: PHP 7.3.23-1+focal (cli) (built: Oct 1 2020 16:41:09) ( NTS ) Database and Version: mysql Ver 15.1 Distrib 10.3.25-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 Server OS and Version: Ubuntu 20.04.2 LTS Passwords Version: 2021.1.0 (Server is OpenLiteSpeed)

Client:

Browser and Version: N/A Client OS and Version: N/A

Steps to reproduce

  1. run an occ command
  2. be disapointed that it doesn't work
  3. move the passwords folder away from the apps/ folder
  4. run your occ command
  5. rejoice that it now works
  6. don't forget to put the passwords folder back into the apps/ folder!

Expected result

Passwords should not prevent occ commands from working

Actual result

Passwords prevents occ commands from working

Nextcloud log

(see backtrace up there)

Browser log

(not relevant)

Might be PHP related (typecasting variables provoking a syntax error ?) but I couldn't tell. Server is running PHP 7.4, CLI version is 7.3... maybe related ?

marius-wieschollek commented 3 years ago

Server is running PHP 7.4, CLI version is 7.3... maybe related ?

Yes, that is the cause. Try running cronjobs and cli jobs with php7.4 or run sudo update-alternatives --config php to use PHP 7.4.

Also version 2021.1.0 is not the latest one. After you have fixed the PHP issue you should get and update to 2021.1.2

github-actions[bot] commented 3 years ago

This issue has been locked automatically since there was no recent activity after it was closed.