Page MenuHomePhabricator

Exceptions about after extending from Phobject
Closed, ResolvedPublic

Description

After D13283 we were seeing no less than two fatals because apparently something is iterating over something that extends Phobject without implementing its own methods. The culprits are these:

1	exception 'DomainException' with message 'Attempting to iterate an object (of class PhabricatorWorkerArchiveTaskQuery) which is not iterable.' in /usr/lib/libphutil/src/object/Phobject.php:50
2	Stack trace:
3	#0 /usr/lib/libphutil/src/object/Phobject.php(42): Phobject->throwOnAttemptedIteration()
4	#1 /usr/lib/phabricator/src/infrastructure/daemon/workers/PhabricatorWorker.php(204): Phobject->rewind()
5	#2 /usr/lib/phabricator/src/applications/drydock/storage/DrydockLease.php(157): PhabricatorWorker::waitForTasks(Array)
6	#3 /usr/lib/phabricator/src/applications/drydock/storage/DrydockLease.php(198): DrydockLease::waitForLeases(Array)
7	#4 /usr/lib/phabricator/src/applications/harbormaster/step/HarbormasterLeaseHostBuildStepImplementation.php(32): DrydockLease->waitUntilActive()
8	#5 /usr/lib/phabricator/src/applications/harbormaster/worker/HarbormasterTargetWorker.php(52): HarbormasterLeaseHostBuildStepImplementation->execute(Object(HarbormasterBuild), Object(HarbormasterBuildTarget))
9	#6 /usr/lib/phabricator/src/infrastructure/daemon/workers/PhabricatorWorker.php(91): HarbormasterTargetWorker->doWork()
10	#7 /usr/lib/phabricator/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php(162): PhabricatorWorker->executeTask()
11	#8 /usr/lib/phabricator/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php(22): PhabricatorWorkerActiveTask->executeTask()
12	#9 /usr/lib/libphutil/src/daemon/PhutilDaemon.php(183): PhabricatorTaskmasterDaemon->run()
13	#10 /usr/lib/libphutil/scripts/daemon/exec/exec_daemon.php(125): PhutilDaemon->execute()
14	#11 {main}

And also:

-abstract class DrydockConstants extends Phobject {}
+abstract class DrydockConstants {}

I removed the extends and it started working again.

Event Timeline

mikn raised the priority of this task from to Needs Triage.
mikn updated the task description. (Show Details)
mikn added a project: Drydock.
mikn added a project: Infrastructure.
mikn added a subscriber: mikn.

Ah, to recreate this you only need to add a build plan with a "Lease Host" step and you will get this fatal. The class referenced in the first message in the stack trace will be DrydockConstants and not PhabricatorWorkerArchiveTaskQuery though.

Hm, in your original report the stack trace doesn't mention DrydockConstants.

Ah, that was an intermediate error that I got when I was trying to solve it. I'll implement the fix that you have in D13335 and it solves the problem I experienced. :)