Configuration Issues
Missing credentials in .env file
Error:.envfile doesn’t exist.envfile is empty- Required variables are missing
Access token invalid or expired
Error:REFRESH_TOKENis invalidCLIENT_ID/CLIENT_SECRETdon’t match the token- Token was revoked
Regenerate refresh token
Regenerate refresh token
See full guide: Google Drive API Setup
TELEGRAM_API_ID required
Error:Get credentials
- Go to https://my.telegram.org
- Log in with your phone number
- Click “API development tools”
- Create application
- Copy
api_idandapi_hash
Dependency Issues
curl: command not found
Error:jq: command not found
Error:ffprobe: command not found
Error:Script will still work without ffmpeg, but music organization features will be disabled.
Telethon not installed
Error:Download Issues
Download failed
Error:Invalid URL
Invalid URL
Symptoms:
- 404 Not Found
- Connection refused
- Verify URL is correct
- Check if file still exists
- Try opening URL in browser first
Network issues
Network issues
Symptoms:
- Connection timeout
- DNS resolution failed
Authentication required
Authentication required
Symptoms:
- 401 Unauthorized
- 403 Forbidden
- URL requires authentication
- Use Telegram integration for Telegram files
- Download manually first, then upload local file
Telegram: Message not found
Error:- Message doesn’t exist
- Message was deleted
- You don’t have access to the channel
- Link is incorrect
Telegram: No media in message
Error:- Verify the message contains a file
- Try a different message number
- Check in Telegram app first
Telegram: database is locked
Error:Upload Issues
Upload failed with exit code 26
Error:- File path issue
- Special characters in filename
- File doesn’t exist
Quota exceeded
Error:Check storage
Already exists, skipping
Message:To re-upload anyway
To re-upload anyway
- Delete the existing file from Google Drive
- Upload to a different folder
- Rename the file before uploading
To verify it's actually a duplicate
To verify it's actually a duplicate
Check the MD5 checksum:If MD5 matches, it’s the same file.
Music Organization Issues
Music files not organized by artist/album
Symptoms: Music files upload toMusic/ root instead of Music/Artist/Album/.
Possible causes:
ffprobe not installed
ffprobe not installed
Check:Solution:
No metadata in file
No metadata in file
Check:
Run in debug mode:Look for:Solution:
- Add metadata to file using a tag editor
- Or manually specify folder:
--folder "Music/Artist/Album"
Metadata is corrupted
Metadata is corrupted
Check:Solution:
- Re-tag the file
- Download from a different source
Cover art not extracted
Symptoms: Nocover.jpg uploaded with music files.
Possible causes:
ffmpeg not installed
ffmpeg not installed
Solution:
No embedded cover art
No embedded cover art
Check:If fails, file has no embedded cover art.Solution:
- Download/add cover art to file using a tag editor
- Manually upload cover.jpg separately
Cover already exists
Cover already exists
Check output:This is normal - cover is extracted once per album.
Metadata has website spam
Before:HipHopKit.comAudiomack.comSoundCloudSpotifyYouTube- Generic domains
[name].(com|net|org)
Folder Issues
Folder not found, creating fails
Error:Invalid credentials
Invalid credentials
Solution:
Check
.env file has valid CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN.Folder name contains invalid characters
Folder name contains invalid characters
Solution:
Avoid these characters in folder names:
/(forward slash)\(backslash)<>(angle brackets)
Permission issues
Permission issues
Solution:
- Check you have write access to parent folder
- Try creating folder manually in Google Drive web UI
- Verify OAuth scope includes drive access (not just drive.file)
Interactive mode not working
Symptoms:- Arrow keys print characters instead of navigating
- Screen doesn’t update
- Cursor visible during selection
Terminal doesn't support ANSI
Terminal doesn't support ANSI
Solution:
Use a modern terminal:
- Linux: gnome-terminal, konsole, xterm
- macOS: iTerm2, Terminal.app
- Windows: WSL with Windows Terminal
SSH session issues
SSH session issues
Solution:
tmux/screen interference
tmux/screen interference
Solution:
Temp Files Cleanup
Temp files accumulating
Check:- Script was killed (
kill -9) - Terminal closed during operation
- Script interrupted with
Ctrl+Cduring upload
- Cleanup Script
- Manual Cleanup
- System Reboot
No space left on device
Error:Session Issues
Telegram authentication keeps asking for phone
Symptoms: Every run prompts for phone number and code. Cause: Session file not being saved or is corrupted. Solution:Google token refresh fails
Error:Debug Mode
Using debug mode
When troubleshooting any issue, run in debug mode first:- Commands that would run (dry-run)
- API queries and responses
- File paths and metadata
- Duplicate check results
- Upload operations
- Downloads
- Uploads
- API modifications
Getting Help
Collect diagnostic info
Before asking for help, collect this information:Common debug commands
Quick Reference
| Issue | Quick Fix |
|---|---|
| Missing credentials | cp .env.example .env && nano .env |
| Token expired | rm ~/.gdrive_token |
| Telegram auth fails | rm -rf ~/.config/gdrive-ingest/telegram/ |
| Temp files remain | ./cleanup_temp.sh |
| No space left | df -h /tmp && ./cleanup_temp.sh |
| Upload fails | ./gdrive_ingest.sh --debug url.mp3 |
| Music not organized | sudo apt install ffmpeg (or brew install ffmpeg) |
| Duplicate files | Delete from Drive or upload to different folder |
Next Steps
Setup Guide
Complete setup instructions
Google Drive API
Fix credential issues
Telegram Integration
Fix Telegram issues
Usage Examples
See working examples