mirror of
https://github.com/suyu-emu/suyu-v0.0.4.git
synced 2026-09-21 14:17:36 -07:00
3.2 KiB
3.2 KiB
Troubleshooting Guide - Forgejo to GitHub Issue Sync
This guide helps resolve common issues with the Forgejo to GitHub issue synchronization.
Common Issues
1. 403 Forbidden Error
Error Message:
Error fetching issues from Forgejo: 403 Client Error: Forbidden for url: https://git.suyu.dev/suyu/suyu/issues
Causes & Solutions:
-
Using web scraping URL instead of API URL
- ❌ Wrong:
https://git.suyu.dev/suyu/suyu/issues - ✅ Correct:
https://git.suyu.dev/api/v1/repos/suyu/suyu/issues
- ❌ Wrong:
-
Repository requires authentication
- Set the
FORGEJO_TOKENenvironment variable - Generate a token in Forgejo: Settings → Applications → Generate New Token
- Set the
-
Repository is private or restricted
- Verify you have access to the repository
- Check if the repository URL is correct
2. No Issues Found
Error Message:
No issues found on Forgejo or failed to fetch issues
Solutions:
-
Check the repository has issues
- Visit the Forgejo repository directly
- Verify there are open issues
-
Verify API endpoint
- Test with:
curl https://git.suyu.dev/api/v1/repos/suyu/suyu/issues - Should return JSON array of issues
- Test with:
-
Check issue state filter
- The script only syncs "open" issues by default
- Modify
SYNC_STATESin config.py to include "closed" if needed
3. GitHub API Errors
Error Message:
Failed to create issue 'Title': 401 Unauthorized
Solutions:
-
Invalid GitHub token
- Verify
GITHUB_TOKENis set correctly - Token needs
reposcope for private repos,public_repofor public repos
- Verify
-
Rate limiting
- The script includes automatic rate limiting
- If you hit limits, wait and try again
4. Duplicate Issues
Issue: Issues are being created multiple times
Solutions:
-
Check duplicate detection logic
- Script checks for both original and prefixed titles
- Verify existing issues are being fetched correctly
-
Manual cleanup
- Close duplicate issues manually
- The script will skip them on next run
Testing Steps
-
Test Forgejo connection:
python scripts/test_forgejo_connection.py -
Test with limited issues:
- Set
MAX_ISSUES_PER_RUN = 1in config.py - Run the script to test with just one issue
- Set
-
Check GitHub API access:
curl -H "Authorization: Bearer $GITHUB_TOKEN" \ https://api.github.com/repos/owner/repo/issues
Getting Help
If you're still experiencing issues:
- Check the GitHub Actions logs for detailed error messages
- Run the standalone script locally for easier debugging
- Verify all environment variables are set correctly
- Test API endpoints manually with curl
Useful Commands
Test Forgejo API:
curl "https://git.suyu.dev/api/v1/repos/suyu/suyu/issues?per_page=1"
Test GitHub API:
curl -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/issues?per_page=1"
Check environment variables:
echo "FORGEJO_URL: $FORGEJO_URL"
echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
echo "GITHUB_TOKEN: ${GITHUB_TOKEN:0:10}..." # Only show first 10 chars