[SOLVED] Setting up a new site leads to a 500 internal server error

My environment:
Provider: DomainFactory
PHP: 7.0.13
Neos CMS LTS Version 2.3.8

The installation was successful and I was able to call the url with Demo page.

I removed the Demo site and the package Neos.Demo. Later on I created a new page:

./flow site:prune
./flow package:delete Neos.Demo
./flow kickstart:site MY.Seiten mysite.de
./flow site:import MY.Seiten

Further I executed following commands:

./flow resource:clean
./flow resource:publish
./flow node:repair
./flow flow:cache:flush --force

All these commands were done without any errors or important hints. Unfortunately I always got an 500 internal server errro. The exception is telling that the package Neos.Demo is missing. This is true. I deleted it before and this was my intention. What was going wrong?
Thanks for your hints.

Here you can find the exception log file:

Exception #1297759968: Exception while property mapping for target type "TYPO3\TYPO3CR\Domain\Model    \NodeInterface", at property path "": Invalid resource URI  "resource://Neos.Demo/Public/NodeTypes/Thumbnails/Homepage.png": Package "Neos.Demo" is not available.

13 TYPO3\Flow\Property\PropertyMapper_Original::convert("/sites/neosdemo@live;language=en_US",     "TYPO3\TYPO3CR\Domain\Model\NodeInterface", TYPO3\Flow\Mvc\Controller\MvcPropertyMappingConfiguration)
12 call_user_func_array(array|2|, array|3|)
11 TYPO3\Flow\Object\DependencyInjection\DependencyProxy::__call("convert", array|3|)
10 TYPO3\Flow\Mvc\Controller\Argument_Original::setValue("/sites/neosdemo@live;language=en_US")
9 TYPO3\Flow\Mvc\Controller\AbstractController_Original::mapRequestArgumentsToControllerArguments()
8 TYPO3\Flow\Mvc\Controller\ActionController_Original::processRequest(TYPO3\Flow\Mvc\ActionRequest,    TYPO3\Flow\Http\Response)
7 TYPO3\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow    \Http\Response)
6 TYPO3\Flow\Mvc\Dispatcher_Original::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http    \Response)
5 TYPO3\Flow\Mvc\DispatchComponent_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
4 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component    \ComponentContext)
3 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component    \ComponentContext)
2 TYPO3\Flow\Http\RequestHandler::handleRequest()
1 TYPO3\Flow\Core\Bootstrap::run()

One more thing you can do is to remove the File Configuration/PackageStates.php. This file is a cache of all the packages available. Hope it helps :thumbsup:

Thanks for your quick reply.
I removed this file. But unfortunately it doesn’t help. I got the same exception and the file was generated again. In this file Configuration/PackageStates.php I haven’t found an entry like ‘Neos.Demo’.

Do you use resource://Neos.Demo/Public/NodeTypes/Thumbnails/Homepage.png as templatePath in one of your fusion files? Or does one of your NodeTypes in the NodeTypes.yaml files start with Neos.Demo:...? If so, please change them to the current package name as Neos will try to search for a template in a Neos.Demo Package (which doesn’t exist any more).

No, I haven’t used this resource in my package. When I search for the string “Neos.Demo” in my package I found nothing:

$ cd Packages/Sites/MY.Seiten
$ grep -r -i ‘Neos.Demo’ ./
$

When I search for “My.Seiten” I got several hits:

$ grep -r -i 'MY.Seiten' ./
./composer.json:    "name": "my/seiten",
./composer.json:            "package-key": "MY.Seiten"
./Resources/Private/Content/Sites.xml: <site name="mysite.de" state="1" siteResourcesPackageKey="MY.Seiten" siteNodeName="seiten">
./Resources/Private/TypoScript/Root.ts2:           templatePath = 'resource://MY.Seiten/Private/Templates/Page/Default.html'
./Resources/Private/TypoScript/Root.ts2:           templatePath = 'resource://MY.Seiten/Private/Templates/Page/Default.html'
./Resources/Private/TypoScript/Root.ts2:           templatePath = 'resource://MY.Seiten/Private/Templates/Page/Default.html'
./Resources/Private/TypoScript/Root.ts2:           templatePath = 'resource://MY.Seiten/Private/Templates/Page/Default.html'
$

