[SOLVED] Problems with Upgrade 3.3 -> 4.0


(Andre Hohmann) #1

Hallo,

I got problems with the upgrade from 3.3 to 4.0:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - neos/nodetypes 4.0.4 requires neos/content-repository 4.0.4 -> satisfiable by neos/content-repository[4.0.4].
    - Conclusion: don't install neos/content-repository 4.0.4
    - neos/nodetypes 4.0.3 requires neos/content-repository 4.0.3 -> satisfiable by neos/content-repository[4.0.3].
    - Conclusion: don't install neos/content-repository 4.0.3
    - neos/nodetypes 4.0.2 requires neos/content-repository 4.0.2 -> satisfiable by neos/content-repository[4.0.2].
    - Conclusion: don't install neos/content-repository 4.0.2
    - neos/site-kickstarter 3.3.0 requires neos/content-repository 3.3.0 -> satisfiable by neos/content-repository[3.3.0].
    - neos/site-kickstarter 3.3.1 requires neos/content-repository 3.3.1 -> satisfiable by neos/content-repository[3.3.1].
    - neos/site-kickstarter 3.3.2 requires neos/content-repository 3.3.2 -> satisfiable by neos/content-repository[3.3.2].
    - neos/site-kickstarter 3.3.3 requires neos/content-repository 3.3.3 -> satisfiable by neos/content-repository[3.3.3].
    - neos/site-kickstarter 3.3.4 requires neos/content-repository 3.3.4 -> satisfiable by neos/content-repository[3.3.4].
    - neos/site-kickstarter 3.3.5 requires neos/content-repository 3.3.5 -> satisfiable by neos/content-repository[3.3.5].
    - neos/site-kickstarter 3.3.6 requires neos/content-repository 3.3.6 -> satisfiable by neos/content-repository[3.3.6].
    - neos/site-kickstarter 3.3.7 requires neos/content-repository 3.3.7 -> satisfiable by neos/content-repository[3.3.7].
    - neos/site-kickstarter 3.3.8 requires neos/content-repository 3.3.8 -> satisfiable by neos/content-repository[3.3.8].
    - neos/site-kickstarter 3.3.9 requires neos/content-repository 3.3.9 -> satisfiable by neos/content-repository[3.3.9].
    - neos/site-kickstarter 3.3.10 requires neos/content-repository 3.3.10 -> satisfiable by neos/content-repository[3.3.10].
    - neos/site-kickstarter 3.3.10 requires neos/content-repository 3.3.10 -> satisfiable by neos/content-repository[3.3.10].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.0].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.1].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.10].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.2].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.3].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.4].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.5].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.6].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.7].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.8].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.9].
    - Can only install one of: neos/content-repository[4.0.0, 3.3.10].
    - neos/nodetypes 4.0.0 requires neos/content-repository 4.0.0 -> satisfiable by neos/content-repository[4.0.0].
    - Installation request for neos/nodetypes ~4.0.0 -> satisfiable by neos/nodetypes[4.0.0, 4.0.2, 4.0.3, 4.0.4].
    - Installation request for neos/site-kickstarter ~3.3.0 -> satisfiable by neos/site-kickstarter[3.3.0, 3.3.1, 3.3.10, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9].

(Soren Malling) #2

What did you do before composer update

It could be the site-kickstarter that you havent changed the version number for.

None the less, go through the whole upgrade https://www.neos.io/download-and-extend/upgrade-instructions-3-3-4-0.html and you are good.


(Andre Hohmann) #3

None the less, go through the whole upgrade https://www.neos.io/download-and-extend/upgrade-instructions-3-3-4-0.html and you are good.

I did and stopped at composer update because of shown errors.


(Soren Malling) #4

To me it looks like you didn’t do
composer require --no-update "neos/site-kickstarter:~4.0.0"

since the error tells you an dependency issue on neos/site-kickstarter 3.3.0.

Try and run the command composer require --no-update "neos/site-kickstarter:~4.0.0" and then composer update again

If that doesn’t help, please post your current composer.json


(Andre Hohmann) #5

I restored a backup to ensure that I did’nt made mistakes. Now at composer update I get this:

