Repository navigation
Troubleshooting
Problem: GitHub or GitLab webhook deliveries show 401 responses.
Check:
- Verify
GITHUB_WEBHOOK_SECRETmatches between.envand the GitHub webhook settings - Verify
GITLAB_WEBHOOK_SECRETmatches between.envand the GitLab webhook settings - Regenerate secrets and update both sides if uncertain
- Check hub2lab logs:
Invalid GitHub webhook signatureorInvalid GitLab webhook token
Problem: Webhook deliveries return 400 "Unknown event".
Check:
- hub2lab only processes
push,create,delete, andrepositoryevents from GitHub - hub2lab only processes
pushandtag_pushevents from GitLab - Events like
pull_request,issues,pingare logged as "Unhandled event type" but return 400 - This is harmless — the event is simply ignored
Problem: Pushes on one side don't appear on the other.
Checklist:
-
Tokens — Do
GITHUB_TOKENandGITLAB_TOKENhave the correct scopes?- GitHub:
repo(classic) or Contents read/write (fine-grained) - GitLab:
api,write_repository
- GitHub:
-
Mapping — Is the mapping configured correctly?
- Does
github_orgmatch the org in the webhook payload? - Does
gitlab_groupexist? - If using explicit repos, are the repo names spelled correctly?
- Does
-
Webhook delivery — Check GitHub/GitLab webhook delivery logs for successful deliveries
-
hub2lab logs — Look for error messages:
ERROR] GitHub event processing failed { error: '...' } WARN] GitLab project not found: my-group/my-repo, creating -
Mirror directory — Check if
MIRROR_DIRis writable. hub2lab clones repos to this directory. -
Loop prevention — If commits contain the
SYNC_MARKER(default[hub2lab]), they're intentionally skipped
Problem: hub2lab can't clone the source repository.
Causes:
- Invalid or expired
GITHUB_TOKENorGITLAB_TOKEN - Token doesn't have access to the specific repository
- Network connectivity issues between hub2lab and the git servers
- Repository doesn't exist on the source side (race condition)
Logs to look for:
ERROR] GitHub event processing failed { error: 'Git clone failed: ...' }
Problem: I see files like deletion-branch-feature-x.md appearing in my repos.
Explanation: This is by design. hub2lab never automatically deletes branches, tags, or repos. When a delete event occurs on one side, it writes a marker file to the other side. This prevents accidental data loss.
To complete a deletion:
- Verify the deletion was intentional
- Delete the branch/tag/repo manually on the target side
- Remove the marker file (or it can remain as a record)
Problem: EADDRINUSE error when starting hub2lab.
Solution: Either:
- Stop the process already using port 3000
- Change
PORTin.envto a different value (e.g.,3001) - Update your webhook URLs to match the new port
Problem: Docker container can't write to mounted volumes.
Solution: The container runs as the node user (UID 1000). Ensure mounted directories have correct permissions:
chown -R 1000:1000 /opt/hub2lab/logs
chown -R 1000:1000 /opt/hub2lab/mirrorsSet LOG_LEVEL=debug in .env:
LOG_LEVEL=debugThis logs detailed information about:
- Webhook payload structure
- Mapping resolution attempts
- Git mirror operations
- API call details
hub2lab maintains bare git mirrors under MIRROR_DIR. You can inspect them:
# List mirrors
ls -la /path/to/mirrors/
# Check the remote of a mirror
cd /path/to/mirrors/<hash>
git remote -v
# View recent git activity in a mirror
git log --oneline -10Simulate a GitHub push event:
curl -X POST http://localhost:3000/webhook/github \
-H "Content-Type: application/json" \
-H "X-GitHub-Event: push" \
-H "X-Hub-Signature-256: sha256=$(echo -n '{"ref":"refs/heads/test","repository":{"name":"test-repo","full_name":"test-org/test-repo","owner":{"login":"test-org"}}}' | openssl dgst -sha256 -hmac "$GITHUB_WEBHOOK_SECRET" | cut -d' ' -f2)" \
-d '{"ref":"refs/heads/test","repository":{"name":"test-repo","full_name":"test-org/test-repo","owner":{"login":"test-org"}}}'Simulate a GitLab push event:
curl -X POST http://localhost:3000/webhook/gitlab \
-H "Content-Type: application/json" \
-H "X-GitLab-Token: $GITLAB_WEBHOOK_SECRET" \
-d '{"event_name":"push","ref":"refs/heads/test","project":{"name":"test-repo","path_with_namespace":"test-group/test-repo","namespace":"test-group"}}'If you encounter issues not covered here:
-
Check logs — Review hub2lab logs at
LOG_DIR(default:./logs/) - GitHub Issues — Open an issue at https://github.com/wildfirebill-docker/hub2lab/issues
- Include:
- hub2lab version
- Log output at
debuglevel - Relevant configuration (with secrets redacted)
- Steps to reproduce