XF 2.0 2.0.12 Upgrade error > Please select a valid parent navigation entry

Kleazy

Active member
Forum worked before... now its stuck in upgrade and wont complete.
I was trying to upgrade from 2.0.11-isch (maybe have been one before that)

php cmd.php xf:upgrade
Current version: 2001270
Upgrade target: 2001270 (2.0.12)
You are already running the latest version. Rebuild the master data? [y/n] y

[XF\PrintableException]
Please select a valid parent navigation entry. A navigation entry may not be a child of itself or one of its descendants.

---

I check Public navigations, nodes and the parenting appears to be ok.

Is there a way to run "advanced mode" upgrade where it shows what the upgrade process is doing and upset about?

Or is there a detailed log file I can read?
 
If you pass -v in as an argument to the command, it may give more details. Alternatively, you can do this via the web upgrader and it should give a trace at least, though it may not be clear as to what entry it's complaining about. Have you re-organized the navigation tree at all?

You can put $config['checkVersion'] = false; into your src/config.php file temporarily which should allow you into the control panel and you can likely make a navigation-related adjustment there (though I'm not sure what that would need to be as I'm not sure what changes you've made).
 
If you pass -v in as an argument to the command, it may give more details. Alternatively, you can do this via the web upgrader and it should give a trace at least, though it may not be clear as to what entry it's complaining about. Have you re-organized the navigation tree at all?

You can put $config['checkVersion'] = false; into your src/config.php file temporarily which should allow you into the control panel and you can likely make a navigation-related adjustment there (though I'm not sure what that would need to be as I'm not sure what changes you've made).

Thank you for the rapid answer. Highly appreciate that level of support.

  • I ran my initial upgrade via web and the error message was the same.
  • I am not locked out of the CP.

----

php cmd.php xf:upgrade -v
ea-php-cli Copyright 2017 cPanel, Inc.
Current version: 2001270
Upgrade target: 2001270 (2.0.12)
You are already running the latest version. Rebuild the master data? [y/n] y


[XF\PrintableException]
Please select a valid parent navigation entry. A navigation entry may not be a child of itself or one of its descendants.


Exception trace:
() at /path/public_html/forum/src/XF/Mvc/Entity/Entity.php:1111
XF\Mvc\Entity\Entity->save() at /path/public_html/forum/src/XF/AddOn/DataType/Navigation.php:92
XF\AddOn\DataType\Navigation->importAddOnData() at /path/public_html/forum/src/XF/Job/AddOnData.php:108
XF\Job\AddOnData->run() at /path/public_html/forum/src/XF/Job/Atomic.php:38
XF\Job\Atomic->run() at /path/public_html/forum/src/XF/Job/Manager.php:241
XF\Job\Manager->runJobInternal() at /path/public_html/forum/src/XF/Job/Manager.php:187
XF\Job\Manager->runJobEntry() at /path/public_html/forum/src/XF/Job/Manager.php:138
XF\Job\Manager->runUnique() at /path/public_html/forum/src/XF/Cli/Command/JobRunnerTrait.php:30
XF\Cli\Command\Upgrade->runJob() at /path/public_html/forum/src/XF/Cli/Command/Upgrade.php:200
XF\Cli\Command\Upgrade->execute() at /path/public_html/forum/src/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at /path/public_html/forum/src/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at /path/public_html/forum/src/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at /path/public_html/forum/src/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /path/public_html/forum/src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at /path/public_html/forum/cmd.php:15

xf:upgrade [--skip-statistics]
 
Setup > Navigation > Public Navigation.

I am now going into each item.
I noticed that I can trigger the same error by purposely placing an entry into its own node. Ok so you are checking for proper parenting now. and 2.0.12 is already running. I now re-save each item without making a change (because I like my navigation as is). I am hoping to trigger the error in your parenting check... maybe... There are many.. it may take a few minutes.
 
Setup > Navigation > Public Navigation.

I am now going into each item.
I noticed that I can trigger the same error by purposely placing an entry into its own node. Ok so you are checking for proper parenting now. and 2.0.12 is already running. I now re-save each item without making a change (because I like my navigation as is). I am hoping to trigger the error in your parenting check... maybe... There are many.. it may take a few minutes.
Fruitless
 
As far as I'm aware, we've always checked for the parenting and I don't believe we've changed many -- if any -- parentings since 2.0.1, so I'm confused as to where this error is coming from.

You can try editing the following line in src/XF/Entity/Navigation.php to try to get some more details:
Code:
$this->error(\XF::phrase('please_select_valid_parent_navigation_entry'), 'parent_navigation_id');
Change it to:
Code:
$this->error("Parenting error: $this->navigation_id. Was " . $this->getExistingValue('parent_navigation_id') . ", now $this->parent_navigation_id", 'parent_navigation_id');
That should then print out some information that'll hopefully point to what the issue is.
 
Last edited:
Web upgarde:
An exception occurred: [ParseError] syntax error, unexpected '"', expecting ',' or ')' in src/XF/Entity/Navigation.php on line 181

  1. Composer\Autoload\includeFile() in src/vendor/composer/ClassLoader.php at line 322
  2. Composer\Autoload\ClassLoader->loadClass()
  3. spl_autoload_call()
  4. class_exists() in src/XF/Mvc/Entity/Manager.php at line 49
  5. XF\Mvc\Entity\Manager->getEntityClassName() in src/XF/Mvc/Entity/Manager.php at line 67
  6. XF\Mvc\Entity\Manager->getEntityStructure() in src/XF/AddOn/DataType/AbstractDataType.php at line 31
  7. XF\AddOn\DataType\AbstractDataType->__construct() in src/XF/AddOn/DataManager.php at line 149
  8. XF\AddOn\DataManager->getDataTypeHandler() in src/XF/Job/AddOnData.php at line 61
  9. XF\Job\AddOnData->run() in src/XF/Job/Atomic.php at line 38
  10. XF\Job\Atomic->run() in src/XF/Job/Manager.php at line 241
  11. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
  12. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 138
  13. XF\Job\Manager->runUnique() in src/XF/Install/Controller/AbstractController.php at line 24
  14. XF\Install\Controller\AbstractController->manualJobRunner() in src/XF/Install/Controller/Upgrade.php at line 251
  15. XF\Install\Controller\Upgrade->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
  16. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  17. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  18. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1934
  19. XF\App->run() in src/XF.php at line 333
  20. XF::runApp() in install/index.php at line 14
------

Command line:

php cmd.php xf:upgrade -v
ea-php-cli Copyright 2017 cPanel, Inc.
Current version: 2001270
Upgrade target: 2001270 (2.0.12)
You are already running the latest version. Rebuild the master data? [y/n] y


[ParseError]
syntax error, unexpected '"', expecting ',' or ')'


Exception trace:
() at /path/public_html/forum/src/XF/Entity/Navigation.php:181
Composer\Autoload\includeFile() at /path/public_html/forum/src/vendor/composer/ClassLoader.php:322
Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
spl_autoload_call() at n/a:n/a
class_exists() at /path/public_html/forum/src/XF/Mvc/Entity/Manager.php:49
XF\Mvc\Entity\Manager->getEntityClassName() at /path/public_html/forum/src/XF/Mvc/Entity/Manager.php:67
XF\Mvc\Entity\Manager->getEntityStructure() at /path/public_html/forum/src/XF/AddOn/DataType/AbstractDataType.php:31
XF\AddOn\DataType\AbstractDataType->__construct() at /path/public_html/forum/src/XF/AddOn/DataManager.php:149
XF\AddOn\DataManager->getDataTypeHandler() at /path/public_html/forum/src/XF/Job/AddOnData.php:61
XF\Job\AddOnData->run() at /path/public_html/forum/src/XF/Job/Atomic.php:38
XF\Job\Atomic->run() at /path/public_html/forum/src/XF/Job/Manager.php:241
XF\Job\Manager->runJobInternal() at /path/public_html/forum/src/XF/Job/Manager.php:187
XF\Job\Manager->runJobEntry() at /path/public_html/forum/src/XF/Job/Manager.php:138
XF\Job\Manager->runUnique() at /path/public_html/forum/src/XF/Cli/Command/JobRunnerTrait.php:30
XF\Cli\Command\Upgrade->runJob() at /path/public_html/forum/src/XF/Cli/Command/Upgrade.php:200
XF\Cli\Command\Upgrade->execute() at /path/public_html/forum/src/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at /path/public_html/forum/src/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at /path/public_html/forum/src/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at /path/public_html/forum/src/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /path/public_html/forum/src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at /path/public_html/forum/cmd.php:15

xf:upgrade [--skip-statistics]
 
php cmd.php xf:upgrade -v
ea-php-cli Copyright 2017 cPanel, Inc.
Current version: 2001270
Upgrade target: 2001270 (2.0.12)
You are already running the latest version. Rebuild the master data? [y/n] y


[XF\PrintableException]
Parenting error: findThreads. Was forum, now forums


Exception trace:
() at /path/forum/src/XF/Mvc/Entity/Entity.php:1111
XF\Mvc\Entity\Entity->save() at /path/forum/src/XF/AddOn/DataType/Navigation.php:92
XF\AddOn\DataType\Navigation->importAddOnData() at /path/public_html/forum/src/XF/Job/AddOnData.php:108
XF\Job\AddOnData->run() at /path/forum/src/XF/Job/Atomic.php:38
XF\Job\Atomic->run() at /path/forum/src/XF/Job/Manager.php:241
XF\Job\Manager->runJobInternal() at /path/forum/src/XF/Job/Manager.php:187
XF\Job\Manager->runJobEntry() at /path/forum/src/XF/Job/Manager.php:138
XF\Job\Manager->runUnique() at /path/forum/src/XF/Cli/Command/JobRunnerTrait.php:30
XF\Cli\Command\Upgrade->runJob() at /path/forum/src/XF/Cli/Command/Upgrade.php:200
XF\Cli\Command\Upgrade->execute() at /path/forum/src/vendor/symfony/console/Command/Command.php:245
Symfony\Component\Console\Command\Command->run() at /path/forum/src/vendor/symfony/console/Application.php:835
Symfony\Component\Console\Application->doRunCommand() at /path/forum/src/vendor/symfony/console/Application.php:185
Symfony\Component\Console\Application->doRun() at /path/forum/src/vendor/symfony/console/Application.php:117
Symfony\Component\Console\Application->run() at /path/forum/src/XF/Cli/Runner.php:63
XF\Cli\Runner->run() at /path/forum/cmd.php:15

xf:upgrade [--skip-statistics]
 
SOLVED

190590


My Navigation ID was set to forum when it needed to be forumS

From my experience every upgrade in the past I had to change the Title to forum after upgrades because XF upgrade overrides my forum title. So perhaps the last time around I not only changed the title back to forum but also the ID.

Fixed now. I know where to look for the same error in the future and maybe this helps others with the same error.

Thank you Mike for your prompt and grade-a support.

Is there a XF staff tip jar?
 
I was just typing the forum vs forums thing, but I was going to point out that this requires debug mode being enabled. The message at the top also points to that. In debug mode, you're editing components that you shouldn't be editing -- they'll be overwritten on upgrade as this is mostly a mode for add-on developers

You should disable debug mode unless you have a very particular reason to enable it. If you can't customize the title of the navigation entry here with it disabled, you can customize it in the phrases ( nav.forums ).
 
Back
Top Bottom