I 'm sure something is wrong with the database. But I haven’t any clue how can I solve it.

I have still the same problem. I am not able to create a (empty) site using Neos CMS LTS Version 2.3.8 at Domain-Factory. Can someone help?

Meanwhile I tried another way to get a working Neos. I drop all tables from the database and afterwards I executed the following command:

$ ./flow doctrine:migrate

I got an exception:

Exception #1355480641 in line 137 of /kunden/xxxxx_xxxxx/Neos/neoscms/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/TYPO3_Setup_Step_DatabaseStep.php
: Failed loading /usr/local/php5/ZendOptimizer.so:  /usr/local/php5/ZendOptimizer.so: undefined symbol: zend_opcode_handlers
Fatal error: Cannot use $this as parameter in /kunden/xxxxx_xxxxx/Neos/neoscms/Packages/Libraries/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/Eval
uatingGeneratorStrategy.php(68) : eval()'d code on line 340
27 TYPO3\Flow\Core\Booting\Scripts::executeCommand("typo3.flow:doctrine:migrate", array|18|, FALSE)
26 TYPO3\Setup\Step\DatabaseStep_Original::postProcessFormValues(array|8|)
25 TYPO3\Setup\Controller\SetupController_Original::postProcessStep(array|8|, TYPO3\Setup\Step\DatabaseStep)
24 TYPO3\Setup\Controller\SetupController_Original::TYPO3\Setup\Controller\{closure}(TYPO3\Form\Core\Model\FinisherContext)
23 TYPO3\Form\Finishers\ClosureFinisher_Original::executeInternal()
22 TYPO3\Form\Core\Model\AbstractFinisher::execute(TYPO3\Form\Core\Model\FinisherContext)
21 TYPO3\Form\Core\Runtime\FormRuntime_Original::invokeFinishers()
20 TYPO3\Form\Core\Runtime\FormRuntime_Original::render()
19 TYPO3\Setup\Controller\SetupController_Original::indexAction(1)
18 TYPO3\Setup\Controller\SetupController::indexAction(1)
17 call_user_func_array(array|2|, array|1|)
16 TYPO3\Setup\Controller\SetupController::Flow_Aop_Proxy_invokeJoinPoint(TYPO3\Flow\Aop\JoinPoint)
15 TYPO3\Flow\Aop\Advice\AdviceChain::proceed(TYPO3\Flow\Aop\JoinPoint)
14 TYPO3\Flow\Security\Aspect\PolicyEnforcementAspect_Original::enforcePolicy(TYPO3\Flow\Aop\JoinPoint)
13 TYPO3\Flow\Aop\Advice\AroundAdvice::invoke(TYPO3\Flow\Aop\JoinPoint)
12 TYPO3\Flow\Aop\Advice\AdviceChain::proceed(TYPO3\Flow\Aop\JoinPoint)
11 TYPO3\Setup\Controller\SetupController::indexAction(1)
10 call_user_func_array(array|2|, array|1|)
9 TYPO3\Flow\Mvc\Controller\ActionController_Original::callActionMethod()
8 TYPO3\Flow\Mvc\Controller\ActionController_Original::processRequest(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
7 TYPO3\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
6 TYPO3\Flow\Mvc\Dispatcher_Original::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
5 TYPO3\Flow\Mvc\DispatchComponent_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
4 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
3 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
2 TYPO3\Setup\Core\RequestHandler::handleRequest()
1 TYPO3\Flow\Core\Bootstrap::run()

The same exception was thrown when I tried to call the setup using webinterface. Only the table “flow_doctrine_migrationstatus” was created after executing the setup or the migration command.
Any help would be appreciated.

It seems nobody can help me.
I have asked the support of the provider DomainFactory regarding the failed loading of ZendOptimizer. They told me I should create a special php.ini for the domain and drop the entry for the Zendoptimizer.


I did it and now I got the same exception but without an additional exception log file. Again: I deleted all tables from the database and on the next step I executed the following command which was canceled with a fatal error :

$ ./flow doctrine:migrate
Fatal error: Cannot use $this as parameter in /kunden/xxxxx_xxxxx/Neos/neoscms/Packages/Libraries/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(68) : eval()'d code on line 340

Is anybody here who has an idea how I can solve this problem?

How did you install Neos on the server?

I think this error comes from you having a different version of PHP on the system composer install was executed and this system…

Hi Christian, maybe you are right. Actually I did not know it. The provider DomainFactory has offered a pre-installed version Neos CMS LTS Version 2.3.8 which I have selected.
After the installation the Neos.Demo package was available and working. Up to now I was not able to create a new package or site.

I am pretty sure it’s something about the PHP version. What does php -v say and can you find out what version of the ocramius/proxy-manager is installed?

The version of php-cli is pretty old:

$ php -v
PHP 4.4.9 (cgi) (built: Jan 29 2015 09:34:44)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

When I call php7 I get the version 7.0.20:

$ php7 -v
PHP 7.0.20 (cgi-fcgi) (built: Jun 23 2017 09:43:50)
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
(14:13:33) [Neos]

But php version which I use for the domain is 7.0.20


The changelog Packages/Libraries/ocramius/proxy-manager/CHANGELOG.md is telling me that the version 2.0.1 has been installed.
Using the mydomain.de/setup I am able to perform the first steps before I get still the same exception:

Exception #1355480641 in line 137 of /kunden/xxxxx_xxxxx/Neos/neoscms/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/TYPO3_Setup_Step_DatabaseStep.php:
Fatal error: Cannot use $this as parameter in /kunden/xxxxx_xxxxx/Neos/neoscms/Packages/Libraries/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(68) : eval()'d code on line 340
27 TYPO3\Flow\Core\Booting\Scripts::executeCommand("typo3.flow:doctrine:migrate", array|18|, FALSE)
26 TYPO3\Setup\Step\DatabaseStep_Original::postProcessFormValues(array|8|)
25 TYPO3\Setup\Controller\SetupController_Original::postProcessStep(array|8|, TYPO3\Setup\Step\DatabaseStep)
24 TYPO3\Setup\Controller\SetupController_Original::TYPO3\Setup\Controller\{closure}(TYPO3\Form\Core\Model\FinisherContext)
23 TYPO3\Form\Finishers\ClosureFinisher_Original::executeInternal()
22 TYPO3\Form\Core\Model\AbstractFinisher::execute(TYPO3\Form\Core\Model\FinisherContext)
21 TYPO3\Form\Core\Runtime\FormRuntime_Original::invokeFinishers()
20 TYPO3\Form\Core\Runtime\FormRuntime_Original::render()
19 TYPO3\Setup\Controller\SetupController_Original::indexAction(1)
18 TYPO3\Setup\Controller\SetupController::indexAction(1)
17 call_user_func_array(array|2|, array|1|)
16 TYPO3\Setup\Controller\SetupController::Flow_Aop_Proxy_invokeJoinPoint(TYPO3\Flow\Aop\JoinPoint)
15 TYPO3\Flow\Aop\Advice\AdviceChain::proceed(TYPO3\Flow\Aop\JoinPoint)
14 TYPO3\Flow\Security\Aspect\PolicyEnforcementAspect_Original::enforcePolicy(TYPO3\Flow\Aop\JoinPoint)
13 TYPO3\Flow\Aop\Advice\AroundAdvice::invoke(TYPO3\Flow\Aop\JoinPoint)
12 TYPO3\Flow\Aop\Advice\AdviceChain::proceed(TYPO3\Flow\Aop\JoinPoint)
11 TYPO3\Setup\Controller\SetupController::indexAction(1)
10 call_user_func_array(array|2|, array|1|)
9 TYPO3\Flow\Mvc\Controller\ActionController_Original::callActionMethod()
8 TYPO3\Flow\Mvc\Controller\ActionController_Original::processRequest(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
7 TYPO3\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
6 TYPO3\Flow\Mvc\Dispatcher_Original::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
5 TYPO3\Flow\Mvc\DispatchComponent_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
4 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
3 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
2 TYPO3\Setup\Core\RequestHandler::handleRequest()
1 TYPO3\Flow\Core\Bootstrap::run()

Thanks for your help so far.

Neither of the mentioned PHP versions is an actual CLI binary, which you should have for Flow and Neos. So you should figure out where your hoster has an actual PHP CLI binary (eg. PHP 7.0.24 (cli) (built: Oct 17 2017 00:34:37) ( NTS )) from my local system.

AFAIK DomainFactory has CLI binaries of PHP available under this scheme:

  • /usr/local/bin/php5-LATEST-CLI
  • /usr/local/bin/php7-70STABLE-CLI

etc.

So you need to specify that path in your Settings as Neos.Flow.core.phpBinaryPathAndFilename

Yes, I am able to call the binary /usr/local/bin/php7-70STABLE-CLI:

$ /usr/local/bin/php7-70STABLE-CLI -v
PHP 7.0.20 (cli) (built: Jun 23 2017 10:20:38) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

(be aware I use Neos 2.3.8) I changed the setting in file
neoscms/Packages/Framework/TYPO3.Flow/Configuration/Settings.yaml

phpBinaryPathAndFilename: ‘%PHP_BINDIR%/php7-70STABLE-CLI’

But I got the same exception.
Maybe I have to change this setting in some other files as well?

avoid the %PHP_BINDIR% at this place, since this is used to locate the CLI binary from the SAPI binary. Use the full path in the setting. Afterwards, you might at most need to flush the cache.

Unfortunately without success.
I executed the following commands:

$ ./flow flow:cache:flush 
$ ./flow flow:cache:flush --force
$ FLOW_CONTEXT=Production ./flow flow:cache:flush 
$ FLOW_CONTEXT=Production ./flow flow:cache:flush --force

I used a new browser instance, but I’ve got still the same exception. Only one empty DB table was created (flow_doctrine_migrationstatus). I wondered a little bit: the (old) settings for the DB were still available in the setup form. (it was not removed by flushing).

you might even need to call the ./flow command prefixed with the PHP CLI binary.

It doesn’t help. Calling the ./flow command like this:

$ /usr/local/bin/php7-70STABLE-CLI ./flow  flow:cache:flush
$ FLOW_CONTEXT=Production /usr/local/bin/php7-70STABLE-CLI ./flow  flow:cache:flush

has the same effect. I can find several settings with the right reference to the php-binary:
Even in the first line of the flow script: #!/usr/local/bin/php7-70STABLE-CLI

in neoscms/Configuration/Settings.yaml:

phpBinaryPathAndFilename: /usr/local/bin/php7-70STABLE-CLI

The DB configuration is stored inside the Settings.yaml, which is not flushed for good reasons :slight_smile:

Anyway, I just out of curiousity installed the Neos 2.3 LTS on our DF account and the installation went really smoothly, it also already added the phpBinaryPathAndFilename to settings automatically so even the command line tool worked :smiley:
So somewhere down your path a few things must have gone off road and now cause a lot of pain unfortunately :confused: Let’s try to get that solved!

I then further followed your steps from the first post, and after importing the new site (without the resource clean&publish, node repair) I also ended up with the exception about the Neos.Demo package.

What I then did however, was just flush the cache, rebuild it and then I could correctly log into the Neos backend again start working on that site.
export FLOW_CONTEXT=Production ./flow flow:cache:flush --force ./flow flow:core:compile && ./flow doctrine:compileproxies && ./flow flow:cache:warmup

I always do the warmup with the below three commands because I occasionally had the proxy compilation fail and then things would not work. With this line things always work out correctly.

So maybe it’s better to just restart all over instead of trying to fix the broken setup?

Hi Alexander, thanks for your great support.

Yes I thinks so too. I will try it tomorrow.