Updating Neos beta 14 to 15

Hi

cr:projectionReplayAll is not working for me:

This will replay all projections in "default", which may take some time. Are you sure to proceed? (y/n) y
Replaying events for all projections of Content Repository "default" ...
 3/3 [████████████████████████████] 100% 1 min, 3 secs/1 min, 3 secs 72.0 MiB
 doctrineDbalContentGraph -  28562/230334 [===>------------------------]  12%  5 mins, 48 secs/46 mins, 46 secs 88.0 MiB
Neos\Neos\AssetUsage\Service\AssetUsageIndexingService_Original::removeIndexForNode(): Argument #2 ($node) must be of type Neos\ContentRepository\Core\Projection\ContentGraph\Node, null given, called in /Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_AssetUsage_CatchUpHook_AssetUsageCatchUpHook.php on line 127

  Type: TypeError
  File: Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_AssetUs
        age_Service_AssetUsageIndexingService.php
  Line: 174

Additionally, I found this Exception:

Exception in line 127 of /Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_AssetUsage_CatchUpHook_AssetUsageCatchUpHook.php: Neos\Neos\AssetUsage\Service\AssetUsageIndexingService_Original::removeIndexForNode(): Argument #2 ($node) must be of type Neos\ContentRepository\Core\Projection\ContentGraph\Node, null given, called in /Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_AssetUsage_CatchUpHook_AssetUsageCatchUpHook.php on line 127