composer update

Here’s my composer.json:

{
    "name": "neos/neos-base-distribution",
    "description": "Neos Base Distribution",
    "license": "GPL-3.0+",
    "support": {
        "email": "hello@neos.io",
        "slack": "http://slack.neos.io/",
        "forum": "https://discuss.neos.io/",
        "wiki": "https://discuss.neos.io/c/the-neos-project/project-documentation",
        "issues": "https://github.com/neos/neos-development-collection/issues",
        "docs": "http://neos.readthedocs.org/",
        "source": "https://github.com/neos/neos-base-distribution"
    },
    "config": {
        "vendor-dir": "Packages/Libraries",
        "bin-dir": "bin"
    },
    "require": {
        "neos/neos": "~4.0.0",
        "neos/nodetypes": "~4.0.0",
        "neos/site-kickstarter": "~4.0.0",
        "neos/seo": "~2.0",
        "neos/setup": "~4.0",
        "flowpack/neos-frontendlogin": "~3.0",
        "neos/redirecthandler-neosadapter": "~2.0",
        "neos/redirecthandler-databasestorage": "~2.0",
        "itoop/neos-simple-table": "dev-master",
        "neos/swiftmailer": "^6.0",
        "facebook/graph-sdk": "^5.5",
        "itoop/facebook": "dev-master",
        "moc/notfound": "^3.0",
        "neos/neos-ui": "~1.0.0",
        "neos/neos-ui-compiled": "~1.0.0",
        "kaufmanndigital/cookieconsent": "^1.1"
    },
    "require-dev": {
        "neos/buildessentials": "5.0.x-dev",
        "mikey179/vfsstream": "~1.6",
        "phpunit/phpunit": "~5.4.0",
        "symfony/css-selector": "~2.0",
        "neos/behat": "dev-master"
    },
    "replace": {
        "typo3/neos-base-distribution": "3.0.3"
    },
    "suggest": {
        "ext-pdo_sqlite": "For running functional tests out-of-the-box this is required"
    },
    "scripts": {
        "post-update-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
        "post-install-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
        "post-package-update": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall",
        "post-package-install": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall"
    },
    "autoload": {
        "psr-0": {
            "facebook\\": "src/"
        }
         }
}

rm -rf Data/Temporary also doesn’t help.


(Karsten Dambekalns) #6

Ok, make that:

{
    "name": "itoop/neos-base-distribution",
    "description": "Neos Base Distribution",
    "license": "GPL-3.0+",
    "config": {
        "vendor-dir": "Packages/Libraries",
        "bin-dir": "bin"
    },
    "require": {
        "neos/neos": "~4.0.0",
        "neos/nodetypes": "~4.0.0",
        "neos/site-kickstarter": "~4.0.0",
        "neos/seo": "~2.0",
        "neos/setup": "~4.0",
        "flowpack/neos-frontendlogin": "~3.0",
        "neos/redirecthandler-neosadapter": "~2.0",
        "neos/redirecthandler-databasestorage": "~2.0",
        "itoop/neos-simple-table": "dev-master",
        "neos/swiftmailer": "^6.0",
        "facebook/graph-sdk": "^5.5",
        "itoop/facebook": "dev-master",
        "moc/notfound": "^3.0",
        "neos/neos-ui": "~1.0",
        "neos/neos-ui-compiled": "~1.0",
        "kaufmanndigital/cookieconsent": "^1.1"
    },
    "require-dev": {
        "neos/buildessentials": "5.0.x-dev",
        "mikey179/vfsstream": "~1.6",
        "phpunit/phpunit": "~7",
        "symfony/css-selector": "~2.0",
        "neos/behat": "dev-master"
    },
    "scripts": {
        "post-update-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
        "post-install-cmd": "Neos\\Flow\\Composer\\InstallerScripts::postUpdateAndInstall",
        "post-package-update": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall",
        "post-package-install": "Neos\\Flow\\Composer\\InstallerScripts::postPackageUpdateAndInstall"
    },
    "autoload": {
        "psr-0": {
            "facebook\\": "src/"
        }
    }
}

