Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.4 not working in NC 20 / PHP 7.2.24 / Ubuntu 18.04 #1774

Closed
4 of 8 tasks
Bapf opened this issue Jun 24, 2021 · 12 comments
Closed
4 of 8 tasks

2.0.4 not working in NC 20 / PHP 7.2.24 / Ubuntu 18.04 #1774

Bapf opened this issue Jun 24, 2021 · 12 comments
Labels
Milestone

Comments

@Bapf
Copy link

Bapf commented Jun 24, 2021

What is going wrong? What did you observe?

Describe the bug

A clear and concise description of what is wrong.

Steps to reproduce the behavior
Installing or updating to 2.0.4 throws an "An error occured during the request. Unable to proceed."

Doing the same with occ gives:

130 xxxx@cloud:/var/www/html/nextcloud$ sudo -u www-data php occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Updating ...
An unhandled exception has been thrown:
ParseError: syntax error, unexpected ')' in /var/www/html/nextcloud/apps/polls/lib/Migration/FixVotes.php:74
Stack trace:
#0 /var/www/html/nextcloud/lib/composer/composer/ClassLoader.php(322): Composer\Autoload\includeFile('/var/www/html/n...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\Polls\Migra...')
#2 [internal function]: spl_autoload_call('OCA\Polls\Migra...')
#3 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(107): ReflectionClass->__construct('OCA\Polls\Migra...')
#4 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(126): OC\AppFramework\Utility\SimpleContainer->resolve('OCA\Polls\Migra...')
#5 /var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(455): OC\AppFramework\Utility\SimpleContainer->query('OCA\Polls\Migra...')
#6 /var/www/html/nextcloud/lib/private/ServerContainer.php(140): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback('OCA\Polls\Migra...')
#7 /var/www/html/nextcloud/lib/private/Repair.php(126): OC\ServerContainer->query('OCA\Polls\Migra...')
#8 /var/www/html/nextcloud/lib/private/legacy/OC_App.php(1035): OC\Repair->addStep('OCA\Polls\Migra...')
#9 /var/www/html/nextcloud/lib/private/legacy/OC_App.php(970): OC_App::executeRepairSteps('polls', Array)
#10 /var/www/html/nextcloud/lib/private/Updater.php(379): OC_App::updateApp('polls')
#11 /var/www/html/nextcloud/lib/private/Updater.php(258): OC\Updater->doAppUpgrade()
#12 /var/www/html/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade('20.0.10.1', '20.0.10.1')
#13 /var/www/html/nextcloud/core/Command/Upgrade.php(255): OC\Updater->upgrade()
#14 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/nextcloud/console.php(100): OC\Console\Application->run()
#20 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')

