Problem with Neos 4.2 when creating new package?

Hi,
I have just installed Neos 4.2, and tried to set it up on a new server (also tried on an “old” server - but with same result).
I can create a new site with the demo-package, but if I want to set up a new blank site, I’m getting a huge error-message.
Does I doing something wrong? Or have I found a bug? :slight_smile:
//Anders

The error-message:

Notice: Undefined index: myown/code in /var/www/Neos/Packages/Framework/Neos.Flow/Classes/Package/PackageManager.php line 386
Exception Code	1
Exception Type	Neos\Flow\Error\Exception
Log Reference	20181210205725a4bcc4
Thrown in File	Packages/Framework/Neos.Flow/Classes/Error/ErrorHandler.php
Line	81

    Neos\Flow\Error\ErrorHandler::handleError(8, "Undefined index: myown/code", "/var/www/Neos/Packages/Framework/Neos.Flow/Classes/Package/PackageManager.php", 386, array|9|)

    Packages/Framework/Neos.Flow/Classes/Package/PackageManager.php

    00384:         $refreshedPackageStatesConfiguration = $this->rescanPackages();

    00385:         $this->packageStatesConfiguration = $refreshedPackageStatesConfiguration;

    00386:         $this->registerPackageFromStateConfiguration($manifest['name'], $this->packageStatesConfiguration['packages'][$manifest['name']]);

    00387:         $package = $this->packages[$packageKey];

    00388:         if ($package instanceof FlowPackageInterface) {

    Neos\Flow\Package\PackageManager::createPackage("myown.code", array|7|)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_SiteKickstarter_Service_GeneratorService.php
    Original File: Packages/Application/Neos.SiteKickstarter/Classes/Service/GeneratorService.php

    00045:     {

    00046:         $this->packageManager->createPackage($packageKey, [

    00047:             'type' => 'neos-site',

    00048:             "require" => [

    00049:                 "neos/neos" => "*",

    Neos\SiteKickstarter\Service\GeneratorService_Original::generateSitePackage("myown.code", "mydemosite.tst")

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_Setup_Step_SiteImportStep.php
    Original File: Packages/Application/Neos.Neos/Classes/Setup/Step/SiteImportStep.php

    00245: 

    00246:             $generatorService = $this->objectManager->get(GeneratorService::class);

    00247:             $generatorService->generateSitePackage($packageKey, $siteName);

    00248:         } elseif (!empty($formValues['site'])) {

    00249:             $packageKey = $formValues['site'];

    Neos\Neos\Setup\Step\SiteImportStep_Original::importSite(Neos\Form\Core\Model\FinisherContext)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Neos_Setup_Step_SiteImportStep.php
    Original File: Packages/Application/Neos.Neos/Classes/Setup/Step/SiteImportStep.php

    00211:         $step = $this;

    00212:         $callback = function (FinisherContext $finisherContext) use ($step) {

    00213:             $step->importSite($finisherContext);

    00214:         };

    00215:         $this->closureFinisher = new ClosureFinisher();

    Neos\Neos\Setup\Step\SiteImportStep_Original::Neos\Neos\Setup\Step\{closure}(Neos\Form\Core\Model\FinisherContext)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Form_Finishers_ClosureFinisher.php
    Original File: Packages/Application/Neos.Form/Classes/Finishers/ClosureFinisher.php

    00054:             throw new FinisherException(sprintf('The option "closure" must be of type Closure, "%s" given.', gettype($closure)), 1332155239);

    00055:         }

    00056:         $closure($this->finisherContext);

    00057:     }

    00058: }

    Neos\Form\Finishers\ClosureFinisher_Original::executeInternal()

    Packages/Application/Neos.Form/Classes/Core/Model/AbstractFinisher.php

    00079:     {

    00080:         $this->finisherContext = $finisherContext;

    00081:         $this->executeInternal();

    00082:     }

    00083: 

    Neos\Form\Core\Model\AbstractFinisher::execute(Neos\Form\Core\Model\FinisherContext)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Form_Core_Runtime_FormRuntime.php
    Original File: Packages/Application/Neos.Form/Classes/Core/Runtime/FormRuntime.php

    00376:         $finisherContext = new FinisherContext($this);

    00377:         foreach ($this->formDefinition->getFinishers() as $finisher) {

    00378:             $finisher->execute($finisherContext);

    00379:             if ($finisherContext->isCancelled()) {

    00380:                 break;

    Neos\Form\Core\Runtime\FormRuntime_Original::invokeFinishers()

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Form_Core_Runtime_FormRuntime.php
    Original File: Packages/Application/Neos.Form/Classes/Core/Runtime/FormRuntime.php

    00338:     {

    00339:         if ($this->isAfterLastPage()) {

    00340:             $this->invokeFinishers();

    00341:             $parentResponse = $this->response->getParentResponse();

    00342:             if ($parentResponse !== null) {

    Neos\Form\Core\Runtime\FormRuntime_Original::render()

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Setup_Controller_SetupController.php
    Original File: Packages/Application/Neos.Setup/Classes/Controller/SetupController.php

    00087: 

    00088:         try {

    00089:             $renderedForm = $form->render();

    00090:         } catch (\Neos\Setup\Exception $exception) {

    00091:             $this->addFlashMessage($exception->getMessage(), 'Exception while executing setup step', \Neos\Error\Messages\Message::SEVERITY_ERROR);

    Neos\Setup\Controller\SetupController_Original::indexAction(3)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Setup_Controller_SetupController.php
    Original File: Packages/Application/Neos.Setup/Classes/Controller/SetupController.php

    00283: 

    00284:         if (isset($this->Flow_Aop_Proxy_methodIsInAdviceMode['indexAction'])) {

    00285:             $result = parent::indexAction($step);

    00286: 

    00287:         } else {

    Neos\Setup\Controller\SetupController::indexAction(3)

    call_user_func_array(array|2|, array|1|)

    Packages/Framework/Neos.Flow/Classes/Aop/AdvicesTrait.php

    00054:         }

    00055:         if (isset($this->Flow_Aop_Proxy_methodIsInAdviceMode[$joinPoint->getMethodName()])) {

    00056:             return call_user_func_array(['self', $joinPoint->getMethodName()], $joinPoint->getMethodArguments());

    00057:         }

    00058:     }

    Neos\Setup\Controller\SetupController::Flow_Aop_Proxy_invokeJoinPoint(Neos\Flow\Aop\JoinPoint)

    Packages/Framework/Neos.Flow/Classes/Aop/Advice/AdviceChain.php

    00057:             $result = $this->advices[$this->adviceIndex]->invoke($joinPoint);

    00058:         } else {

    00059:             $result = $joinPoint->getProxy()->Flow_Aop_Proxy_invokeJoinpoint($joinPoint);

    00060:         }

    00061:         return $result;

    Neos\Flow\Aop\Advice\AdviceChain::proceed(Neos\Flow\Aop\JoinPoint)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Security_Aspect_PolicyEnforcementAspect.php
    Original File: Packages/Framework/Neos.Flow/Classes/Security/Aspect/PolicyEnforcementAspect.php

    00063:         }

    00064: 

    00065:         return $joinPoint->getAdviceChain()->proceed($joinPoint);

    00066:     }

    00067: }

    Neos\Flow\Security\Aspect\PolicyEnforcementAspect_Original::enforcePolicy(Neos\Flow\Aop\JoinPoint)

    Packages/Framework/Neos.Flow/Classes/Aop/Advice/AroundAdvice.php

    00033:         $adviceObject = $this->objectManager->get($this->aspectObjectName);

    00034:         $methodName = $this->adviceMethodName;

    00035:         return $adviceObject->$methodName($joinPoint);

    00036:     }

    00037: }

    Neos\Flow\Aop\Advice\AroundAdvice::invoke(Neos\Flow\Aop\JoinPoint)

    Packages/Framework/Neos.Flow/Classes/Aop/Advice/AdviceChain.php

    00055:         $this->adviceIndex++;

    00056:         if ($this->adviceIndex < count($this->advices)) {

    00057:             $result = $this->advices[$this->adviceIndex]->invoke($joinPoint);

    00058:         } else {

    00059:             $result = $joinPoint->getProxy()->Flow_Aop_Proxy_invokeJoinpoint($joinPoint);

    Neos\Flow\Aop\Advice\AdviceChain::proceed(Neos\Flow\Aop\JoinPoint)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Setup_Controller_SetupController.php
    Original File: Packages/Application/Neos.Setup/Classes/Controller/SetupController.php

    00297:                 $adviceChain->rewind();

    00298:                 $joinPoint = new \Neos\Flow\Aop\JoinPoint($this, 'Neos\Setup\Controller\SetupController', 'indexAction', $methodArguments, $adviceChain);

    00299:                 $result = $adviceChain->proceed($joinPoint);

    00300:                 $methodArguments = $joinPoint->getMethodArguments();

    00301: 

    Neos\Setup\Controller\SetupController::indexAction(3)

    call_user_func_array(array|2|, array|1|)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Controller_ActionController.php
    Original File: Packages/Framework/Neos.Flow/Classes/Mvc/Controller/ActionController.php

    00459: 

    00460:         if (!$validationResult->hasErrors()) {

    00461:             $actionResult = call_user_func_array([$this, $this->actionMethodName], $preparedArguments);

    00462:         } else {

    00463:             $actionIgnoredArguments = static::getActionIgnoredValidationArguments($this->objectManager);

    Neos\Flow\Mvc\Controller\ActionController_Original::callActionMethod()

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Controller_ActionController.php
    Original File: Packages/Framework/Neos.Flow/Classes/Mvc/Controller/ActionController.php

    00213:         }

    00214: 

    00215:         $this->callActionMethod();

    00216:     }

    00217: 

    Neos\Flow\Mvc\Controller\ActionController_Original::processRequest(Neos\Flow\Mvc\ActionRequest, Neos\Flow\Http\Response)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Dispatcher.php
    Original File: Packages/Framework/Neos.Flow/Classes/Mvc/Dispatcher.php

    00143:             try {

    00144:                 $this->emitBeforeControllerInvocation($request, $response, $controller);

    00145:                 $controller->processRequest($request, $response);

    00146:                 $this->emitAfterControllerInvocation($request, $response, $controller);

    00147:             } catch (StopActionException $exception) {

    Neos\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(Neos\Flow\Mvc\ActionRequest, Neos\Flow\Http\Response)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_Dispatcher.php
    Original File: Packages/Framework/Neos.Flow/Classes/Mvc/Dispatcher.php

    00096:             /** @var ActionRequest $request */

    00097:             $firewall->blockIllegalRequests($request);

    00098:             $this->initiateDispatchLoop($request, $response);

    00099:         } catch (AuthenticationRequiredException $exception) {

    00100:             $entryPointFound = false;

    Neos\Flow\Mvc\Dispatcher_Original::dispatch(Neos\Flow\Mvc\ActionRequest, Neos\Flow\Http\Response)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Mvc_DispatchComponent.php
    Original File: Packages/Framework/Neos.Flow/Classes/Mvc/DispatchComponent.php

    00078:         $actionRequest = $componentContext->getParameter(DispatchComponent::class, 'actionRequest');

    00079:         $this->setDefaultControllerAndActionNameIfNoneSpecified($actionRequest);

    00080:         $this->dispatcher->dispatch($actionRequest, $componentContext->getHttpResponse());

    00081:     }

    00082: 

    Neos\Flow\Mvc\DispatchComponent_Original::handle(Neos\Flow\Http\Component\ComponentContext)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Http_Component_ComponentChain.php
    Original File: Packages/Framework/Neos.Flow/Classes/Http/Component/ComponentChain.php

    00059:                 continue;

    00060:             }

    00061:             $component->handle($componentContext);

    00062:             $this->response = $componentContext->getHttpResponse();

    00063:             if ($componentContext->getParameter(ComponentChain::class, 'cancel') === true) {

    Neos\Flow\Http\Component\ComponentChain_Original::handle(Neos\Flow\Http\Component\ComponentContext)

    Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Neos_Flow_Http_Component_ComponentChain.php
    Original File: Packages/Framework/Neos.Flow/Classes/Http/Component/ComponentChain.php

    00059:                 continue;

    00060:             }

    00061:             $component->handle($componentContext);

    00062:             $this->response = $componentContext->getHttpResponse();

    00063:             if ($componentContext->getParameter(ComponentChain::class, 'cancel') === true) {

    Neos\Flow\Http\Component\ComponentChain_Original::handle(Neos\Flow\Http\Component\ComponentContext)

    Packages/Application/Neos.Setup/Classes/Core/RequestHandler.php

    00074: 

    00075:         $componentContext = new ComponentContext($this->request, $this->response);

    00076:         $this->baseComponentChain->handle($componentContext);

    00077: 

    00078:         $this->baseComponentChain->getResponse()->send();

    Neos\Setup\Core\RequestHandler::handleRequest()

    Packages/Framework/Neos.Flow/Classes/Core/Bootstrap.php

    00109: 

    00110:         $this->activeRequestHandler = $this->resolveRequestHandler();

    00111:         $this->activeRequestHandler->handleRequest();

    00112:     }

    00113: 

    Neos\Flow\Core\Bootstrap::run()

    Web/index.php

    00025: $context = \Neos\Flow\Core\Bootstrap::getEnvironmentConfigurationSetting('FLOW_CONTEXT') ?: 'Development';

    00026: $bootstrap = new \Neos\Flow\Core\Bootstrap($context, $composerAutoloader);

    00027: $bootstrap->run();


