Debugging Of Shopware Updates

Article Version

5.5 or newer

Table of contents

Table s_schema_version

Because the deltas were importet by a php script, the execution and occuring errors are logged in the table s_schema_version. Errors are written into the column error_msg. You can find the deltas in /update-assets/migrations. If they were imported, you can see in the above mentioned database table. Check if every migration got a database entry and see that start_date and end_date are correct timestamps (YYYY-MM-DD HH:MM:SS) and the field error_msg has Null set.

If problems occur at importing the deltas, we recommend to recovery the whole database backup to correct the error. Alternatively you can import the delta manually (execute), in this case you need to set the s_schema_version entry manually too (see above). If the delta is already set in the database, you can set Null in "error_msg" and a corrct timestamp at "end_date", if the upddater runs another time, this delta is ignored. 

 

FAQ

Foreign Key Errors

Frontend:


No mapping found for field '***' on class 'Shopware\Models\Attribute\***'. in vendor/doctrine
 

 

or


 
Fatal error: Cannot redeclare Shopware\Models\Attribute\CustomerGroup::$customerGroup in /var/www/production/shopware/engine/Shopware/Models/Attribute/CustomerGroup.php on line 84
 

 

Backend:


 
Fatal error: Cannot redeclare Shopware\Models\Attribute\User::$user in /var/www/production/shopware/engine/Shopware/Models/Attribute/User.php on line 84
 

 

A possible reason may be broken database table relations, to corect them you can repair the foreign keys. After this, clear the cache manually by deleting the folders /var/cache and web/cache!

 

Maintenance mode won't disappear

The maintenance mode should automatically quit after updating Shopware. If this won't happen, it may cause by insufficient permissions of the php process which executes the update script and tries to delete the update folder to quit the maintenance mode. Grant the user, which executes the update script, more permissions to delete this folder to avoid this problem in future updates. To manually solve this problem, delete the following folder:

At the auto update: /files/update

At the manual update: /update-assets

 

Last seen don't work correctly

If the "last seen" item history won't work (in such cases the footer of the page may be broken. The cause may be lcated in the deduction of your theme. That way, changes from the default theme can't be processed.

Please check the following file: /templates/emotion_meintemplate/frontend/index/index.tpl

Maybe it contains the following code:

 


 
{block name="frontend_index_footer"}
 {if $sLastArticlesShow}
    {action module=widgets controller=lastArticles}
 {/if}
{/block}
 

 

This has to be changed to:


 
{block name="frontend_index_footer"}
 {if $sLastArticlesShow && !$isEmotionLandingPage}
  {include file="frontend/plugins/index/viewlast.tpl"}
 {/if}
{/block}
 

We recommend to check additionally, if the file /templates/_default/frontend/plugins/index/viewlast.tpl is the default one. After that, clear the cache in the backend.

 

initTopSeller?offset=0&limit=15

When you get the error message "Internal Server Error: initTopSeller?offset=0&limit=15" the topseller box was deactivated (chartInterval = 0), this configuration may cause this problem. Just activate the topseller box.

 

The target-entity Shopware\Models\Attribute

The error message "The target-entity Shopware\Models\Attribute\... cannot be found in ..." appears, when the attribute models could not be generated after your update. If possible, clear the whole cache in the backend or use the console command bin/console sw:generate:attributes

 

importDatabase?XXX - Forbidden

When you get the message "importDatabase?offset=XXX&totalCount=XXX - Forbidden" check, if mod_evasive block the requests and deactivate this module if needed.

 

Choose a smaller batch size

If you get the message "Choose a smaller batch size" after an auto update check, if the directory /files contains defective update files e.g. 0 byte files and delete them.

 

Could not apply migration

Error message:


 
Error
Received the following error message:
Could not apply migration: SQLSTATE[HY000]: General error: 1005 Can't create table 'database.#sql-xx_xx' (errno: 121)

Please try to fix this error and restart the update.
Response
{"valid":false,"errorMsg":"Could not apply migration: SQLSTATE[HY000]: General error: 1005 Can't create table 'database.#sql-xx_xx' (errno: 121)"} 

 

In this case one specific migration step can not be procceded. You can find the migration steps in the directory update-assets/migration or on GitHub with the specific migration number. The number of the migration that is causing the error is named in the error message and you can with this you can look into the migration file to check the different queries that will be executed with this migration step.

 

Possible solutions:

  • 1. Database strict mode still active.
  • 2. Foreign keys defective (to the wiki article).
  • 3. Check if you have enough free disk space.
  • 4. System requirements: Database or MySQL version unfulfilled.
  • 5. Error at execute an SQL delta (Checking the table s_schema_version - siehe above).
  • 6. Table is supposed to be created that is already exisiting for example because the database has not been reset before restoring the backup when you encountered an update error once before.

 

SmartyCompilerException

The exception 'SmartyCompilerException' with message 'Syntax Error in template "/x/x/x.tpl"...{s name='IndexXmlLang'}{/s} unknown tag "s" occures when using incomatible plugins. The complete exception can be displayed while activating the debug-mode of shopware : https://developers.shopware.com/developers-guide/shopware-config/#exceptions