I've created my uninstall class/script.
After install 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:
After 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 steup_module table and algo the custom table was deleted from database.
My composer keys are stored at my personsal auth.json file too.
Someone knows why I'm getting this message and why the uninstall process isn't finishing correctly.
Solved! Go to Solution.
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 .