Common issues and solutions when working with Git DRS.
Navigation: Getting Started → Commands Reference → Troubleshooting
No. git drs init is set up once per Git repo.
Run it once when:
- You first clone a repository
- You create a new repository
Don't run it again:
- At the start of each work session
- After refreshing credentials
- After pulling updates
What it does:
- Sets up
.drs/directory structure - Configures Git LFS hooks
- Updates
.gitignore
These changes persist in your local repository. For subsequent sessions, you only need to refresh credentials if they've expired (every 30 days).
Running git drs init a second time is usually harmless but unnecessary. It may re-create the \.git/drs/`directory, re-install hooks, or modify`.gitattributes`and`.gitignore``. If you ran it accidentally, follow these steps:
-
Inspect what changed
git statusgit diff(orgit diff -- <file>for a specific file, e.g.\.gitignore``)
-
If changes are fine
- No action required; commit the intended changes or leave them uncommitted.
-
If you want to discard uncommitted changes
- Restore specific files:
git restore --staged \.gitignore`&&git restore `.gitignore`` - Restore all working-tree changes:
git restore . - Or (destructive) reset everything:
git reset --hard- use with caution.
- Restore specific files:
-
If you already committed the unintended changes
- Undo the last commit but keep changes staged:
git reset --soft HEAD~1 - Or remove the commit and working changes:
git reset --hard HEAD~1- use with caution. - See the "Undo Last Commit" section above for alternatives.
- Undo the last commit but keep changes staged:
-
Hooks or credentials issues
- If hooks were replaced or credentials need refresh, run
git drs initwith the correct--cred/--profileoptions, or re-add the remote withgit drs remote add.
- If hooks were replaced or credentials need refresh, run
Summary: inspect with git status/git diff, then either accept, manually edit, or revert the changes using standard git restore / git reset commands.
Understanding when to use Git, Git LFS, or Git DRS commands:
Use for: Repository and remote configuration
git drs init- Initialize Git LFS hooksgit drs remote add- Configure DRS server connectionsgit drs remote list- View configured remotesgit drs add-url- Add cloud object references
When:
- Setting up a new repository
- Adding/managing DRS remotes
- Refreshing expired credentials
- Adding external file references
Use for: File tracking and management
git lfs track- Define which files to trackgit lfs ls-files- See tracked files and statusgit lfs pull- Download specific filesgit lfs untrack- Stop tracking file patterns
When:
- Managing which files are stored externally
- Downloading specific files
- Checking file localization status
Use for: Version control operations
git add- Stage files for commitgit commit- Create commitsgit push- Upload commits and trigger file uploadsgit pull- Get latest commits
When:
- Normal development workflow
- Git DRS runs automatically in the background
The checks below prioritize Git LFS guidance and documentation because Git DRS relies on Git LFS for large-file handling. If you run into issues, start with the Git LFS troubleshooting docs and logs, then move to Git DRS-specific configuration checks. Primary references: the Git LFS troubleshooting guide and the Git LFS documentation for installation, tracking, and environment variables:
- Git LFS troubleshooting: https://github.com/git-lfs/git-lfs/wiki/Troubleshooting
- Git LFS docs: https://github.com/git-lfs/git-lfs/tree/main/docs
-
Confirm Git LFS is installed and hooks are active
- Run:
git lfs versionandgit lfs env - If
git lfs envreportsgit lfs installis needed, rungit lfs installto re-install hooks. - This is the most common cause of commits failing to convert large files into LFS pointers.
- Run:
-
Check whether the file was tracked before the commit
- Run:
git lfs trackand confirm the file pattern is listed. - If not tracked, add it (
git lfs track "*.bam") and stage.gitattributes.
- Run:
-
Verify the file is staged as an LFS pointer
- Run:
git lfs ls-filesto confirm the file is listed. - If a large file was added to Git history directly, remove it from the index and re-add it after tracking.
- Run:
-
Review Git LFS logs for hook errors
- Run:
git lfs logs lastto inspect hook failures. - Common errors include missing filters or file locking issues.
- Run:
-
Check Git LFS authentication and endpoint configuration
- Run:
git lfs envand confirmEndpointvalues are correct. - If tokens are expired, refresh credentials and re-run the push.
- Run:
-
Retry with LFS verbose logging
- Run:
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs push --all - Use this output to identify
403/401auth issues or proxy errors.
- Run:
-
Confirm the LFS objects exist locally
- Run:
git lfs ls-filesand ensure your large files are listed. - Missing objects indicate a tracking or filter issue before the push.
- Run:
-
Validate the remote supports Git LFS
- Run:
git lfs envto confirm the remote endpoint. - Some Git servers require explicit LFS enablement or URL configuration.
- Run:
-
Confirm LFS objects were fetched
- After clone, run:
git lfs pullto fetch large files. - If the repo only has LFS pointers, you will see pointer files until you pull.
- After clone, run:
-
Check LFS smudge/clean filters
- Run:
git lfs envand verifygit-lfsfilters are enabled. - If not, run
git lfs installand re-rungit lfs pull.
- Run:
-
Validate access and authentication
git lfs envwill show which endpoint is used; 401/403 errors point to invalid credentials.
-
Inspect LFS logs for download errors
- Run:
git lfs logs lastfor the most recent transfer errors.
- Run:
-
Run
git lfs pullseparately- This isolates LFS download errors from Git merge errors.
-
Check LFS file locking or concurrent transfers
- If your Git host uses LFS file locking, verify the file is not locked by another user.
-
Review filters and tracking
- Run:
git lfs trackto ensure required patterns are present. - If a file type is newly tracked, re-run
git add .gitattributesand commit.
- Run:
-
Check for storage or bandwidth limits
- Some Git LFS hosts enforce quotas; errors will show in
git lfs logs last.
- Some Git LFS hosts enforce quotas; errors will show in
Error: Upload error: 403 Forbidden or 401 Unauthorized
Cause: Expired or invalid credentials
Solution:
# Download new credentials from your data commons
# Then refresh them by re-adding the remote
git drs remote add gen3 production \
--cred /path/to/new-credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucketPrevention:
- Credentials expire after 30 days
- Set a reminder to refresh them regularly
Error: Upload error: 503 Service Unavailable
Cause: DRS server is temporarily unavailable or credentials expired
Solutions:
- Wait and retry the operation
- Refresh credentials:
git drs remote add gen3 production \ --cred /path/to/credentials.json \ --url https://calypr-public.ohsu.edu \ --project my-project \ --bucket my-bucket - If persistent, download new credentials from the data commons
Error: net/http: TLS handshake timeout
Cause: Network connectivity issues
Solution:
- Simply retry the command
- These are usually temporary network issues
Error: Git push timeout during large file uploads
Cause: Long-running operations timing out
Solution: Add to ~/.ssh/config:
Host github.com
TCPKeepAlive yes
ServerAliveInterval 30
Error: Files not being tracked by LFS
Symptoms:
- Large files committed directly to Git
git lfs ls-filesdoesn't show your files
Solution:
# Check what's currently tracked
git lfs track
# Track your file type
git lfs track "*.bam"
git add .gitattributes
# Remove from Git and re-add
git rm --cached large-file.bam
git add large-file.bam
git commit -m "Track large file with LFS"Error: [404] Object does not exist on the server
Symptoms:
- After clone, git pull fails
Solution:
# confirm repo has complete configuration
git drs list-config
# init your git drs project
git drs init --cred /path/to/cred/file --profile <name>
# attempt git pull again
git lfs pull -I path/to/fileError: git lfs ls-files shows files but they won't download
Cause: Files may not have been properly uploaded or DRS records missing
Solution:
# Check repository status
git drs list-config
# Try pulling with verbose output
git lfs pull -I "problematic-file*" --verbose
# Check logs
cat .git/drs/*.logError: git drs remote list shows empty or incomplete configuration
Cause: Repository not properly initialized or no remotes configured
Solution:
# Initialize repository if needed
git drs init
# Add Gen3 remote
git drs remote add gen3 production \
--cred /path/to/credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucket
# Verify configuration
git drs remote listError: Configuration exists but commands fail
Cause: Mismatched configuration between global and local settings, or expired credentials
Solution:
# Check configuration
git drs remote list
# Refresh credentials by re-adding the remote
git drs remote add gen3 production \
--cred /path/to/new-credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucketError: no default remote configured
Cause: Repository initialized but no remotes added yet
Solution:
# Add your first remote (automatically becomes default)
git drs remote add gen3 production \
--cred /path/to/credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucketError: default remote 'X' not found
Cause: Default remote was deleted or configuration is corrupted
Solution:
# List available remotes
git drs remote list
# Set a different remote as default
git drs remote set staging
# Or add a new remote
git drs remote add gen3 production \
--cred /path/to/credentials.json \
--url https://calypr-public.ohsu.edu \
--project my-project \
--bucket my-bucketError: Commands using wrong remote
Cause: Default remote is not the one you want to use
Solution:
# Check current default
git drs remote list
# Option 1: Change default remote
git drs remote set production
# Option 2: Specify remote for single command
git drs push staging
git drs fetch productionIf you accidentally tracked the wrong files:
# See current tracking
git lfs track
# Remove incorrect pattern
git lfs untrack "wrong-dir/**"
# Add correct pattern
git lfs track "correct-dir/**"
# Stage the changes
git add .gitattributes
git commit -m "Fix LFS tracking patterns"Remove files from staging area:
# Check what's staged
git status
# Unstage specific files
git restore --staged file1.bam file2.bam
# Unstage all files
git restore --staged .To retry a commit with different files:
# Undo last commit, keep files in working directory
git reset --soft HEAD~1
# Or undo and unstage files
git reset HEAD~1
# Or completely undo commit and changes (BE CAREFUL!)
git reset --hard HEAD~1If you committed large files directly to Git by mistake:
# Remove from Git history (use carefully!)
git filter-branch --tree-filter 'rm -f large-file.dat' HEAD
# Then track properly with LFS
git lfs track "*.dat"
git add .gitattributes
git add large-file.dat
git commit -m "Track large file with LFS"# Git DRS version and help
git-drs version
git-drs --help
# Configuration
git drs remote list
# Repository status
git status
git lfs ls-files# Git DRS logs (in repository)
ls -la .git/drs/
cat .git/drs/*.log# Test basic Git operations
git lfs pull --dry-run
# Test DRS configuration
git drs remote listWhen reporting issues, include:
# System information
git-drs version
git lfs version
git --version
# Configuration
git drs remote list
# Recent logs
tail -50 .git/drs/*.log- Test in small batches - Don't commit hundreds of files at once
- Verify tracking - Always check
git lfs ls-filesafter adding files - Use .gitignore - Prevent accidental commits of temporary files
- Monitor repository size - Keep an eye on
.gitdirectory size