Game Framework
Troubleshooting

Debugging

Tools and techniques for debugging Game Framework issues.

Verbose Mode

Enable verbose logging:

# Flutter pub commands
flutter pub get --verbose
flutter pub publish --dry-run --verbose

# See detailed output
flutter pub publish --verbose --server=https://registry.yourcompany.com

Check Configuration

Verify Environment

# Check environment variables
printenv | grep GF

# Check Flutter version
flutter --version

# Check Dart version
dart --version

Verify Credentials

# Check pub-tokens.json exists
cat ~/.pub-cache/pub-tokens.json

# Test authentication
curl -H "Authorization: Bearer $GF_PUB_TOKEN" \
  https://registry.yourcompany.com/v1/me

Network Debugging

Test Connectivity

# Check registry is reachable
curl -I https://registry.yourcompany.com/health

# Test with verbose curl
curl -v https://registry.yourcompany.com/v1/packages \
  -H "Authorization: Bearer $GF_PUB_TOKEN"

Check DNS

# Resolve hostname
nslookup registry.yourcompany.com

# Trace route
traceroute registry.yourcompany.com

Debug Logs

Enable Debug Logging

# Set log level
export GF_LOG_LEVEL=debug

# Flutter verbose
flutter pub get --verbose 2>&1 | tee pub-get.log

View Registry Logs

# Docker
docker-compose logs -f api

# Kubernetes
kubectl logs -f deployment/gameframework -n gameframework

# Follow logs
kubectl logs -f -l app=gameframework

API Debugging

Raw API Calls

# Debug with curl
curl -X GET https://registry.yourcompany.com/v1/packages \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -v

# Pretty print JSON
curl https://registry.yourcompany.com/v1/packages | jq '.'

Test Endpoints

# Health check
curl https://registry.yourcompany.com/health

# Status
curl https://registry.yourcompany.com/v1/status \
  -H "Authorization: Bearer $TOKEN"

# User info
curl https://registry.yourcompany.com/v1/me \
  -H "Authorization: Bearer $TOKEN"

Common Debug Scenarios

Package Not Installing

# 1. Check package exists
curl https://registry.yourcompany.com/v1/packages/my_package \
  -H "Authorization: Bearer $TOKEN"

# 2. Check permissions
curl https://registry.yourcompany.com/v1/me/permissions \
  -H "Authorization: Bearer $TOKEN"

# 3. Try with verbose
flutter pub get --verbose

Publishing Fails

# 1. Dry run first
flutter pub publish --dry-run --verbose

# 2. Check credentials
echo $GF_PUB_TOKEN

# 3. Test auth
curl https://registry.yourcompany.com/v1/me \
  -H "Authorization: Bearer $GF_PUB_TOKEN"

Support Information

When contacting support, include:

  1. Error message (full output)
  2. Flutter version (flutter --version)
  3. Command used (exact command)
  4. pubspec.yaml (relevant parts)
  5. Verbose output (if applicable)
# Collect debug info
cat > debug-info.txt << EOF
Flutter version: $(flutter --version)
Dart version: $(dart --version)
OS: $(uname -a)
Error: [paste error here]
EOF

Next Steps