View Issue Details

IDProjectCategoryView StatusLast Update
0007112OXID eShop (all versions)5. ------ UpdateApp / Update ------public2020-04-14 07:34
Reporterleofonic Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.2.0 
Fixed in Version6.2.0 
Summary0007112: Module update from 6.1 doesn't work in Windows operating system
DescriptionFollowing these instructions: https://docs.oxid-esales.com/developer/en/6.2/update/index.html

When using Windows operating system, command
composer require --no-interaction oxid-esales/oxideshop-update-component
throws an error:

oxid-esales/oxideshop-composer-plugin: Updating component oxid-esales/oxideshop-update-component
PHP Fatal error: Uncaught Error: Call to undefined method OxidEsales\OxidEshopUpdateComponent\Module\Command\InstallAllModulesConfigurationCommand::getDefaultName() in C:\web\www\myproject\vendor\symfony\console\DependencyInjection\AddConsoleCommandPass.php:61
Additional InformationThe error actually not blocks the update process. It could be ignored in QA tests. However user leofonic provided a fix the error won't occur anymore:
See comment: https://bugs.oxid-esales.com/view.php?id=7112#c13173

[sp]
TagsComponents, Composer, error, Solution Provided, Update App
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2020-04-06 08:23

administrator   ~0013170

Last edited: 2020-04-06 08:27

The issue is reproducable with the current version of the OXVM, while connected to the VM via SSH. Luckily it does not affect the update in a bad way. The error message appears, but the step does not fail actually. The following steps of the update manual can be done correctly without any further errors. The eShop gets updated and runs without any known issues after the update process.

The error occurs on many systems, but not on all. Currently it's difficult to tell the exact circumstances, that lead to this error. We are taking more tests and try to collect further information.

[sp]

ox08152

2020-04-08 15:53

reporter   ~0013171

The error also occurs on our systems and we do not use windows as os, so this is not an os bug.
With the error we cannot finalize the migration from 6.1.x to 6.2.y because the module settings has now to be yaml settings. In order to go on with the OXID version 6.2, this should be fixed.

Here our complete stacktrace:
PHP Fatal error: Uncaught Error: Call to undefined method OxidEsales\OxidEshopUpdateComponent\Module\Command\InstallAllModulesConfigurationCommand::getDefaultName() in /var/www/vhosts/oxid6.weber.digital/httpdocs_oxid_project_ce/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php:61
Stack trace:
#0 /var/www/vhosts/oxid6.weber.digital/httpdocs_oxid_project_ce/vendor/symfony/dependency-injection/Compiler/Compiler.php(140): Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#1 /var/www/vhosts/oxid6.weber.digital/httpdocs_oxid_project_ce/vendor/symfony/dependency-injection/ContainerBuilder.php(789): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 /var/www/vhosts/oxid6.weber.digital/httpdocs_oxid_project_ce/vendor/oxid-esales/oxideshop-ce/source/Internal/Container/ContainerFactory.php(86): Symfony\Component\DependencyInject in /var/www/vhosts/oxid6.weber.digital/httpdocs_oxid_project_ce/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php on line 61

Btw, the error not occurs using --no-plugins and otherwise it occurs after "Generating OXID eShop unified namespace classes ... Done".

leofonic

2020-04-09 10:10

reporter   ~0013173

This can be fixed by adding the commands to the services.yaml of the update component:

services:
  _defaults:
    autowire: true
    public: false

  oxid_esales.oxid_eshop_update_component.command.install_all_modules_configuration_command:
    class: OxidEsales\OxidEshopUpdateComponent\Module\Command\InstallAllModulesConfigurationCommand
    tags:
      - { name: 'console.command', command: 'oe:oxideshop-update-component:install-all-modules' }

  OxidEsales\OxidEshopUpdateComponent\Module\Command\TransferModuleDataToProjectConfigurationCommand:
    class: OxidEsales\OxidEshopUpdateComponent\Module\Command\TransferModuleDataToProjectConfigurationCommand
    tags:
      - { name: 'console.command', command: 'oe:oxideshop-update-component:transfer-module-data' }

  OxidEsales\OxidEshopUpdateComponent\Module\Command\DeleteModuleDataFromDatabaseCommand:
    class: OxidEsales\OxidEshopUpdateComponent\Module\Command\DeleteModuleDataFromDatabaseCommand
    tags:
      - { name: 'console.command', command: 'oe:oxideshop-update-component:delete-module-data-from-database' }

[...]

QA

2020-04-09 11:38

administrator   ~0013175

@ox08152 As said before, the error don't block the update. The error is triggered in one step even while you can clearly verify, that InstallAllModulesConfigurationCommand::getDefaultName() method is present. In the next steps the function is used correctly and the module update can be done successfully.

@leofonic thanks for your information. We will verify your suggestion.

[sp]

ox08152

2020-04-09 12:57

reporter   ~0013176

Extending the command configs in den service.yaml file of the module oxid-esales/oxideshop-update-component like @leofonic proposed solves the issue for us.

QA

2020-04-09 14:40

administrator   ~0013177

I have also tested the suggested fix by @leofonic and can confirm it is working. Therefore I did a pull request. Thank you for that.

[sp]

farzam.tahmasebmirza

2020-04-09 16:52

reporter   ~0013179

Last edited: 2020-04-09 16:52

We already released v1.0.1 of oxideshop-update-component with this fix, It should work.

leofonic

2020-04-09 17:18

reporter   ~0013180

It's working now, thank you!

mario_lorenz

2020-04-09 20:39

developer   ~0013181

Last edited: 2020-04-09 20:48

I also get the Call to undefined method getDefaultName() error, but in the following situation:

I have developed a module of the new module type "oxideshop-component", with which I can extend the "oe: console" with further commands.

During the OXID install phase, in which all modules, themes and components are registered, my components repository is also instantiated at some point.

After this registration, another module is installed, then the script aborts.

In the error log I find that my first component command does not find the getDefaultName method. Since I cannot explain why the inherited (Symfony\Component\Console\Command\Command) method is not found, I have provided the getDefaultName method in my command as a workaround. So now there is no exception and the installation runs smoothly.

I think the problem will occur again and again with the new module type "oxideshop-component". The solution to write the component name in the service.yaml, or to provide the getDefaultName method again in my variant, is not the solution to the problem, since both work against the specifications of the symfony-console-commands.

QA

2020-04-14 07:34

administrator   ~0013182

Hello Mario, since this issue was especially focusing on the update process and the corresponding update component, I would recommend you create a new issue refering to the development of an oxideshop-component.

[sp]