Error 500 Internal Server Error

GET https://api.dev-aristotle.uplifted.net/estate-flow/sequence-timelines.json?modelEntityId=61&sequenceId=1

Exceptions

App\Uplifted\BaseBundle\Service\BaseEntityManager::find(): Argument #1 ($entityId) must be of type int, null given, called in /var/www/sites/integrated_wealth_api/trunk/src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php on line 360

Exception

TypeError

  1. * @param int $entityId
  2. *
  3. * @return object|null
  4. * @throws Exception
  5. */
  6. public function find(int $entityId)
  7. {
  8. // If the entity manager adds compulsory filters, or it defines it must find using enforced filters then run the
  9. // 'find' operation as a 'findBy id' one
  10. if (
  11. count($this->addCompulsoryFilters(array())) > 0 ||
  1. return 1;
  2. }
  3. try {
  4. // Try to fetch the real relationship entity
  5. $realRelationship = $this->relationshipManager->find($relationshipCache->id);
  6. if ($realRelationship === null) {
  7. return 1;
  8. }
EstateFlowEstateValueCalculator->getGratSpecialImpactMultiplierForFlow() in src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php (line 149)
  1. // Set limits to the ownershipMultiplier value - mirrors line 171
  2. $ownershipMultiplier = min(1, max(0, $ownershipMultiplier));
  3. // GRAT special impact multiplier - mirrors lines 173-179
  4. $gratSpecialImpactMultiplier = $this->getGratSpecialImpactMultiplierForFlow(
  5. $relationship,
  6. $existingRelationshipRoles
  7. );
  8. // Skip couple members if flag is set - mirrors lines 181-190
EstateFlowEstateValueCalculator->calculateEstateValueInfo() in src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php (line 269)
  1. EstateFlowModelEntityCache $modelEntityCache,
  2. EstateFlowCache $estateFlow
  3. ): array
  4. {
  5. // Get the estate value info for the model entity
  6. $modelEntityEstateValueInfo = $this->calculateEstateValueInfo(
  7. $modelEntityCache,
  8. $estateFlow
  9. );
  10. $relatedModelEntitiesEstateValueInfoHonoringDashboardVisibility = [];
EstateFlowEstateValueCalculator->getEstateStructureInfo() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 2513)
  1. ];
  2. return;
  3. }
  4. try {
  5. $estateValueInfo = $this->estateFlowEstateValueCalculator->getEstateStructureInfo(
  6. $modelEntity,
  7. $estateFlow
  8. );
  9. $modelEntity->estateValueInfo = json_decode(json_encode($estateValueInfo));
  10. } catch (\Exception $e) {
EstateFlowService->calculateAndSetEstateValue() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 2623)
  1. $entitiesToRecalculate = array_reverse($entitiesToRecalculate);
  2. foreach ($entitiesToRecalculate as $entityId) {
  3. $entity = $this->findLastModelEntityInstanceById($entityId, $estateFlow);
  4. if ($entity !== null) {
  5. $this->calculateAndSetEstateValue($entity, $estateFlow);
  6. }
  7. }
  8. }
  9. /**
EstateFlowService->recalculateEstateValueCascade() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 2656)
  1. }
  2. }
  3. // Trigger cascade recalculation for each affected entity
  4. foreach ($affectedEntities as $entity) {
  5. $this->recalculateEstateValueCascade($entity, $estateFlow);
  6. }
  7. }
  8. protected function addTimelineStrategyDynamicActionGroupTransition(
  9. $dynamicActionGroup,
EstateFlowService->recalculateEstateValueForAffectedEntities() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 3018)
  1. $this->doActionPostSrcApplicationCalculations($action, $estateFlow);
  2. $transition->appliedActions[] = $action;
  3. // Recalculate estate value for all affected entities after action is applied
  4. $this->recalculateEstateValueForAffectedEntities($action, $estateFlow);
  5. }
  6. private function setActionAvailableTargets($action, $transition, $estateFlow): void
  7. {
  8. $availableTargets = [];
EstateFlowService->applyAction() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 2912)
  1. }
  2. $this->addFirstModificationModelEntityHistoryEntry($action->src->modelEntity, $estateFlow);
  3. }
  4. if ($this->isImplementableAction($action, $estateFlow)) {
  5. $this->applyAction($action, $transition, $estateFlow);
  6. $action->isRelevant = $transition->perspectivePresentOnTriggers;
  7. $action->isRelevant = $action->isRelevant || $this->actionShouldBeShownOnFlow($action, $estateFlow);
  8. //$action->isRelevant = $action->isRelevant && ($this->isEstateFlowEntityRelatedToPerspective($action->src, $estateFlow) || $this->isActionTargetsRelatedToPerspective($action, $estateFlow));
EstateFlowService->applyTransitionAction() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 2887)
  1. $actions = $transition->actions;
  2. for ($i = 0; $i < count($transition->actions); $i++) {
  3. $action = $transition->actions[$i];
  4. $action->liveOrder = $i;
  5. $this->applyTransitionAction($action, $transition, $estateFlow);
  6. }
  7. }
  8. private function applyTransitionAction(EstateFlowActionCache $action, EstateFlowTransitionCache $transition, EstateFlowCache $estateFlow)
  9. {
EstateFlowService->applyTransitionActions() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 1076)
  1. // Mark extra info fro flow definition
  2. $this->setPerspectivePresentOnTransitionActivatedTriggers($transition, $estateFlow);
  3. // Apply transition actions
  4. $this->applyTransitionActions($transition, $estateFlow);
  5. if (count($transition->appliedActions) > 0) {
  6. // If transition has at least one action to show
  7. //if (array_filter($transition->appliedActions, fn($action) => $action->showOnFlow)) {
  8. // Add non affected perspective related entities
EstateFlowService->applyTransition() in src/AppBundle/Service/EstateFlow/EstateFlowService.php (line 348)
  1. }
  2. $this->loadEstateFlowEntitiesData($transitionsToApply, $estateFlow);
  3. foreach ($transitionsToApply as $transition) {
  4. $estateFlow->currentTransition = $transition;
  5. $this->applyTransition($transition, $estateFlow);
  6. }
  7. $this->addInitialGrowthState($estateFlow);
  8. // After all events loaded summarize total buckets
EstateFlowService->resolveEstateFlow() in src/AppBundle/Service/EstateFlowManager.php (line 216)
  1. $estateFlowResult = null;
  2. if ($ignoreCache || !isset($estateFlow) || $estateFlow->getStatus() != EstateFlow::STATUS_OK){
  3. $fromCache = 'false';
  4. // Resolve estate flow
  5. $estateFlowResult = $this->estateFlowService->resolveEstateFlow($modelEntityId, $sequenceId, $timelineId);
  6. // Set related data to estateFlow for refrresh indexing
  7. $relatedData = $this->getRelatedData($estateFlowResult);
  8. // Set estateFlow result to json}
  9. //$estateFlowResult = $this->breakCircularReferences($estateFlowResult);
  10. //var_dump('start serialize');
EstateFlowManager->resolveEstateFlow() in src/AppBundle/Service/EstateFlowManager.php (line 198)
  1. $estateFlows[] = json_encode($defaultEstateFlow->estateFlow);
  2. // Resolve each timeline in the sequence
  3. foreach ($sequence->getTimelines() as $timeline) {
  4. $timelineEstateFlow = $this->resolveEstateFlow($modelEntityId, $sequenceId, $timeline->getId());
  5. $estateFlows[] = json_encode($timelineEstateFlow->estateFlow);
  6. }
  7. return $estateFlows;
  8. }
EstateFlowManager->resolveSequenceEstateFlows() in src/AppBundle/Controller/EstateFlowController.php (line 146)
  1. ini_set('memory_limit', '512M');
  2. list($modelEntityId, $sequenceId) = $this->checkRequestAndResolveParameters($request);
  3. $response = new StreamedResponse(function() use ($modelEntityId, $sequenceId) {
  4. $estateFlows = $this->getEntityManager()->resolveSequenceEstateFlows($modelEntityId, $sequenceId);
  5. echo '[';
  6. $first = true;
  7. foreach ($estateFlows as $flow) {
  8. if (!$first) {
in vendor/symfony/http-kernel/HttpKernel.php -> {closure:App\AppBundle\Controller\EstateFlowController::getEstateFlowsForSequence():145} (line 101)
  1. $requestStack = $this->requestStack;
  2. $response->setCallback(static function () use ($request, $callback, $requestStack) {
  3. $requestStack->push($request);
  4. try {
  5. $callback();
  6. } finally {
  7. $requestStack->pop();
  8. }
  9. });
  10. }
in vendor/symfony/http-foundation/StreamedResponse.php :: {closure:Symfony\Component\HttpKernel\HttpKernel::handle():98} (line 125)
  1. if (!isset($this->callback)) {
  2. throw new \LogicException('The Response callback must be set.');
  3. }
  4. ($this->callback)();
  5. return $this;
  6. }
  7. /**
  1. * @return $this
  2. */
  3. public function send(bool $flush = true): static
  4. {
  5. $this->sendHeaders();
  6. $this->sendContent();
  7. if (!$flush) {
  8. return $this;
  9. }
  1. public function run(): int
  2. {
  3. $response = $this->kernel->handle($this->request);
  4. if (Kernel::VERSION_ID >= 60400) {
  5. $response->send(false);
  6. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
  7. fastcgi_finish_request();
  8. } elseif (\function_exists('litespeed_finish_request') && !$this->debug) {
  9. litespeed_finish_request();
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/sites/integrated_wealth_api/trunk/vendor/autoload_runtime.php') in web/index.php (line 12)
  1. if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
  2. header('Access-Control-Max-Age: 3600', true);
  3. exit(0);
  4. }
  5. require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
  6. return function (array $context) {
  7. // Enable debug mode if configured
  8. if ((bool) $context['APP_DEBUG']) {

Logs

Level Channel Message
DEBUG 09:28:46 event Notified event "debug.security.authorization.vote" to listener "Symfony\Bundle\SecurityBundle\EventListener\VoteListener::onVoterVote".
{
    "event": "debug.security.authorization.vote",
    "listener": "Symfony\\Bundle\\SecurityBundle\\EventListener\\VoteListener::onVoterVote"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\DebugHandlersListener::configure"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "FOS\RestBundle\EventListener\MimeTypeListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "FOS\\RestBundle\\EventListener\\MimeTypeListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Bridge\Doctrine\Middleware\IdleConnection\Listener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bridge\\Doctrine\\Middleware\\IdleConnection\\Listener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\SessionListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::setDefaultLocale".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::setDefaultLocale"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\FragmentListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "FOS\RestBundle\EventListener\FormatListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "FOS\\RestBundle\\EventListener\\FormatListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\RouterListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleAwareListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\LocaleAwareListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "FOS\RestBundle\EventListener\BodyListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "FOS\\RestBundle\\EventListener\\BodyListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::configureLogoutUrlGenerator".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::configureLogoutUrlGenerator"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "Symfony\\Bundle\\SecurityBundle\\Debug\\TraceableFirewallListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.request" to listener "App\Uplifted\BaseBundle\EventListener\UserEnabledListener::onKernelRequest".
{
    "event": "kernel.request",
    "listener": "App\\Uplifted\\BaseBundle\\EventListener\\UserEnabledListener::onKernelRequest"
}
DEBUG 09:28:46 event Notified event "kernel.controller" to listener "FOS\RestBundle\EventListener\ParamFetcherListener::onKernelController".
{
    "event": "kernel.controller",
    "listener": "FOS\\RestBundle\\EventListener\\ParamFetcherListener::onKernelController"
}
DEBUG 09:28:46 event Notified event "kernel.controller" to listener "App\AppBundle\EventListener\LoggerRequestResponseListener::onKernelController".
{
    "event": "kernel.controller",
    "listener": "App\\AppBundle\\EventListener\\LoggerRequestResponseListener::onKernelController"
}
DEBUG 09:28:46 event Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RouterDataCollector::onKernelController"
}
DEBUG 09:28:46 event Notified event "kernel.controller" to listener "FOS\RestBundle\EventListener\ViewResponseListener::onKernelController".
{
    "event": "kernel.controller",
    "listener": "FOS\\RestBundle\\EventListener\\ViewResponseListener::onKernelController"
}
DEBUG 09:28:46 event Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController".
{
    "event": "kernel.controller",
    "listener": "Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector::onKernelController"
}
DEBUG 09:28:46 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\IsSignatureValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\IsSignatureValidAttributeListener::onKernelControllerArguments"
}
DEBUG 09:28:46 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsCsrfTokenValidAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsCsrfTokenValidAttributeListener::onKernelControllerArguments"
}
DEBUG 09:28:46 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\Security\Http\EventListener\IsGrantedAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\Security\\Http\\EventListener\\IsGrantedAttributeListener::onKernelControllerArguments"
}
DEBUG 09:28:46 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\CacheAttributeListener::onKernelControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\CacheAttributeListener::onKernelControllerArguments"
}
DEBUG 09:28:46 event Notified event "kernel.controller_arguments" to listener "Symfony\Component\HttpKernel\EventListener\ErrorListener::onControllerArguments".
{
    "event": "kernel.controller_arguments",
    "listener": "Symfony\\Component\\HttpKernel\\EventListener\\ErrorListener::onControllerArguments"
}