(Removing the "," at the end of line 73 of FixVotes.php fixes the issue.

Information about your polls installation

Polls version: (see apps page)
2.0.4

Fresh installation or update from a prior version (from which one)?

  • First time install
  • Update from a prior version
    Version number of the previous version: 2.0.2

How did you install this version?(Appstore or describe installation)

  • Installed from the appstore
  • Installed via occ
  • Installed via extracting downloaded package to the apps folder

Information about your Instance of Nextcloud

Nextcloud version: (see Nextcloud admin page)
20.0.10

Server configuration (decide, if you think it is helpful)

PHP version:

  • 7.3 or lower (7.2.24-0ubuntu0.18.04.7)
  • 7.4
  • 8.0
@chris-est
Copy link

Can confirm, same Nextcloud, PHP and Ubuntu Version.
Thank you for the fix!

@dartcafe
Copy link
Collaborator

@Bapf Thanks for the information.

Actually PHP 7.2 is no more supported by nextcloud and out of maintenance itsself sice 6 months. So please consider updating to a more recent PHP-Version.

@Bapf
Copy link
Author

Bapf commented Jun 24, 2021

Actually PHP 7.2 is no more supported by nextcloud and out of maintenance itsself sice 6 months. So please consider updating to a more recent PHP-Version.

That depends. When using (the LTS!) Ubuntu 18.04 this version is still very well in maintenance.
Thinking that people always use the latest versions is quit annoying because this nullifies the intention of an LTS version.

And to quote NextCloud (in the Admin-Section) itself: "Nextcloud 20 is the last release supporting PHP 7.2. Nextcloud 21 requires at least PHP 7.3" So if you tag your app to be compatible with NC 20, than it also should still work with PHP 7.2 please.

@kinimodmeyer
Copy link

Actually PHP 7.2 is no more supported by nextcloud and out of maintenance itsself sice 6 months. So please consider updating to a more recent PHP-Version.

That depends. When using (the LTS!) Ubuntu 18.04 this version is still very well in maintenance.
Thinking that people always use the latest versions is quit annoying because this nullifies the intention of an LTS version.

it not depends, have a look at https://www.php.net/supported-versions.php .
php7.2 is not even in maintenance for security anymore. no one talking about "always the latest versions".
you are years behind with your setup.

@Bapf
Copy link
Author

Bapf commented Jun 24, 2021

it not depends, have a look at https://www.php.net/supported-versions.php .
php7.2 is not even in maintenance for security anymore. no one talking about "always the latest versions".
you are years behind with your setup.

No, I'm not. Ubuntu backports security fixes (but not new features) to its 7.2 version. And that will be the case until 2023! That's the whole point of LTS distributions.

Nevertheless, that isn't even the issue here: NC 20 supports PHP 7.2, so if Polls 2.0.4 tagged as compatible with NC 20, it has to work on all PHP versions NC 20 supports. Otherwise people get errors when updating the app from the app store without knowing why ...
If you don't want to support PHP 7.2, you just hat to remove compatibility with NC 20, but since the fix is just removing on comma ...

@dartcafe
Copy link
Collaborator

Thinking that people always use the latest versions is quit annoying because this nullifies the intention of an LTS version.

The problem here is, that I was mistaken to assume, that NC20 doesn't support PHP 7.2, but it still does. PHP 7.3 is the minimum supported version from NC21 on.

Nevertheless, of course I removed the comma, as it was not by intention. But I will wait for a new release, to be sure no other problems occur. ATM I am struggeling with NC22 compatibility for the comming version.

Just mentioning: Your patch level is behind the last official PHP release, which is 7.2.34.

@Bapf
Copy link
Author

Bapf commented Jun 27, 2021

Just mentioning: Your patch level is behind the last official PHP release, which is 7.2.34.

I know. But that's also supposed to be that way: Ubuntu freezes the patch level on release (down to the minor version) and then backports only the security fixes.
This is supposed to help with stability (because there are no feature releases which also can cause issues as a side effect) without compromising security (because you still get all the security fixes).

@Moini
Copy link

Moini commented Jun 27, 2021

What's worst is that it gets stuck in the update. Only disabling the app from the command line solves the problem (temporarily).

@dartcafe
Copy link
Collaborator

See comment from @Bapf #1770 (comment)
You can manually remove the trailing comma in line 73 of apps/polls/lib/Migration/FixVotes.php

like here (now it is line 83 in this version of the file and the comma after $option->getPollOptionText() has been removed)

public function run(IOutput $output) {
$schema = new SchemaWrapper($this->connection);
if ($schema->hasTable('polls_options')) {
$foundOptions = $this->optionMapper->findOptionsWithDuration();
foreach ($foundOptions as $option) {
$this->voteMapper->fixVoteOptionText(
$option->getPollId(),
$option->getId(),
$option->getPollOptionTextStart(),
$option->getPollOptionText()
);
}
}
}
}

After that you can enable the app again. Version 2.0.5 will bring the fix.

@dartcafe dartcafe added this to the 2.0.5 milestone Jun 30, 2021
@dartcafe dartcafe added the bug label Jun 30, 2021
@dartcafe
Copy link
Collaborator

dartcafe commented Jul 2, 2021

fixed in 2.0.5

@dartcafe dartcafe closed this as completed Jul 2, 2021
@Moini
Copy link

Moini commented Jul 6, 2021

Thanks, @dartcafe - confirmed that it works! (by editing, yesterday, the 2.0.5 wasn't yet available officially).

Copy link

github-actions bot commented Jun 3, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants