circles
circles copied to clipboard
update to 22.1.1 error - ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0
i wanted to upgrade from 21.0.4 to 22.1.1. (& rolled back) the updater crashed with the following error:
021-08-26T17:49:57+02:00 Repair info: (Circles) Migrating to 22 2021-08-26T17:49:57+02:00 Upgrading Circles App 2021-08-26T17:49:57+02:00 2021-08-26T17:49:57+02:00 Starting ... 0/22 [>-] 0%An unhandled exception has been thrown: ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in /var/.../3rdparty/symfony/console/Helper/ProgressBar.php:497 Stack trace: #0 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(497): str_repeat() #1 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(568): Symfony\Component\Console\Helper\ProgressBar::Symfony\Component\Console\Helper\{closure}() #2 [internal function]: Symfony\Component\Console\Helper\ProgressBar->Symfony\Component\Console\Helper\{closure}() #3 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(581): preg_replace_callback() #4 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(393): Symfony\Component\Console\Helper\ProgressBar->buildLine() #5 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(352): Symfony\Component\Console\Helper\ProgressBar->display() #6 /var/.../3rdparty/symfony/console/Helper/ProgressBar.php(312): Symfony\Component\Console\Helper\ProgressBar->setProgress() #7 /var/.../core/Command/Upgrade.php(142): Symfony\Component\Console\Helper\ProgressBar->advance() #8 /var/.../3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OC\Core\Command\Upgrade->OC\Core\Command\{closure}() #9 /var/.../3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() #10 /var/.../3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners() #11 /var/.../lib/private/EventDispatcher/SymfonyAdapter.php(123): Symfony\Component\EventDispatcher\EventDispatcher->dispatch() #12 /var/.../lib/private/Repair.php(251): OC\EventDispatcher\SymfonyAdapter->dispatch() #13 /var/.../lib/private/Repair.php(282): OC\Repair->emit() #14 /var/.../apps/circles/lib/Service/OutputService.php(86): OC\Repair->advance() #15 /var/.../apps/circles/lib/Service/MigrationService.php(291): OCA\Circles\Service\OutputService->output() #16 /var/.../apps/circles/lib/Service/MigrationService.php(218): OCA\Circles\Service\MigrationService->migrationTo22_Circles() #17 /var/.../apps/circles/lib/Service/MigrationService.php(200): OCA\Circles\Service\MigrationService->migrationTo22() #18 /var/.../apps/circles/lib/Migration/Migration.php(97): OCA\Circles\Service\MigrationService->migration() #19 /var/.../lib/private/Repair.php(123): OCA\Circles\Migration\Migration->run() #20 /var/.../lib/private/legacy/OC_App.php(1059): OC\Repair->run() #21 /var/.../lib/private/legacy/OC_App.php(1001): OC_App::executeRepairSteps() #22 /var/.../lib/private/Updater.php(345): OC_App::updateApp() #23 /var/.../lib/private/Updater.php(262): OC\Updater->doAppUpgrade() #24 /var/.../lib/private/Updater.php(130): OC\Updater->doUpgrade() #25 /var/.../core/Command/Upgrade.php(241): OC\Updater->upgrade() #26 /var/.../3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute() #27 /var/.../3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run() #28 /var/.../3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand() #29 /var/.../3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun() #30 /var/.../lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run() #31 /var/.../console.php(99): OC\Console\Application->run() #32 /var/.../occ(11): require_once('...') #33 {main}
after that i restartet upgrade, there was not error but then in contacts i could not see the existing circles and a error popup is coming. not sure but maybe this is the error then in frontend, i guess follow up error:
"exception":{"Exception":"Sabre\\DAV\\Exception\\NotImplemented","Message":"","Code":0,"Trace":[{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/PropFind.php","line":95,"function":"getSize","class":"OCA\\ContactsInteraction\\Card","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":751,"function":"handle","class":"Sabre\\DAV\\PropFind","type":"->"},{"file":"/var/.../3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"propFind","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":1052,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":984,"function":"getPropertiesByNode","class":"Sabre\\DAV\\Server","type":"->"},{"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":941,"function":"iterator_to_array"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":800,"function":"getPropertiesForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":858,"function":"getProperties","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":100,"function":"getHTTPHeaders","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../apps/dav/lib/Server.php","line":333,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/.../apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/.../remote.php","line":166,"args":["/var/.../apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/.../apps/contactsinteraction/lib/Card.php","Line":107,"CustomMessage":"--"}}
PS the updater frontend says that the circle app is not compatible, a bit confusing.
Interestingly for me running sudo -u www-data php updater.phar
again, seems to have avoided this issue
Interestingly for me running
sudo -u www-data php updater.phar
again, seems to have avoided this issue
Really, after this issue in log I just did repeat command: sudo -u www-data php /var/www/nextcloud/updater/updater.phar
update process has been done fine. Fantastic.
This is strange and might be related to symfony/console. Could it comes from the size of your terminal or its encoding ?
Would it be possible that one of your apps you have installed comes with a conflicted version of Symfony ?
please run this shell command from your apps folders:
find . | grep ProgressBar
Would it be possible that one of your apps you have installed comes with a conflicted version of Symfony ?
please run this shell command from your apps folders:
find . | grep ProgressBar
this command give me the following back (nc 21.0.4):
./calendar/vendor/symfony/console/Helper/ProgressBar.php
this command give me the following back (nc 21.0.4):
./calendar/vendor/symfony/console/Helper/ProgressBar.php
https://github.com/nextcloud/calendar/pull/3437 should fix that
okay thanks, that sounds great!
i guess i have to wait then for a calendar app 2.3.3 release and after i updated that app i can restart the main upgrade to 22.1.1.
v2.3.3 released
also, if you have any doubt, you can choose to ignore the auto-migration of Circles and run it manually afterwards:
- run this command while still in NC21:
./occ config:app:set --value '1' circles migration_bypass
- upgrade your Nextcloud to NC22
- run this command when in NC22:
./occ circles:sync --migration
But if you have no problem testing if the last version of Calendar fixes our issue, please do it first then test with the migration_bypass config flag if it does not work
Edit: fixing 'when in NC21' by 'when in NC22'
also, if you have any doubt, you can choose to ignore the auto-migration of Circles and run it manually afterwards:
- run this command while still in NC21:
./occ config:app:set --value '1' circles migration_bypass
- upgrade your Nextcloud to NC22
- run this command when in NC21:
./occ circles:sync --migration
But if you have no problem testing if the last version of Calendar fixes our issue, please do it first then test with the migration_bypass config flag if it does not work
with 2.3.3 the error is still present :( it again crashed with "ValueError: str_repeat(): Argument #2 ($times)"
run this command while still in NC21: ./occ config:app:set --value '1' circles migration_bypass upgrade your Nextcloud to NC22 run this command when in NC21: ./occ circles:sync --migration
this worked as far i can see now perfectly!
Glad we found a workaround. The issue is really strange and I will see if I can catch the Exception/Throwable as the ProgressBar animation is not really mandatory.
Until next release, this issue will stay opened
@ArtificialOwl maybe one last question: is it better to reset the "migration_bypass" config to "0" again?
Possibly fixed by https://github.com/nextcloud/server/pull/31877
nextcloud/server#29023