Stack Trace

TypeError
TypeError:
App\Uplifted\BaseBundle\Service\BaseEntityManager::find(): Argument #1 ($entityId) must be of type int, null given, called in /var/www/sites/integrated_wealth_api/trunk/src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php on line 360

  at src/Uplifted/BaseBundle/Service/BaseEntityManager.php:686
  at App\Uplifted\BaseBundle\Service\BaseEntityManager->find()
     (src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php:360)
  at App\AppBundle\Service\EstateFlow\EstateFlowEstateValueCalculator->getGratSpecialImpactMultiplierForFlow()
     (src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php:149)
  at App\AppBundle\Service\EstateFlow\EstateFlowEstateValueCalculator->calculateEstateValueInfo()
     (src/AppBundle/Service/EstateFlow/EstateFlowEstateValueCalculator.php:269)
  at App\AppBundle\Service\EstateFlow\EstateFlowEstateValueCalculator->getEstateStructureInfo()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:2513)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->calculateAndSetEstateValue()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:2623)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->recalculateEstateValueCascade()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:2656)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->recalculateEstateValueForAffectedEntities()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:3018)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->applyAction()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:2912)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->applyTransitionAction()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:2887)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->applyTransitionActions()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:1076)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->applyTransition()
     (src/AppBundle/Service/EstateFlow/EstateFlowService.php:348)
  at App\AppBundle\Service\EstateFlow\EstateFlowService->resolveEstateFlow()
     (src/AppBundle/Service/EstateFlowManager.php:216)
  at App\AppBundle\Service\EstateFlowManager->resolveEstateFlow()
     (src/AppBundle/Service/EstateFlowManager.php:198)
  at App\AppBundle\Service\EstateFlowManager->resolveSequenceEstateFlows()
     (src/AppBundle/Controller/EstateFlowController.php:146)
  at App\AppBundle\Controller\EstateFlowController->{closure:App\AppBundle\Controller\EstateFlowController::getEstateFlowsForSequence():145}()
     (vendor/symfony/http-kernel/HttpKernel.php:101)
  at Symfony\Component\HttpKernel\HttpKernel::{closure:Symfony\Component\HttpKernel\HttpKernel::handle():98}()
     (vendor/symfony/http-foundation/StreamedResponse.php:125)
  at Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
     (vendor/symfony/http-foundation/Response.php:403)
  at Symfony\Component\HttpFoundation\Response->send()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:38)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:32)
  at require_once('/var/www/sites/integrated_wealth_api/trunk/vendor/autoload_runtime.php')
     (web/index.php:12)