18 Neos\Neos\AssetUsage\Service\AssetUsageIndexingService_Original::removeIndexForNode(ContentRepositoryId|default|, NULL)
17 Neos\Neos\AssetUsage\CatchUpHook\AssetUsageCatchUpHook_Original::removeNodes(WorkspaceName|live|, NodeAggregateId|04ca6743-710d-459d-81a0-5eeb906ae20f|, DimensionSpacePointSet|[{"language":"de"}]|)
16 Neos\Neos\AssetUsage\CatchUpHook\AssetUsageCatchUpHook_Original::onBeforeEvent(NodeAggregateWasRemoved|{"workspaceName":"live","contentStreamId":"5b40481f-8c5a-4fe5-965b-ceee3bfdf49c","nodeAggregateId":"…|, EventEnvelope|{"event":{"id":{"value":"31192a11-a3d3-43c8-bbf3-22f89a16339a"},"type":{"value":"NodeAggregateWasRem…|)
15 Neos\ContentRepository\Core\Projection\DelegatingCatchUpHook::onBeforeEvent(NodeAggregateWasRemoved|{"workspaceName":"live","contentStreamId":"5b40481f-8c5a-4fe5-965b-ceee3bfdf49c","nodeAggregateId":"…|, EventEnvelope|{"event":{"id":{"value":"31192a11-a3d3-43c8-bbf3-22f89a16339a"},"type":{"value":"NodeAggregateWasRem…|)
14 Neos\ContentRepository\Core\ContentRepository::Neos\ContentRepository\Core\{closure}(EventEnvelope|{"event":{"id":{"value":"31192a11-a3d3-43c8-bbf3-22f89a16339a"},"type":{"value":"NodeAggregateWasRem…|)
13 Neos\ContentRepository\Core\Projection\CatchUp::run(Neos\EventStore\Helper\BatchEventStream)
12 Neos\ContentRepository\Core\ContentRepository::catchUpProjection("Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection", CatchUpOptions|{"maximumSequenceNumber":null,"progressCallback":{}}|)
11 Neos\ContentRepositoryRegistry\Service\ProjectionReplayService::replayAllProjections(CatchUpOptions|{"maximumSequenceNumber":null,"progressCallback":{}}|, Closure)
10 Neos\ContentRepositoryRegistry\Command\CrCommandController_Original::projectionReplayAllCommand("default", false, false, 0)
9 Neos\Flow\Cli\CommandController_Original::callCommandMethod()
8 Neos\Flow\Cli\CommandController_Original::processRequest(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
7 Neos\Flow\Cli\Dispatcher_Original::dispatch(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
6 Neos\Flow\Cli\CommandRequestHandler::Neos\Flow\Cli\{closure}()
5 Closure::__invoke()
4 Neos\Flow\Security\Context_Original::withoutAuthorizationChecks(Closure)
3 Neos\Flow\Cli\CommandRequestHandler::handleRequest()
2 Neos\Flow\Core\Bootstrap::run()
1 require("/Packages/Framework/Neos.Flow/Scripts/flow.php")

Anyone an idea on how to fix it?

Thank you, Jan

I did, just to make in run, two small changes in the temp files:

t/Packages/Libraries/neos/contentgraph-doctrinedbaladapter/src/DoctrineDbalContentGraphProjection.php

   private function whenNodePropertiesWereSet(NodePropertiesWereSet $event, EventEnvelope $eventEnvelope): void
    {
        $anchorPoint = $this->projectionContentGraph
            ->getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStream(
                $event->getNodeAggregateId(),
                $event->getOriginDimensionSpacePoint(),
                $event->getContentStreamId()
            );
        if (is_null($anchorPoint)) {
>>>                return;
        }
        $this->updateNodeRecordWithCopyOnWrite(
            $event->getContentStreamId(),
            $anchorPoint,
            function (NodeRecord $node) use ($event, $eventEnvelope) {
                $node->properties = $node->properties
                    ->merge($event->propertyValues)
                    ->unsetProperties($event->propertiesToUnset);
                $node->timestamps = $node->timestamps->with(
                    lastModified: $eventEnvelope->recordedAt,
                    originalLastModified: self::initiatingDateTime($eventEnvelope)
                );
            }
        );
    }

and in /Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_AssetUsage_CatchUpHook_AssetUsageCatchUpHook.php

private function removeNodes(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePointSet $dimensionSpacePoints): void
    {
        $contentGraph = $this->contentRepository->getContentGraph($workspaceName);

        foreach ($dimensionSpacePoints as $dimensionSpacePoint) {
            $subgraph = $contentGraph->getSubgraph($dimensionSpacePoint, VisibilityConstraints::withoutRestrictions());
            $node = $subgraph->findNodeById($nodeAggregateId);
            $descendants = $subgraph->findDescendantNodes($nodeAggregateId, FindDescendantNodesFilter::create());

            $nodes = array_merge([$node], iterator_to_array($descendants));

            /** @var Node $node */
            foreach ($nodes as $node) {
>>>             if (is_null($node)) continue;
                $this->assetUsageIndexingService->removeIndexForNode(
                    $this->contentRepository->id,
                    $node
                );
            }
        }
    }

Of course not a fix. Just way to continue testing :wink:

1 Like

Hi :wink: thanks for trying out our beta!

Have you applied the upgrade steps to beta 15 including: Neos 9 Beta-15 Release ?

# 0.) backup the events (cr_default_events) 
./flow migrateevents:backup
# 1.) mark dangling content streams as removed (temporary ones and ones that are no longer in use)
./flow contentStream:removeDangling
# 2.) prune removed content streams that are not required for a full replay to work
./flow contentStream:pruneRemovedFromEventStream
# 3.) replay all projections
./flow cr:projectionReplayAll

Yes, it’s the last step that crashed :wink:

./flow cr:projectionReplayAll

Quite interesting case,
The null check you introduced in the AssetUsageCatchUpHook should alone fix the issue?
Would be interesting if you could check if $node is already null here or if one of the $descendents was null. I assume $node is null, which would point to this bug: BUG: Structure adjustments "repaired" orphaned Nodes which is not replayable · Issue #5352 · neos/neos-development-collection · GitHub

as the asset usage for removedNodes is triggered before they are removed the error will happen here instead of the CR itself (as in the bug report).

The bug is closed as a fix has been comitted and will be part of a new beta later today.

This problem will be addressed with Neos 9 Beta 16 either by this: TASK: Improve removal of asset usages on node removal by dlubitz · Pull Request #5347 · neos/neos-development-collection · GitHub

Or the migrations to fix the events :slight_smile: (by fixing the order of the node removals)

Great. Now I’ve to find out which “subject” is an unauthenticated user in order to access my live workspace with beta 16 :wink:

Okay, I decided to wait for the release infos. Logging in to the backend works for me and afterwards my frontend displays the site, as I’m authenticated. But my backend throws a “Call to undefined method Neos\Neos\Domain\Service\WorkspaceService::getWorkspacePermissionsForUser()” - I’ll look into it in the evening :wink:

2 Likes

see Neos 9 Beta-16 Release

you need to adjust the workspace permissions :slight_smile:
And your Neos Ui was not on beta 16, now it is also tagged and should work.

Thank you:)

Thank you. It’s working now. The problem in removeNodes() seems to be resolved. The problem in whenNodePropertiesWereSet() still exists with my setup:

/Packages/Libraries/neos/contentrepository-core/Classes/ContentRepository.php: Exception while catching up to sequence number 218137: Cannot update node with copy on write since no anchor point could be resolved for node 5b686d29-c990-42bc-8d37-5bebf4512681 in content stream 5b40481f-8c5a-4fe5-965b-ceee3bfdf49c

13 Neos\ContentRepository\Core\Projection\CatchUp::run(Neos\EventStore\Helper\BatchEventStream)
12 Neos\ContentRepository\Core\ContentRepository::catchUpProjection("Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection", Neos\ContentRepository\Core\Projection\CatchUpOptions)
11 Neos\ContentRepositoryRegistry\Service\ProjectionService::replayAllProjections(Neos\ContentRepository\Core\Projection\CatchUpOptions, Closure)
10 Neos\ContentRepositoryRegistry\Command\CrCommandController_Original::projectionReplayAllCommand("default", false, false, 0)
9 Neos\Flow\Cli\CommandController_Original::callCommandMethod()
8 Neos\Flow\Cli\CommandController_Original::processRequest(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
7 Neos\Flow\Cli\Dispatcher_Original::dispatch(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
6 Neos\Flow\Cli\CommandRequestHandler::Neos\Flow\Cli\{closure}()
5 Closure::__invoke()
4 Neos\Flow\Security\Context_Original::withoutAuthorizationChecks(Closure)
3 Neos\Flow\Cli\CommandRequestHandler::handleRequest()
2 Neos\Flow\Core\Bootstrap::run()
1 require("/Packages/Framework/Neos.Flow/Scripts/flow.php")

Previous exception: Exception #1645303332 in line 224 of /Packages/Libraries/neos/contentgraph-doctrinedbaladapter/src/DoctrineDbalContentGraphProjection.php: Cannot update node with copy on write since no anchor point could be resolved for node 5b686d29-c990-42bc-8d37-5bebf4512681 in content stream 5b40481f-8c5a-4fe5-965b-ceee3bfdf49c

16 Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection::whenNodePropertiesWereSet(Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet, Neos\EventStore\Model\EventEnvelope)
15 Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection::apply(Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet, Neos\EventStore\Model\EventEnvelope)
14 Neos\ContentRepository\Core\ContentRepository::Neos\ContentRepository\Core\{closure}(Neos\EventStore\Model\EventEnvelope)
13 Neos\ContentRepository\Core\Projection\CatchUp::run(Neos\EventStore\Helper\BatchEventStream)
12 Neos\ContentRepository\Core\ContentRepository::catchUpProjection("Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjection", Neos\ContentRepository\Core\Projection\CatchUpOptions)
11 Neos\ContentRepositoryRegistry\Service\ProjectionService::replayAllProjections(Neos\ContentRepository\Core\Projection\CatchUpOptions, Closure)
10 Neos\ContentRepositoryRegistry\Command\CrCommandController_Original::projectionReplayAllCommand("default", false, false, 0)
9 Neos\Flow\Cli\CommandController_Original::callCommandMethod()
8 Neos\Flow\Cli\CommandController_Original::processRequest(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
7 Neos\Flow\Cli\Dispatcher_Original::dispatch(Neos\Flow\Cli\Request, Neos\Flow\Cli\Response)
6 Neos\Flow\Cli\CommandRequestHandler::Neos\Flow\Cli\{closure}()
5 Closure::__invoke()
4 Neos\Flow\Security\Context_Original::withoutAuthorizationChecks(Closure)
3 Neos\Flow\Cli\CommandRequestHandler::handleRequest()
2 Neos\Flow\Core\Bootstrap::run()
1 require("/Packages/Framework/Neos.Flow/Scripts/flow.php")


    [array] =>
        previousException:
        [string] => Exception #1645303332 in line 224 of /Packages/Libraries/neos/contentgraph-doctrinedbaladapter/src/DoctrineDbalContentGraphProjection.php: Cannot update node with copy on write since no anchor point could be resolved for node 5b686d29-c990-42bc-8d37-5bebf4512681 in content stream 5b40481f-8c5a-4fe5-965b-ceee3bfdf49c

Okay, when I try the same I did with beta 15 and do a replay, i get the following exception when requesting a page:

Exception #1599667143 in line 83 of /Packages/Application/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php: No matching node found for query "nodeAggregateId = :nodeAggregateId
                AND dimensionSpacePointHash = :dimensionSpacePointHash" with params {"nodeAggregateId":"f2e13251-6df5-4022-9a87-0c0478e46deb","dimensionSpacePointHash":"1041cc1fe1030c1a82ac24346f8c69a7"}

43 Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::fetchSingle("nodeAggregateId = :nodeAggregateId
               …dimensionSpacePointHash = :dimensionSpacePointHash", array|2|)
42 Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::getByIdAndDimensionSpacePointHash(NodeAggregateId|f2e13251-6df5-4022-9a87-0c0478e46deb|, "1041cc1fe1030c1a82ac24346f8c69a7")
41 Neos\Neos\FrontendRouting\NodeShortcutResolver_Original::resolveShortcutTarget(Neos\ContentRepository\Core\SharedModel\Node\NodeAddress)
40 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy::__call("resolveShortcutTarget", array|1|)
39 Neos\Neos\Controller\Frontend\NodeController_Original::handleShortcutNode(Neos\ContentRepository\Core\SharedModel\Node\NodeAddress)
38 Neos\Neos\Controller\Frontend\NodeController_Original::showAction("{"contentRepositoryId":"default","workspaceName":"…gregateId":"f2e13251-6df5-4022-9a87-0c0478e46deb"}")
37 Neos\Neos\Controller\Frontend\NodeController::showAction("{"contentRepositoryId":"default","workspaceName":"…gregateId":"f2e13251-6df5-4022-9a87-0c0478e46deb"}")
36 Neos\Neos\Controller\Frontend\NodeController::Flow_Aop_Proxy_invokeJoinPoint(Neos\Flow\Aop\JoinPoint)
35 Neos\Flow\Aop\Advice\AdviceChain::proceed(Neos\Flow\Aop\JoinPoint)
34 Neos\Flow\Security\Aspect\PolicyEnforcementAspect_Original::enforcePolicy(Neos\Flow\Aop\JoinPoint)
33 Neos\Flow\Aop\Advice\AroundAdvice::invoke(Neos\Flow\Aop\JoinPoint)
32 Neos\Flow\Aop\Advice\AdviceChain::proceed(Neos\Flow\Aop\JoinPoint)
31 Neos\Neos\Controller\Frontend\NodeController::showAction("{"contentRepositoryId":"default","workspaceName":"…gregateId":"f2e13251-6df5-4022-9a87-0c0478e46deb"}")
30 Neos\Flow\Mvc\Controller\ActionController_Original::callActionMethod(Neos\Flow\Mvc\ActionRequest, Neos\Flow\Mvc\Controller\Arguments, Neos\Flow\Mvc\ActionResponse)
29 Neos\Flow\Mvc\Controller\ActionController_Original::processRequest(Neos\Flow\Mvc\ActionRequest)
28 Neos\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(Neos\Flow\Mvc\ActionRequest)
27 Neos\Flow\Mvc\Dispatcher_Original::dispatch(Neos\Flow\Mvc\ActionRequest)
26 Neos\Flow\Mvc\DispatchMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
25 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
24 Neos\Flow\Http\Middleware\SecurityEntryPointMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
23 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
22 Neos\Flow\Http\Middleware\RequestBodyParsingMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
21 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
20 Neos\Flow\Mvc\FlashMessage\FlashMessageMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
19 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
18 Neos\Flow\Http\Middleware\PoweredByMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
17 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
16 Neos\Flow\Mvc\Routing\RoutingMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
15 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
14 Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
13 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
12 Neos\FluidAdaptor\Core\Widget\AjaxWidgetMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
11 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
10 Neos\Flow\Http\Middleware\SessionMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
9 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
8 Neos\Flow\Http\Middleware\MethodOverrideMiddleware::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
7 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
6 Neos\Flow\Http\Middleware\TrustedProxiesMiddleware_Original::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
5 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
4 Neos\Flow\Http\Middleware\StandardsComplianceMiddleware::process(GuzzleHttp\Psr7\ServerRequest, Neos\Flow\Http\Middleware\MiddlewaresChain)
3 Neos\Flow\Http\Middleware\MiddlewaresChain::handle(GuzzleHttp\Psr7\ServerRequest)
2 Neos\Flow\Http\RequestHandler::handleRequest()
1 Neos\Flow\Core\Bootstrap::run()

So I didn’t do a replay in the 2nd run…

Did you run

./flow migrateevents:reordernodeaggregatewasremoved

followed by a replay all?