Status: Tech investigation still need to be done
I have encountered an issue with the upgrade of Prestashop 1.7.7 from both 1.7.6.9 and from 1.7.6.5
I have upgraded two of my shops, through 1-click and in both instances the main BO menu has disappeared.
When I turn the debugger on I get this error:
Notice on line 2083 in file /home/244169.cloudwaysapps.com/zecggmmewd/public_html/classes/controller/AdminController.php
[8] Undefined index: enabled
Please see screenshot attachment
Server info in sshot2
@sarahdib I remember seeing the same kind of issues on one of your screenshots but it was a long time ago 馃槄 do you remember?
@jolelievre is this issue and https://github.com/PrestaShop/PrestaShop/issues/22251 similar to https://github.com/PrestaShop/PrestaShop/issues/16379 ?
@Pitt1823 What version of the autoupgrade module have you used?
1-Click Upgrade v 4.11.0
Somebody can explaine the steps to do? I am not a developer, but have the shop on PS and now can admin it ((
@photinia73 Hi, we do not provide such support, this is a bug tracker, not a help center 馃槄
You might want to look at the PrestaShop Company鈥檚 support plans
@matks Hi, I have used the v4.11.0 version freshly downloaded from the module catalog
A quick and dirty fix, if you can modify your database, is to set the column enabled
from table ps_tab
to 1
A quick and dirty fix, if you can modify your database, is to set the column
enabled
from tableps_tab
to1
This doesn't work for me ... hmmm
A quick and dirty fix, if you can modify your database, is to set the column
enabled
from tableps_tab
to1
Now my PS 1.7.7.0 is brocken after attempt to rollback, but in the v 1.6.9 in the ps_tab the columnenabled
is absent.
Only 'active'
Did the columns rename?
A quick and dirty fix, if you can modify your database, is to set the column
enabled
from tableps_tab
to1
Now my PS 1.7.7.0 is brocken after attempt to rollback, but in the v 1.6.9 in the ps_tab the columnenabled
is absent.
Only 'active'
Did the columns rename?
yeah I have it as "active". I renamed that to "enabled" and set it all to 1. Problem still there.
Hi @photinia73 @straitskapitan
Do not rename the column active
.
1 - Be sure you have the active
column in PREFIX_tab
2 - Make sure you are missing the enabled
column in PREFIX_tab
3 - If steps (1) and (2) have been verified, then you can execute this request (Replace PREFIX_ by ps_ in your case):
ALTER TABLE `PREFIX_tab` ADD `enabled` TINYINT(1) NOT NULL DEFAULT '1' AFTER `active`;
I already rolled back to my previous version 1.7.6.4.
Will attempt another upgrade in the next 24 hours using the same method.
After the 1 click upgrade I had this error :
Copied /vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/DoTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/EmbedTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FilterTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FlushTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ForTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FromTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/IfTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ImportTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/IncludeTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/MacroTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SandboxTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SetTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/TokenParserInterface.php.
Copied /vendor/twig/twig/src/TokenParser/UseTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/WithTokenParser.php.
Copied /vendor/twig/twig/src/TokenStream.php.
Copied /vendor/twig/twig/src/TwigFilter.php.
Copied /vendor/twig/twig/src/TwigFunction.php.
Copied /vendor/twig/twig/src/TwigTest.php.
Directory /vendor/twig/twig/src/Util already exists.
Copied /vendor/twig/twig/src/Util/DeprecationCollector.php.
Copied /vendor/twig/twig/src/Util/TemplateDirIterator.php.
Directory /vendor/willdurand created.
Directory /vendor/willdurand/jsonp-callback-validator created.
Copied /vendor/willdurand/jsonp-callback-validator/LICENSE.
Directory /vendor/willdurand/jsonp-callback-validator/src created.
Copied /vendor/willdurand/jsonp-callback-validator/src/JsonpCallbackValidator.php.
Directory /webservice already exists.
Copied /webservice/dispatcher.php.
Copied /webservice/index.php.
[SKIP] directory "/app/cache/" does not exist and cannot be emptied.
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/dev/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/dev-old/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/prod/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/prod-old/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/): Directory not empty
[CLEANING CACHE] File old removed
[CLEANING CACHE] File prod removed
Migrating old setting file...
parameters file already exists!
Finished...
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/vendor/composer/ClassLoader.php line 444 - include(/ROOTFOLDER_REFREMOVED/vendor/composer/../league/tactician-bundle/TacticianBundle.php): failed to open stream: No such file or directory
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/vendor/composer/ClassLoader.php line 444 - include(): Failed opening '/ROOTFOLDER_REFREMOVED/vendor/composer/../league/tactician-bundle/TacticianBundle.php' for inclusion (include_path='/ROOTFOLDER_REFREMOVED/vendor/pear/pear_exception:/ROOTFOLDER_REFREMOVED/vendor/pear/console_getopt:/ROOTFOLDER_REFREMOVED/vendor/pear/pear-core-minimal/src:/ROOTFOLDER_REFREMOVED/vendor/pear/archive_tar:.:/usr/share/pear:/usr/share/php')
[INTERNAL] ROOTFOLDER_REFREMOVED/app/AppKernel.php line 59 - Error: Class 'League\Tactician\Bundle\TacticianBundle' not found #0 ROOTFOLDER_REFREMOVED/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(488): AppKernel->registerBundles() #1 ROOTFOLDER_REFREMOVED/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(132): Symfony\Component\HttpKernel\Kernel->initializeBundles() #2 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/SymfonyAdapter.php(74): Symfony\Component\HttpKernel\Kernel->boot() #3 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php(50): PrestaShop\Module\AutoUpgrade\UpgradeTools\SymfonyAdapter->initAppKernel() #4 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(85): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader17->initConstants() #5 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/TaskRunner/Upgrade/UpgradeDb.php(41): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->doUpgrade() #6 ROOTFOLDER_REFREMOVED/admin403tzfqmk/autoupgrade/ajax-upgradetab.php(53): PrestaShop\Module\AutoUpgrade\TaskRunner\Upgrade\UpgradeDb->run() #7 {main}
@straitskapitan Module autoupgrade attempts to write inside folder /ROOTFOLDER_REFREMOVED/var/cache/
but it cannot as it does not have the necessary rights.
I already rolled back to my previous version 1.7.6.4.
Will attempt another upgrade in the next 24 hours using the same method.
After the 1 click upgrade I had this error :
Copied /vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/DoTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/EmbedTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FilterTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FlushTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ForTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/FromTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/IfTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/ImportTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/IncludeTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/MacroTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SandboxTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SetTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/TokenParserInterface.php.
Copied /vendor/twig/twig/src/TokenParser/UseTokenParser.php.
Copied /vendor/twig/twig/src/TokenParser/WithTokenParser.php.
Copied /vendor/twig/twig/src/TokenStream.php.
Copied /vendor/twig/twig/src/TwigFilter.php.
Copied /vendor/twig/twig/src/TwigFunction.php.
Copied /vendor/twig/twig/src/TwigTest.php.
Directory /vendor/twig/twig/src/Util already exists.
Copied /vendor/twig/twig/src/Util/DeprecationCollector.php.
Copied /vendor/twig/twig/src/Util/TemplateDirIterator.php.
Directory /vendor/willdurand created.
Directory /vendor/willdurand/jsonp-callback-validator created.
Copied /vendor/willdurand/jsonp-callback-validator/LICENSE.
Directory /vendor/willdurand/jsonp-callback-validator/src created.
Copied /vendor/willdurand/jsonp-callback-validator/src/JsonpCallbackValidator.php.
Directory /webservice already exists.
Copied /webservice/dispatcher.php.
Copied /webservice/index.php.
[SKIP] directory "/app/cache/" does not exist and cannot be emptied.
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/dev/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/dev-old/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/prod/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/prod-old/): Permission denied
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/Tools14.php line 598 - rmdir(/ROOTFOLDER_REFREMOVED/var/cache/old/): Directory not empty
[CLEANING CACHE] File old removed
[CLEANING CACHE] File prod removed
Migrating old setting file...
parameters file already exists!
Finished...
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/vendor/composer/ClassLoader.php line 444 - include(/ROOTFOLDER_REFREMOVED/vendor/composer/../league/tactician-bundle/TacticianBundle.php): failed to open stream: No such file or directory
[INTERNAL] /ROOTFOLDER_REFREMOVED/modules/autoupgrade/vendor/composer/ClassLoader.php line 444 - include(): Failed opening '/ROOTFOLDER_REFREMOVED/vendor/composer/../league/tactician-bundle/TacticianBundle.php' for inclusion (include_path='/ROOTFOLDER_REFREMOVED/vendor/pear/pear_exception:/ROOTFOLDER_REFREMOVED/vendor/pear/console_getopt:/ROOTFOLDER_REFREMOVED/vendor/pear/pear-core-minimal/src:/ROOTFOLDER_REFREMOVED/vendor/pear/archive_tar:.:/usr/share/pear:/usr/share/php')[INTERNAL] ROOTFOLDER_REFREMOVED/app/AppKernel.php line 59 - Error: Class 'League\Tactician\Bundle\TacticianBundle' not found #0 ROOTFOLDER_REFREMOVED/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(488): AppKernel->registerBundles() #1 ROOTFOLDER_REFREMOVED/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(132): Symfony\Component\HttpKernel\Kernel->initializeBundles() #2 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/SymfonyAdapter.php(74): Symfony\Component\HttpKernel\Kernel->boot() #3 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader17.php(50): PrestaShop\Module\AutoUpgrade\UpgradeTools\SymfonyAdapter->initAppKernel() #4 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/UpgradeTools/CoreUpgrader/CoreUpgrader.php(85): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader17->initConstants() #5 ROOTFOLDER_REFREMOVED/modules/autoupgrade/classes/TaskRunner/Upgrade/UpgradeDb.php(41): PrestaShop\Module\AutoUpgrade\UpgradeTools\CoreUpgrader\CoreUpgrader->doUpgrade() #6 ROOTFOLDER_REFREMOVED/admin403tzfqmk/autoupgrade/ajax-upgradetab.php(53): PrestaShop\Module\AutoUpgrade\TaskRunner\Upgrade\UpgradeDb->run() #7 {main}
I had also the similar [INTERNAL] errors. And my site was totaly broken. But I have a lot of backups and restore the PS shop manualy.... to 1.7.6.9.
it seems on my system that it's related to caching.
Disabling cache seems to bring back left menu.
Presta 1.7.7.0, php 7.4.13
I am on my mobile phone, so I can鈥榯 help much right now. However I have the same issue, same behaviour almost identical error messages. I will try to contribute more tomorrow. What I can tell and may be important is that I also host on cloudways. If I had to guess i would say that it is related to permissions and not cache...But I am not a developer
PrestaShop 1.7.7 is not compatible with PHP 7.4, I suggest to downgrade to PHP 7.3
It's not that missing field in ps_tab, i had it
downgrading to php7.3 doesnt help (obviously)
bin/console doctrine:schema:update --dump-sql
says
ALTER TABLE ps_tab_lang ADD CONSTRAINT FK_CFD9262DED47AB56 FOREIGN KEY (id_tab) REFERENCES ps_tab (id_tab);
and this fails with ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (
*.
#sql-a64_fbe4, CONSTRAINT
FK_CFD9262DED47AB56FOREIGN KEY (
id_tab) REFERENCES
ps_tab(
id_tab)
@straitskapitan Module autoupgrade attempts to write inside folder
/ROOTFOLDER_REFREMOVED/var/cache/
but it cannot as it does not have the necessary rights.
It seems that the permissions was changed as it does the upgrade. prior to that I have already set the permissions correctly for all folders and files within :
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;
Advanced > Info > shows that the permissions was correct prior to upgrade. After upgrade, the same page shows as Cache folder having permission issue.
1) When I manually change the permission for the cache folder, it does not solve the issue.
2) Running the find and replace also does not solve the issue.
3) Reseting ownership to webserver user on all files then removes the issue. So I am not sure how ownership was changed during the autoupgrade.
I have since reverted back. This was done manually. The rollback on Autoupdater does not work and fails. All the tables in the database was dropped except for maybe 10-15 tables. So I had to revert back manually.
I will attempt another autoupdate later tonight and update if I have the same issues.
what works for me is:
(in classes/controller/AdminController.php
)
private function getTabs($parentId = 0, $level = 0)
[..]
foreach ($tabs as $index => $tab) {
if (!Tab::checkTabRights($tab['id_tab'])
// || !$tab['enabled'] // <- still undefined despite having column in db
[...]
$subTabHref = $this->getTabLinkFromSubTabs($tabs[$index]['sub_tabs']);
if (!empty($subTabHref)) {
$tabs[$index]['href'] = $subTabHref;
// } elseif (0 == $tabs[$index]['id_parent'] && '' == $tabs[$index]['icon']) {
// unset($tabs[$index]); <- This!
// } elseif (empty($tabs[$index]['icon'])) {
// $tabs[$index]['icon'] = 'extension';
}
what works for me is:
(inclasses/controller/AdminController.php
)private function getTabs($parentId = 0, $level = 0)
[..]
foreach ($tabs as $index => $tab) {
if (!Tab::checkTabRights($tab['id_tab'])
// || !$tab['enabled'] // <- still undefined despite having column in db
[...]
$subTabHref = $this->getTabLinkFromSubTabs($tabs[$index]['sub_tabs']);
if (!empty($subTabHref)) {
$tabs[$index]['href'] = $subTabHref;
// } elseif (0 == $tabs[$index]['id_parent'] && '' == $tabs[$index]['icon']) {
// unset($tabs[$index]); <- This!
// } elseif (empty($tabs[$index]['icon'])) {
// $tabs[$index]['icon'] = 'extension';
}
This Is also working for me! The main menu is back, but I don't know if everything else is working fine!
With debug mode on it still shows me this error:
Notice in Zeile 4777 der Datei /home/xxxx.com/xxxxxx/public_html/classes/controller/AdminController.php
[8] Undefined index: enabled
And when I want display an order I have this error...
I just launched a new test shop on cloudways. The fresh installation is a 1.7.6.1 system. I upgraded first all modules and then upgraded to 1.7.7.0. The upgrade showed no error but the main menu is also missing in this upgrade. So it must be related to cloudways / and or permissions
Notice on line 2083 in file /home/407099.cloudwaysapps.com/rzskhawxsg/public_html/classes/controller/AdminController.php
[8] Undefined index: enabled
Not sure if I have solved the issue completely but this works for me.
It seems that the table ps_tab has been renamed to active
classes/controller/AdminController.php
on line 2083
foreach ($tabs as $index => $tab) {
if (!Tab::checkTabRights($tab['id_tab'])
|| !$tab['enabled']
|| ($tab['class_name'] == 'AdminStock' &&
to
foreach ($tabs as $index => $tab) {
if (!Tab::checkTabRights($tab['id_tab'])
|| !$tab['active']
|| ($tab['class_name'] == 'AdminStock' &&
and on line 4777 the same.
private function getTabLinkFromSubTabs(array $subtabs)
{
foreach ($subtabs as $tab) {
if ($tab['active'] && $tab['enabled']) {
return $tab['href'];
}
}
to
private function getTabLinkFromSubTabs(array $subtabs)
{
foreach ($subtabs as $tab) {
if ($tab['active'] && $tab['active']) {
return $tab['href'];
}
}
EDIT: Ok, the main menu is back but this causes other issues...I am out, I don't have the expertise...
Be careful @photinia73 @Chrisi1321 you are mixing the active
and enabled
fields
active
has been present for many versions now, it is used to define if a Tab should be visible in the menu or not (invisible menus are mainly used for permissions)enabled
is a new field introduced in 177, it is used when a module is disabled, previously the Tab would stay visible this field allows to hide the Tab from the menu when a module is disable, but it leaves the active
column unchanged which allows to switch back to the previous state when the module is enabled againI suggested modifying the database because I thought maybe the schema was not updated correctly but it seems the problem lies somewhere else, if you have permission issues on the cache folder it may have failed the upgrade and left the database in an inconsistent state
Hello @Pitt1823
I managed to reproduce the issue while upgarding fresh install 1.7.6.4, 1.7.5.2, 1.7.4.1 (from prestashop.com) to 1.7.7.0 (minor version)
I had no error while upgrading, my PHP version is 7.2.
See the attached screen record below:
https://drive.google.com/file/d/1ZfDhgBDztBoaqODZv6F0cokLkmfxliAH/view
Screenshot:
I鈥檒l add this to the debug backlog so that it鈥檚 fixed.
If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!
Hello @jolelievre
I will update PS again with
Ufter this will write about the result, thanks!
I just tested upgrade 1.7.6.4 to 1.7.7.0 with PHP 7.2 and I still can't reproduce the bug
For people who have the issue, could you tell us what is the state of the DB after the upgrade, because since the beginning we mainly guess that it comes from the DB but I'd like to be sure it is actually the real issue ^^
Can you check:
enabled
field has been addedenabled = 1
admin-dev/autoupgrade/tmp/log.txt
file that you can see this line which is responsible for the table update:[OK] SQL 1.7.7.0 /* Doctrine update happens too late to update the new enabled field, so we preset everything here */
ALTER TABLE
ps_tabADD enabled TINYINT(1) NOT NULL
Hello @jolelievre
Is it possible to share some account details with you?
I could set up a test system on cloudways and then you can try the update by yourself.
This is the structure of 1.7.7.0 of ps_tab
[2020-12-07 14:21:38]
ps_tab
ADD enabled TINYINT(1) NOT NULLps_hook
(id_hook
, name
, title
, description
) VALUES
Before I will start the upgade to 1.7.7.0 from 1.7.6.9 I checked PS in the debug mode. And there is such error
I don`t know does it have influence on the upgrade process, but just in case...
@Pitt1823 @photinia73 @Chrisi1321 do you have APC enabled on your php config?
Yes...
[PHP Modules] apc (version 5.1.x)
There is a list of all packages. So I have the standard server config
https://support.cloudways.com/which-base-packages-are-deployed-with-cloudways-server/
In my configuration this module is, but it don`t enabled. Have it be enabled?
I am hosting on Cloudways so my answers are all in line with what @Chrisi1321 has stated so far.
Including the database status after the upgrade and the APC being enabled.
In my case the APC was NOT enable in PHP and
/var/www/tefold/te.com.ua/app/config/parameters.php: 'ps_cache_enable' => false
... so how it can influence on upgrade?....
Closed by #22293 Thanks @atomiix
Most helpful comment
Hi @photinia73 @straitskapitan
Do not rename the column
active
.1 - Be sure you have the
active
column inPREFIX_tab
2 - Make sure you are missing the
enabled
column inPREFIX_tab
3 - If steps (1) and (2) have been verified, then you can execute this request (Replace PREFIX_ by ps_ in your case):