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

An unhandled exception has been thrown during update V2.0.4 -> V2.0.5 #1811

Closed
6 of 14 tasks
aniqueta opened this issue Jul 5, 2021 · 22 comments · Fixed by #1818
Closed
6 of 14 tasks

An unhandled exception has been thrown during update V2.0.4 -> V2.0.5 #1811

aniqueta opened this issue Jul 5, 2021 · 22 comments · Fixed by #1818

Comments

@aniqueta
Copy link

aniqueta commented Jul 5, 2021

What is going wrong? What did you observe?

Describe the bug

Similar to #1770. Log below.

Steps to reproduce the behavior

Updated from web, then received error, and updated from occ command.

Also removed app via occ command line and attempted fresh install with occ command and received same error.

Add a screenshot of the misbehavior

N/A

How should it work?

What you expected to happen?

Clean update

Information about your polls installation

Polls version: 2.0.4 -> 2.0.5

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.4 -> 2.0.5

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: 21.0.3

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

Database:

  • MySql version:
  • MariaDB version: 10.3.29
  • PostgreSQL version:
  • Oracle version:
  • SQLite:
  • Other (add name and version):

PHP version:

  • 7.3 or lower
  • 7.4
  • 8.0

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

No

Logs

An unhandled exception has been thrown:
ArgumentCountError: Too few arguments to function OCA\Polls\Migration\FixVotes::__construct(), 0 passed in /var/www/lib/private/Repair.php on line 129 and exactly 4 expected in /var/www/apps/polls/lib/Migration/FixVotes.php:50
Stack trace:
#0 /var/www/lib/private/Repair.php(129): OCA\Polls\Migration\FixVotes->__construct()
#1 /var/www/lib/private/legacy/OC_App.php(1043): OC\Repair->addStep()
#2 /var/www/lib/private/Installer.php(145): OC_App::executeRepairSteps()
#3 /var/www/core/Command/App/Install.php(68): OC\Installer->installApp()
#4 /var/www/apps/bookmarks/vendor/symfony/console/Command/Command.php(255): OC\Core\Command\App\Install->execute()
#5 /var/www/apps/bookmarks/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#6 /var/www/apps/bookmarks/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#7 /var/www/apps/bookmarks/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#8 /var/www/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#9 /var/www/console.php(100): OC\Console\Application->run()
#10 /var/www/occ(11): require_once('/var/www/...')
@dartcafe
Copy link
Collaborator

dartcafe commented Jul 5, 2021

This error is not reproducable for me with NC21. When using NC20 there seems to be an issue with the dependency injection and I can reproduce the error there.

@nikkilocke
Copy link

I have this too - tried to look in the code to see if I could see what was wrong, but I am completely baffled. Got as far as nextcloud/lib/private/Repair.php:

	public function addStep($repairStep) {
		if (is_string($repairStep)) {
			try {
				$s = \OC::$server->query($repairStep);
			} catch (QueryException $e) {
				if (class_exists($repairStep)) {
					$s = new $repairStep();
				} else {
					throw new \Exception("Repair step '$repairStep' is unknown");
				}
			}

			if ($s instanceof IRepairStep) {
				$this->repairSteps[] = $s;
			} else {
				throw new \Exception("Repair step '$repairStep' is not of type \\OCP\\Migration\\IRepairStep");
			}
		} else {
			$this->repairSteps[] = $repairStep;
		}
	}

which is obviously failing at $s = new $repairStep(); because the constructor expects arguments.

This is with NC 20.

@dartcafe
Copy link
Collaborator

dartcafe commented Jul 5, 2021

Yep. This works since NC21. I have to investigate. I barely remember, we had this problem before.

@aniqueta
Copy link
Author

aniqueta commented Jul 6, 2021

Thanks all. I updated to NC21 (as that just got to the stable channel in the last 24 hr for me). The Polls app updated/works. So, this issue is kind of resolved for me, but I assume others still on NC20 will experience it.

@pongraczi
Copy link

Yep, on NC20 it is still a problem :)))

@nursoda
Copy link

nursoda commented Jul 6, 2021

I my case led to NC 20 being in maintenance mode on a system that I cannot access directly, so I had to ask the hoster to fix it. This should never happen!

@Punkado
Copy link

Punkado commented Jul 6, 2021

Just adding that going back to the 2.0.4 also don't work anymore with Nextcloud 20.0.11.

@mmallejac
Copy link

mmallejac commented Jul 6, 2021 via email

dartcafe added a commit that referenced this issue Jul 6, 2021
Signed-off-by: dartcafe <github@dartcafe.de>
@dartcafe dartcafe linked a pull request Jul 6, 2021 that will close this issue
@ChristophWurst
Copy link
Member

When using NC20 there seems to be an issue with the dependency injection

Try dropping the OC\DB\Connection injections. It's unused anyway. Also this is private API, the app shouldn't use this.

@ChristophWurst
Copy link
Member

Now I see your PR 🙈

ChristophWurst added a commit that referenced this issue Jul 6, 2021
fix compatibily trap between NC20 and NC21 #1811
@dartcafe
Copy link
Collaborator

dartcafe commented Jul 6, 2021

Also this is private API, the app shouldn't use this.

We already talked about this. 😁 Would be good if OCP\IDBConnection would be usable in the Repairsteps as well.

@ChristophWurst
Copy link
Member

We already talked about this

I have the remembery of a 🐟

@dartcafe
Copy link
Collaborator

dartcafe commented Jul 6, 2021

Our weekly bugfix release (2.0.6) is out, which should fix this issue.
I spent some time with different migration paths on NC 20 and 21. Hope I got them all. 🙏

@t-markmann
Copy link

Our weekly bugfix release (2.0.6) is out, which should fix this issue.
I spent some time with different migration paths on NC 20 and 21. Hope I got them all. 🙏

In the Appstore it's still on 2.0.5
Will this be available in the next few days?
Thank you.

@dartcafe
Copy link
Collaborator

dartcafe commented Jul 7, 2021

As soon as @v1r0x has time to do this.
Just checked, it is out.

@dartcafe
Copy link
Collaborator

dartcafe commented Jul 7, 2021

Anyone able to confirm, that the issue is gone?

@FloMiLe
Copy link

FloMiLe commented Jul 7, 2021

Can I update the polls app while it is disabled? Enabling version 2.0.5 throws an error...

@dartcafe
Copy link
Collaborator

dartcafe commented Jul 7, 2021

Yes, of course

@hokascha
Copy link

hokascha commented Jul 7, 2021

Anyone able to confirm, that the issue is gone?

Can confirm updating 2.0.5 to 2.0.6 on Nextcloud 20 is successful. Reactivating polls is successful. Everything normal for me, thanks for fixing the issue!

@FloMiLe
Copy link

FloMiLe commented Jul 7, 2021

Can I update the polls app while it is disabled? Enabling version 2.0.5 throws an error...

I was just asking because the update was not available earlier, and I was wondering whether that was due to the previous erroneous update. Everything works now. Thanks for fixing this so quickly!

@dartcafe dartcafe closed this as completed Jul 7, 2021
@nikkilocke
Copy link

Is it OK to put a big thankyou here for sorting this out so quickly? 👏 ❤️

Copy link

github-actions bot commented Jun 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.