1

I've created my uninstall class/script.

After installing my sample module using composer I can see the module working.

Then, I try to uninstall the module using:

bin/magento module:uninstall Barbanet_SampleModule

And I see this message:

You are about to remove code and/or database tables. Are you sure?[y/N]y

Enabling maintenance mode

You are about to remove a module(s) that might have database data. Do you want to remove the data from database?[y/N]y

You are removing data without a database backup.
Removing data of Barbanet_SampleModule
Removing Barbanet_SampleModule from module registry in database
Removing Barbanet_SampleModule from module list in deployment configuration
Removing code from Magento codebase:

Then I press enter a few times I got this message:

Command "remove" failed: Loading composer repositories with package information
    Authentication required (repo.magento.com):
      Username:       Password: 



  [Composer\Downloader\TransportException]                                     
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.  



remove [--dev] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [packages1] ... [packagesN]



Please disable maintenance mode after you resolved above issues.

My module was removed from composer.json, also was deleted from the steup_module table and also the custom table was deleted from the database.

My composer keys are stored at my personal auth.json file too.

Someone knows why I'm getting this message and why the uninstall process isn't finishing correctly.

Mohit Kumar Arora
  • 9,951
  • 7
  • 27
  • 55
Barbanet
  • 376
  • 4
  • 9
  • The solution is to run : composer update in an other console – lalit mohan Oct 08 '16 at 08:56
  • That command will remove my module and then will update (possibly) all the other modules. I'm trying to understand why the native command fails and how to avoid the error. – Barbanet Oct 08 '16 at 15:38

3 Answers3

0

Alan Storm point me to this link on GitHub: Issue #2523

It seems that Magento reads the composer credentials from var/composer_home.

One solution is to create a symbolic link inside var/composer_home with:

ln -s ~/.composer/auth.json .
Barbanet
  • 376
  • 4
  • 9
  • Have you found a bug report for this? module:uninstall should by symmetrical to module:install – Kristof at Fooman Oct 08 '16 at 22:01
  • do you have the sample module online somewhere? happy to post this as an issue report – Kristof at Fooman Oct 08 '16 at 22:21
  • Hi Kristof! You'll fin the sample module here: https://packagist.org/packages/barbanet/magento2-samplemodule

    Also you'll find this issue description usefull: https://github.com/magento/magento2/issues/2523#issuecomment-162534708

    – Barbanet Oct 08 '16 at 23:46
  • Also a simple post (however, in spanish): http://www.damianculotta.com.ar/2016/10/08/desinstalar-modulos-y-sus-tablas-con-los-scripts-de-desinstalacion-en-magento2/ – Barbanet Oct 08 '16 at 23:50
  • Thanks I just looked further into this. I initially thought Magento does something different in the uninstall command to the install command - turns out there is no module:install command in the first place. – Kristof at Fooman Oct 09 '16 at 04:58
0

Below are the steps to Uninstall Module Manually for Magento 2

  • Delete the Module folder from {folder path}\app\code
  • Remove module entry from database table setup_module
  • Run command

    go to mangeto root in command prompt like http://prntscr.com/flx68n (go as per your folder drive)
    then run command like : php bin/magento setup:upgrade then clear cache like : php -f bin/magento cache:flush

megi
  • 125
  • 4
0

Composer stoped in load data from repo.magento.com

My auth.json was not correct. This decision helped me

config http-basic.repo.magento.com <public_key> <private_key>

How to use the new repo.magento.com

vichen
  • 1
  • 2