The trick (aside from removing some stuff that is not needed and wrong – we don’t support your distribution…) here is the PhpUnit dependency. That old PhpUnit you had there simply doesn’t work with the new Flow/Neos.

Should work…


(Andre Hohmann) #7

At the end of composer update now I get

Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
> Neos\Flow\Composer\InstallerScripts::postUpdateAndInstall
Script Neos\Flow\Composer\InstallerScripts::postUpdateAndInstall handling the post-update-cmd event terminated with an exception

                                                                                                                                                 
  [ErrorException]                                                                                                                               
  Use of undefined constant FLOW_PATH_TEMPORARY_BASE - assumed 'FLOW_PATH_TEMPORARY_BASE' (this will throw an Error in a future version of PHP) 

If I try then ./flow flow:cache:flush --force I get this:

$ ./flow flow:cache:flush --force
PHP Notice:  Undefined index: psr3 in /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Scripts.php on line 249
PHP Fatal error:  Uncaught Error: Class name must be a valid object or a string in /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Scripts.php:255
Stack trace:
#0 [internal function]: Neos\Flow\Core\Booting\Scripts::initializeSystemLogger(Object(Neos\Flow\Core\Bootstrap))
#1 /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Step.php(52): call_user_func(Array, Object(Neos\Flow\Core\Bootstrap))
#2 /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Sequence.php(107): Neos\Flow\Core\Booting\Step->__invoke(Object(Neos\Flow\Core\Bootstrap))
#3 /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Sequence.php(111): Neos\Flow\Core\Booting\Sequence->invokeStep(Object(Neos\Flow\Core\Booting\Step), Object(Neos\Flow\Core\Bootstrap))
#4 /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Cor in /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Packages/Framework/Neos.Flow/Classes/Core/Booting/Scripts.php on line 255

I think that’s the same error which I got at problems with upgrading another site of mine, please see Upgrade 3.3 -> 4.0: Undefined index: psr3
This problem is also not solved untill now :pensive:


(Karsten Dambekalns) #8

Ok, --force should never fail, but have you tried rm -rf Data/Temporary/ ; rm -f Configuration/PackageStates.php already?

The error about the undefined constant is “ok” (if something like that can be called “ok”.)


(Andre Hohmann) #9

Ok, --force should never fail, but have you tried rm -rf Data/Temporary/ ; rm -f Configuration/PackageStates.php already?
With that I can finish the update now :slightly_smiling_face:

But now in frontend the styles are not loaded and I get an error:

An exception was thrown while Neos tried to render your page
Catchable Fatal Error: Object of class Neos\Fusion\FusionObjects\Helpers\FusionPathProxy could not be converted to string in /var/www/vhosts/alstaetter-tc.de/dev.alstaetter-tc.de/Data/Temporary/Development/Cache/Code/Fluid_TemplateCache/Frontend_Node_action_show_bc3619ba900567e0bba154b5517de6d8596931ce.php line 639

page<Neos.Neos:Page>/
 body<Neos.Fusion:Template>/

For a full stacktrace, open Data/Logs/Exceptions/20180612052417ab7899.txt

Frontend_Node_action_show_bc3619ba900567e0bba154b5517de6d8596931ce.php

./flow node:repair
./flow resource:clean
./flow media:clearthumbnails

…also doesn’t help.


(Karsten Dambekalns) #10

Styles not loaded? Did you run ./flow resource:publish?

The Fusion error is caused by some prototype not behaving as expected due to changes. hard to tell exactly, but the stacktrace and a search here or in Slack for the error should give some helpful results…

Good luck!


(Bastian Heist) #11

For reference: I had the error Object of class Neos\Fusion\FusionObjects\Helpers\FusionPathProxy could not be converted to string as well while doing an upgrade to 4.0 today. It is caused by the removal of the default namespace in Fusion - the site’s Page prototype had this Fusion:

content {
    main = PrimaryContent {
        nodePath = 'main'
    }
}

to fix it, I changed it to:

content {
    main = Neos.Neos:PrimaryContent {
        nodePath = 'main'
    }
}

(Aske Ertmann) #12

There’s an automated migration for this, make sure to run code migrations when you upgrade.