Fix: Properly propagate git authentication errors in fetch/import operations#10998
Open
paipeline wants to merge 2 commits intotreeverse:mainfrom
Open
Fix: Properly propagate git authentication errors in fetch/import operations#10998paipeline wants to merge 2 commits intotreeverse:mainfrom
paipeline wants to merge 2 commits intotreeverse:mainfrom
Conversation
…rations Fixes treeverse#10992 When git authentication fails during DVC fetch or import operations, authentication errors were being silently converted to generic SCM errors or not propagated at all, causing DVC to report 'Everything is up to date' instead of the actual authentication failure. Changes: - Enhanced _pull() function to catch AuthError and convert to GitAuthError - Updated clone() function to preserve authentication error details - Added proper error chaining with 'from exc' for better debugging This ensures that users get clear feedback when their PAT tokens or credentials are incorrect, instead of misleading success messages.
|
paipeline seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10998 +/- ##
==========================================
+ Coverage 90.68% 90.97% +0.28%
==========================================
Files 504 505 +1
Lines 39795 41114 +1319
Branches 3141 3258 +117
==========================================
+ Hits 36087 37402 +1315
- Misses 3042 3074 +32
+ Partials 666 638 -28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #10992
Problem
When git authentication fails during DVC fetch or import operations (e.g., with incorrect PAT tokens), authentication errors were being silently converted to generic SCM errors or not propagated at all. This caused DVC to report misleading messages like 'Everything is up to date' instead of the actual authentication failure.
Root Cause
_pull()function:git.fetch()andfetch_all_exps()calls could raiseAuthErrorbut these weren't being caught and converted to DVC'sGitAuthErrorclone()function:AuthErrorfrom git operations was being caught as genericInternalCloneErrorand converted to a genericCloneError('SCM error'), losing authentication contextSolution
_pull()function to catchAuthErrorfrom bothgit.fetch()andfetch_all_exps()calls and convert them toGitAuthErrorclone()function to specifically catchAuthErrorbefore genericInternalCloneErrorand preserve authentication error detailsfrom excfor better debugging and error traceabilityTesting
AuthErroris properly converted toGitAuthErrorwith correct error messagesImpact
This is a critical fix for production DVC workflows where authentication failures need to be clearly reported rather than silently ignored.