Troubleshoot problems with CI/CD integration, authentication, and automated workflows.
GitHub Actions: API Call Fails
Error:
curl: (6) Could not resolve host: bytebase.example.com
Causes:
- Incorrect Bytebase URL
- Network restrictions
- DNS resolution issues
Solutions:
# .github/workflows/gitops.yml
# 1. Verify BB_URL environment variable
- name: Check Bytebase URL
run: echo "Bytebase URL: $BB_URL"
env:
BB_URL: ${{ secrets.BYTEBASE_URL }}
# 2. Test connectivity
- name: Test Connection
run: curl -f $BB_URL/v1/actuator/info
# 3. Use correct authentication
- name: Create Release
run: |
curl -X POST "$BB_URL/v1/projects/my-project/releases" \
-H "Authorization: Bearer $BB_TOKEN" \
-H "Content-Type: application/json" \
-d @release.json
env:
BB_URL: ${{ secrets.BYTEBASE_URL }}
BB_TOKEN: ${{ secrets.BYTEBASE_TOKEN }}
Unauthorized Error
Error:
401 Unauthorized: Invalid token
Causes:
- Token expired or invalid
- Token not properly set in secrets
- Wrong token format
Solutions:
Test token manually:curl -H "Authorization: Bearer $BB_TOKEN" \
$BB_URL/v1/actuator/info
Should return server info, not 401. Regenerate Service Account Token
- Login to Bytebase
- Navigate to Settings → Service Accounts
- Find CI/CD service account
- Generate new token
- Update CI/CD secrets
SQL Review Fails in CI
Error:
SQL review failed: Rule violation - table naming convention
Cause: Migration violates configured SQL review rules.
Solutions:
Option 1: Fix the violation
-- If error: Table name must be lowercase
-- ❌ Wrong
CREATE TABLE UserProfiles (...);
-- ✅ Correct
CREATE TABLE user_profiles (...);
Option 2: Adjust SQL review policy
If rule is too strict:
- Navigate to SQL Review settings
- Adjust rule severity (ERROR → WARNING)
- Or disable rule if not needed
SQL Review Rules
Complete reference of 200+ rules
Option 3: Override for specific case
Add comment justification in SQL:
-- bytebase:ignore-rule table.naming.convention
-- Legacy table name required for compatibility
CREATE TABLE UserProfiles (...);
Review failures prevent bad changes from reaching production. Fix violations rather than bypassing checks.
CI Timeout
Error:
Error: The operation was canceled.
Causes:
- Long-running migration exceeds CI timeout
- Network connectivity issues
- Bytebase server overloaded
Solutions:
Increase Timeout
Optimize Migration
Check Bytebase Status
GitHub Actions:jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30 # Increase from default 360
steps:
- name: Deploy
timeout-minutes: 20 # Step-level timeout
run: ...
GitLab CI:rollout:
timeout: 30m
script:
- bytebase-action rollout ...
Workflow Dispatch Not Triggering
Error: Manual workflow doesn’t start when triggered.
Causes:
- Wrong branch selected
- Insufficient permissions
- Workflow file syntax error
Solutions:
Check workflow configuration:
# .github/workflows/deploy.yml
name: Manual Deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy'
required: true
type: choice
options:
- dev
- staging
- production
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy to ${{ inputs.environment }}
run: echo "Deploying to ${{ inputs.environment }}"
Verify permissions:
- Must have write access to repository
- Workflow must be in default branch
- Actions must be enabled for repository
Secrets Not Available
Error:
Error: Secret BYTEBASE_TOKEN is not set
Solutions:
-
Add secrets to repository:
- Navigate to Settings → Secrets and variables → Actions
- Click “New repository secret”
- Add required secrets
-
Environment-specific secrets:
jobs:
deploy:
runs-on: ubuntu-latest
environment: production # Use environment secrets
steps:
- name: Deploy
env:
BB_TOKEN: ${{ secrets.BYTEBASE_TOKEN }}
-
Organization secrets:
- Can be shared across repositories
- Set at organization level
- Select which repositories can access
Next Steps