-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Resolving module:uninstall hanging without response #32955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tschallacka
wants to merge
1
commit into
magento:2.4-develop
Choose a base branch
from
tschallacka:meaningfull-error-uninstall-missing-auth-json
base: 2.4-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it's ok to make the auth.json mandatory? I don't think so, as we might set the credentials globally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have set my auth.json globally, via ~/.composer/auth.json and that works fine when a manual
~ composer update
or~ composer remove xxx
is run. But when this composer sub process is started up, via the~ bin/magento module:uninstall
it doesn't read from ~/.composer/auth.json for whatever reason, which then leads to the bug as is set out in the related issue as it prompts for the password behind the scenes. It only continues on when the data is present in the auth.json file.I've made a dummy repo here of the plugin that demonstrates the issue. https://github.com/tschallacka/mage2-dummy-test
When there is an auth.json in the root it runs fine, as is highlighted in my blog post. If there is no auth.json in the root, it hangs and gives issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the issue is related to incorrect composer usage, so it's not reading the global auth.json file. The correct fix should fix this inconsistent behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be amenable to make a more comprehensive test if you could point me to where the wrapped composer instance tries to read auth.json and when it fails, if you have a better suggested course of action, to prevent the hanging screen i'm open. Just an error message like in my plugin perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know exactly where that code located, but it looks like the composer remove logic is here:
magento2/lib/internal/Magento/Framework/Composer/Remove.php
Lines 41 to 52 in 8b9fff5
Please set the breakpoint on this code and debug deeper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally agree, that composer should read auth.json anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihor-sviziev if you read my blog post at https://blog.tschallacka.de/2021/05/binmagento-moduleuninstall-never.html you can follow my tracking process how I traced the composer path related to the output. I never delved into the actual process of composer itself as it takes so many twists and turns that after 15 minutes of pressing step into I still wasn't at the auth.json search steps. I must admit I kinda gave up.