Instance root	/var/www/Neos/
Application Context	Development
Request Handler	Neos\Setup\Core\RequestHandler

How did you run into this, Web-setup or cli? At which action did this occur exactly?

This maybe caused by a setup issue or the change in package-create that tries to use local distributionPackage folders.

I’m having this error as last step in the setup-wizard, where I can create a new blank site (or install the demo package).

I’m also getting the error, if I’m setting up the new installation of Neos with the demo-package, and then trying to create a new site-package from the “Administration/Sites Management” (in the web - not CLI).
…/neos/administration/sites/newsite.html

//Anders

Will test this the next days probably you found a bug. Did you try to kickstart the site from the cli?

I did try to use the cli and ./flow, but I’m not that familiar with flow (no problem with shell and Linux in general), so I didn’t succeed to create a new site… :confused:

@kongsted I tried to reproduce your problem but could not. I think we are looking at a problem specific to your setup and it would be great if you could help us understanding the issue.

My current suspicion is that the underlying reason for your problem is that Neos 4.2 comes with DistributionPackages Folder by default and new Packages are created in there. See this blogpost for background https://www.neos.io/blog/project-repository-best-practice.html

I have some questions regarding your setup:

  1. Which os do you have
  2. Do you have the command composer on the cli available or do you use another command like composer.phar
  3. Which version of composer do you have

If my suspicion is right you can solve this locally by removing the following section from the composer.yaml

,
"repositories": {
   "distributionPackages":&#32;{
      "type": "path",
      "url": "./DistributionPackages/*"
    }
}

After that “composer update” and test setup again. In that case either the DistributionPackages folder did not work or the “composer require” call that is used after a new Package in DistributionPackages was created failed.

@martoro, A coleague of mine just had the same problem when trying to create a package based on a fresh installed Flow base distribution. The repositories section is missing here. https://github.com/neos/flow-base-distribution/pull/9

But IMHO we need to fix that in principle, because every upgraded project without the DistributionPackages approach and configuration is failing to create new packages now.

2 Likes

An small update (with not much news to tell).
Just tried to wipe my installation totally, and download Neos again from scratch. Nothing has changed.
I have also tried to create the package and site from the console, and it sort of goes well. I can create both a package and a site, but for some strange reason, I’m ending up with a package there’s not working.

Maybe I’m doing something wrong - I don’t know… The guides for Neos-noobs is “a little limited”… :expressionless:
(I can easily install the demo-package, but if I want to take the next step and have a new site from scratch, the learning-curve is not only steep - it’s as close to vertical as it can be… :slight_smile: )

2 Likes

Hello all!
Today I’ve installed Neos on an intranet server and got the decribed exception too.
From new created dir /var/www/neos.blank.2019 I’ve startet composer by

composer create-project neos/neos-base-distribution .

All went fine and after creating a vhost, setting “core:setfilepermissions” and calling http://neos-blank.local/ I stuck into Step 4 by creating new site package.
First exception was this one:

Warning: mkdir(): permission denied in /var/www/neos.blank.2019/Packages/Librairies/noes/uitlity-files/Files.php line 251 [...] mkdir("/var/www/neos.blank.2019/./DistributionPackages/fsix.neosblank/, 511, true)

Fortunately I logged all and see composer has created the dirctory with

drwxrwxr-x 2 frank frank 4096 Dez 7 15:17 DistributionPackages

(strange date, isn’t it?)

A “chmod 0777” fixes this exception but now I get the same exption as reported from kongsted

composer.json is as it should be…

Try to do a “package:rescan” as I know from flow development does not help.
An other “core:setfilepermissions” does not help too.
I leave this installation in this state. Maybe I can check some other points for solve this issue…

Hello, your suspicions are still valid even for Neos 4.3.3. Removing “repositories” section from composer.json allows creating sites and site-packages during neos/setup.