Troubleshooting Airbase Deployments¶
Comprehensive troubleshooting guide for common Airbase deployment and runtime issues.
Quick Navigation
Use the table of contents to jump directly to your issue category, or follow the Quick Diagnostics section to identify where your problem occurred.
How to Use This Guide¶
Finding Your Issue¶
- Know where it failed - Installation? Build? Deploy? Runtime?
- Check the Quick Diagnostics section below for a decision tree
- Jump to the relevant section for detailed troubleshooting
- Follow the solution steps for your specific issue
Before You Start¶
Gather this information:
- Error messages (full text)
- Command you ran
- Your
airbase.jsonconfiguration - Your
Dockerfile(first 20 lines) - Docker version:
docker --version - CLI version:
airbase --version
Quick Diagnostics¶
Where did the problem occur?
┌─────────────────────────────────────────┐
│ Where did the failure occur? │
└─────────────────────────────────────────┘
│
┌───────────┼───────────┐
│ │ │
Installing Building Deploying
CLI Image App
│ │ │
↓ ↓ ↓
Section A Section B Section C
│
┌───────────┴───────────┐
│ │
App Deployed App Running
But Not Working But Has Issues
│ │
↓ ↓
Section D Section E
(Runtime) (Performance)
Quick Links:
- Section A: Installation & Setup
- Section B: Build Issues
- Section C: Deployment Issues
- Section D: Runtime & Application Issues
- Section E: Performance Issues
Section A: Installation & Setup Issues¶
Problems installing the CLI or setting up your development environment.
Issue A1: CLI Command Not Found¶
Error:
Cause: npm global bin directory not in PATH
Solution:
-
Find npm global bin directory:
-
Add to PATH in your shell profile:
For bash (~/.bashrc or ~/.bash_profile):
For zsh (~/.zshrc):
-
Reload shell:
-
Verify installation:
Alternative: Reinstall with correct permissions:
Issue A2: npm Permission Errors¶
Error:
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied
Cause: Insufficient permissions to write to global npm directory
Solution:
Use sudo for global installation:
Alternative: Fix npm permissions (advanced):
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc
source ~/.zshrc
Then install without sudo:
Issue A3: Docker Not Running¶
Error:
Cause: Docker daemon is not started
Solution (macOS/Windows - Docker Desktop):
- Open Docker Desktop application
- Wait for Docker to start (icon appears in menu bar/system tray)
- Verify Docker is running:
Solution (Linux):
Solution (macOS - Colima):
Verify:
Issue A4: Authentication Failed¶
Error:
Cause: Token expired or invalid
Solution:
-
Run
airbase loginagain: -
Open the URL in your browser
- Confirm authentication
- Name your token
- Verify success:
If still failing:
- Check you're logging in with correct account (TechPass or email)
- Verify you have access to Airbase Console
- Try clearing credentials:
Issue A5: Node.js or npm Not Installed¶
Error:
Cause: Node.js/npm not installed
Solution (macOS - Homebrew):
Solution (macOS - Direct Download):
- Visit https://nodejs.org
- Download LTS version (.pkg installer)
- Run installer
- Verify:
Solution (Linux - Ubuntu/Debian):
Solution (Linux - CentOS/RHEL):
Section B: Build Issues¶
Problems building your container image.
Issue B1: Dockerfile Not Found¶
Error:
Error: Dockerfile not found
unable to prepare context: unable to evaluate symlinks in Dockerfile path
Cause: No Dockerfile in current directory
Solution:
-
Verify you're in the correct directory:
-
Check for Dockerfile:
-
Create Dockerfile if missing - see examples:
- Node.js Example
- Python Example
- Dockerfile Requirements
Issue B2: Permission Denied in Container¶
Error:
Step 5/10 : COPY app.py ./
ERROR: failed to solve: failed to compute cache key: failed to walk /var/lib/docker/...:
lstat ...: permission denied
Cause: Missing --chown=app:app in COPY commands
Solution:
Update Dockerfile to use --chown=app:app:
❌ Wrong:
✅ Correct:
Also ensure USER directive:
Issue B3: Build Fails - File Not Found¶
Error:
Cause: File doesn't exist or is excluded by .dockerignore
Solution:
-
Verify file exists:
-
Check
.dockerignore(if it exists): -
Remove exclusion or move file to included location
-
Verify file paths in Dockerfile are relative to project root
Issue B4: Base Image Pull Failed¶
Error:
failed to solve with frontend dockerfile.v0: failed to create LLB definition:
failed to pull base image: gdssingapore/airbase:node-22: not found
Cause: Wrong base image name or network issue
Solution:
-
Check base image name spelling:
-
Verify available images at Base Images Catalog
-
Check Docker Hub connectivity:
-
Retry build if network issue
Issue B5: npm install or pip install Fails¶
Error (Node.js):
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /app/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
Error (Python):
Cause: Files copied in wrong order or not copied at all
Solution (Node.js):
FROM gdssingapore/airbase:node-22-builder AS builder
WORKDIR /app
# Copy package files FIRST
COPY --chown=app:app package.json package-lock.json* ./
# THEN run install
RUN npm install
# THEN copy application files
COPY --chown=app:app . ./
Solution (Python):
FROM gdssingapore/airbase:python-3.13
# Copy requirements FIRST
COPY --chown=app:app requirements.txt ./
# THEN run install
RUN pip install -r requirements.txt
# THEN copy application files
COPY --chown=app:app . ./
Issue B6: Build Timeout or Too Slow¶
Problem: Build takes >10 minutes or times out
Cause: Large files, no layer caching, or slow network
Solution:
- Add
.dockerignoreto exclude unnecessary files:
- Use multi-stage builds to reduce final image size:
FROM gdssingapore/airbase:node-22-builder AS builder
# ... build steps ...
FROM gdssingapore/airbase:node-22
COPY --from=builder /app/dist ./dist
- Order commands for better caching:
- Copy dependency files first
- Run install
-
Copy application code last
-
Check network connection
Issue B7: Port Already in Use (Local Testing)¶
Error:
Cause: Port 3000 already in use by another process
Solution:
- Find process using the port:
macOS/Linux:
Windows:
- Stop the process or use different port:
Section C: Deployment Issues¶
Problems deploying your built container to Airbase.
Issue C1: airbase.json Not Found¶
Error:
Cause: No airbase.json in current directory
Solution:
-
Create
airbase.jsonusing CLI (recommended): -
Or create manually:
-
Verify file exists:
Issue C2: Invalid Project Handle¶
Error:
Cause: Project doesn't exist or you don't have access
Solution:
-
Log in to Airbase Console
-
Navigate to your project
-
Copy the exact project handle (format:
team-name/project-name) -
Update
airbase.json: -
Or run
airbase configureto select from available projects
Common mistakes:
- ❌ Using uppercase:
Team/Project - ❌ Using spaces:
team name/project - ❌ Using underscores:
team_name/project - ✅ Correct format:
team-name/project-name
Issue C3: Directory Name Contains Uppercase or Spaces¶
Error:
Cause: Project directory has uppercase letters or spaces
Solution:
Rename directory:
# Wrong
cd MyProject
cd "My Project"
# Correct - rename
cd ..
mv MyProject myproject
mv "My Project" my-project
cd myproject
Issue C4: Port Mismatch¶
Problem: Deployment succeeds but application not accessible
Cause: Port in airbase.json doesn't match application's listening port
Solution:
Ensure consistency between airbase.json and application code:
airbase.json:
Application (Node.js):
Application (Python):
Issue C5: Deployment Hangs or Times Out¶
Problem: airbase container deploy hangs indefinitely
Cause: Network issue, large image, or platform issue
Solution:
-
Check your network connection
-
Verify image was built successfully:
-
Try deploying again with
--yesflag: -
If still hanging, check Airbase Console for deployment status
-
Try deploying to staging first:
Issue C6: Invalid JSON in airbase.json¶
Error:
Cause: Malformed JSON (missing comma, trailing comma, etc.)
Solution:
-
Validate JSON syntax:
-
Common mistakes:
❌ Trailing comma:
❌ Missing comma:
✅ Correct:
- Or regenerate with CLI:
Issue C7: Wrong Environment Deployed¶
Problem: Deployed to wrong environment (e.g., production instead of staging)
Cause: Didn't specify environment or used wrong command
Solution:
Always specify environment explicitly:
# Deploy to staging
airbase container deploy --yes staging
# Deploy to development
airbase container deploy --yes development
# Deploy to production (default)
airbase container deploy --yes
To fix:
-
Deploy to correct environment:
-
Destroy deployment from wrong environment:
Section D: Runtime & Application Issues¶
Application deployed successfully but not working correctly.
Issue D1: 502 Bad Gateway¶
Error: Browser shows "502 Bad Gateway"
Cause: Application not listening on correct port or crashed
Solution:
-
Check Airbase Console logs for errors
-
Verify PORT environment variable usage:
Node.js:
Python:
-
Ensure port in
airbase.jsonmatches application port -
Check application starts successfully (view logs in Console)
Issue D2: Application Not Accessible¶
Problem: Deployment successful but URL returns error
Cause: Multiple possible causes
Solution - Check URL format:
Correct URL format:
# Production (default environment)
https://PROJECT-NAME.app.tc1.airbase.sg
# Staging environment
https://staging--PROJECT-NAME.app.tc1.airbase.sg
# Custom environment
https://ENV-NAME--PROJECT-NAME.app.tc1.airbase.sg
Common mistakes:
- ❌ Using team name:
https://team-name.app.tc1.airbase.sg - ❌ Wrong separator:
https://staging-PROJECT-NAME.app.tc1.airbase.sg - ✅ Correct:
https://staging--PROJECT-NAME.app.tc1.airbase.sg(note double dash)
Solution - Check logs:
- Go to Airbase Console
- Navigate to your project
- Select environment
- View logs for errors
- Fix errors in code and redeploy
Issue D3: JavaScript Not Working (CSP Violations)¶
Symptoms:
- Buttons don't respond
- Forms don't submit
- Dynamic content doesn't load
- Browser console shows CSP errors
Cause: Content Security Policy violations
Solution:
-
Open browser console (F12)
-
Look for red CSP errors:
-
Follow Troubleshoot CSP Violations guide
-
Fix violations:
- Move inline scripts to external files
- Remove inline event handlers
-
Remove
eval()usage -
Test locally first: Test CSP Locally
-
Redeploy after fixing
Issue D4: Environment Variables Not Loading¶
Problem: process.env.DATABASE_URL is undefined
Cause: .env file issues or wrong environment
Solution:
- Check
.envfile exists and has correct naming:
- Verify
.envfile format:
# ✅ Correct
DATABASE_URL=postgresql://...
API_KEY=secret123
# ❌ Wrong - no spaces around =
DATABASE_URL = postgresql://...
-
Ensure
.envfile is in project root (same directory asairbase.json) -
Verify you deployed to correct environment:
-
Check environment variables in application code:
Node.js:
Python:
See: Set Environment Variables
Issue D5: Application Crashes Immediately¶
Problem: Deployment succeeds but application crashes
Solution:
- Check logs in Airbase Console:
- Go to Console → Project → Environment → Logs
-
Look for error messages
-
Common crash causes:
Missing dependencies:
Fix: Add to package.json or requirements.txt
Permission errors:
Fix: Ensure --chown=app:app in Dockerfile
Port binding errors:
Fix: Check application listens on process.env.PORT
Syntax errors:
Fix: Test locally first, fix syntax
-
Test locally with Docker:
-
Fix issues and redeploy:
Issue D6: Static Assets Not Loading¶
Problem: HTML loads but CSS/JS/images don't load
Cause: Wrong paths or not copied to container
Solution:
- Check paths in HTML:
❌ Wrong - absolute paths:
✅ Correct - relative paths:
Or configure web server to serve /static directory
- Verify files copied in Dockerfile:
- Check Express static middleware (Node.js):
- Check Flask static folder (Python):
Issue D7: Database Connection Failed¶
Problem: Can't connect to external database
Cause: Wrong connection string or network issue
Solution:
- Verify connection string in
.env:
- Check database host is accessible from Airbase:
- Database must be publicly accessible or on same network
-
Cannot connect to
localhostfrom container -
Use correct host:
❌ Wrong:
✅ Correct:
-
Check database credentials
-
Test connection in application startup:
// Node.js
const client = new Client({ connectionString: process.env.DATABASE_URL });
client.connect()
.then(() => console.log('Connected to database'))
.catch(err => console.error('Database connection failed:', err));
Issue D8: CORS Errors¶
Problem: API calls from frontend fail with CORS errors
Error in browser console:
Access to fetch at 'https://api.example.com' from origin 'https://myapp.app.tc1.airbase.sg'
has been blocked by CORS policy
Cause: Backend doesn't allow requests from your domain
Solution:
Add CORS headers in your backend:
Node.js/Express:
const cors = require('cors');
app.use(cors({
origin: 'https://myapp.app.tc1.airbase.sg',
credentials: true
}));
Python/Flask:
from flask_cors import CORS
app = Flask(__name__)
CORS(app, origins=['https://myapp.app.tc1.airbase.sg'])
Python/FastAPI:
from fastapi.middleware.cors import CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=['https://myapp.app.tc1.airbase.sg'],
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*'],
)
Section E: Performance Issues¶
Application works but has performance problems.
Issue E1: Out of Memory Errors¶
Error in logs:
Cause: Instance too small for application
Solution:
Upgrade instance type in airbase.json:
{
"framework": "container",
"handle": "team/project",
"port": 3000,
"instanceType": "b.small" ← Changed from "nano"
}
Redeploy:
Instance types:
| Type | vCPU | Memory | Use Case |
|---|---|---|---|
nano | 0.25 | 500 MB | Small apps, static sites |
b.small | 0.5 | 1 GB | Standard web apps, APIs |
See: Instance Types
Issue E2: Application Running Slow¶
Problem: Pages load slowly or timeout
Cause: Under-resourced instance or inefficient code
Solution:
- Upgrade instance type:
- Check logs for performance issues:
- Database query times
- API response times
-
Memory usage
-
Optimize application:
- Add database indexes
- Cache expensive operations
- Optimize queries
-
Reduce bundle size (frontend)
-
Monitor in Airbase Console:
- CPU usage
- Memory usage
- Response times
Issue E3: High CPU Usage¶
Problem: Application using 100% CPU
Cause: Infinite loop, inefficient code, or too many requests
Solution:
-
Check logs for errors
-
Review recent code changes
-
Look for:
- Infinite loops
- Recursive functions without base case
- Unoptimized algorithms
-
Memory leaks
-
Upgrade instance if needed:
Issue E4: Container Restarting Frequently¶
Problem: Application keeps restarting (check Console)
Cause: Crashes, health check failures, or memory issues
Solution:
-
Check logs for crash reason
-
Common causes:
- Out of memory → Upgrade instance
- Uncaught exceptions → Add error handling
-
Port binding issues → Check PORT usage
-
Add error handling:
Node.js:
process.on('uncaughtException', (err) => {
console.error('Uncaught exception:', err);
});
process.on('unhandledRejection', (err) => {
console.error('Unhandled rejection:', err);
});
Python:
import logging
logging.basicConfig(level=logging.ERROR)
try:
# Application code
except Exception as e:
logging.error(f'Application error: {e}')
Getting Additional Help¶
Check Airbase Console Logs¶
Logs are your best friend for troubleshooting:
- Go to Airbase Console
- Select your project
- Select environment
- View logs
- Look for error messages
Review Documentation¶
For specific issues:
- CSP problems: Troubleshoot CSP Violations
- Environment variables: Set Environment Variables
- Dockerfile issues: Dockerfile Requirements
- Configuration: airbase.json Reference
- Deployment: Build and Deploy
Test Locally First¶
Before deploying, test locally:
- Test CSP compliance: Test CSP Locally
- Test with Docker:
- Fix issues locally before deploying
Common Resolution Steps¶
For most issues:
- Check logs in Airbase Console
- Test locally with Docker
- Fix the issue
- Rebuild container:
- Deploy to staging first:
- Verify fix in staging
- Deploy to production:
Still Stuck?¶
If you've tried everything and still having issues:
- Gather information:
- Full error message
- CLI version:
airbase --version - Docker version:
docker --version - Your
airbase.json - Relevant
Dockerfilesections -
Console log output
-
Contact support with the above information
-
Check for platform issues:
- Visit Airbase Console for status updates
- Check with team members if they're experiencing similar issues
Troubleshooting Checklist¶
Use this checklist when troubleshooting:
Pre-deployment Checks¶
- Docker is running:
docker ps - CLI is installed:
airbase --version - Authenticated:
airbase project listworks -
airbase.jsonexists and is valid JSON -
Dockerfileexists - Directory name is lowercase, no spaces
- All COPY commands use
--chown=app:app - USER app directive present in Dockerfile
Build Checks¶
- Build completes successfully
- No permission errors during build
- Dependencies install correctly
- Base image name is correct
Deployment Checks¶
- Project handle in
airbase.jsonis correct - Port matches between
airbase.jsonand application -
.envfile exists (if using environment variables) - Deploying to correct environment
Post-deployment Checks¶
- Application URL is correct format
- No CSP errors in browser console
- Logs in Console show no errors
- Application responds on expected URL
- All features work as expected
See Also¶
- How-To: Build and Deploy - Deployment workflow
- How-To: Troubleshoot CSP Violations - Fix CSP errors
- How-To: Test CSP Locally - Test before deploying
- How-To: Set Environment Variables - Configure environment
- How-To: View Logs - Debug with logs
- Reference: CLI Commands - Command reference
- Reference: Dockerfile Requirements - Docker specs
- Reference: airbase.json Configuration - Config reference
- Tutorial: Getting Started - First deployment
Summary¶
Remember:
- ✅ Identify where the failure occurred (install, build, deploy, or runtime)
- ✅ Check logs first - they usually contain the answer
- ✅ Test locally before deploying
- ✅ Fix issues in staging before production
- ✅ Use the specific troubleshooting guides for CSP, environment variables, etc.
Most common issues:
- CSP violations → Troubleshoot CSP
- Port mismatch → Check
airbase.jsonvs application code - Permission errors → Add
--chown=app:appto Dockerfile - Environment variables not loading → Check
.envfile naming - Out of memory → Upgrade instance type to
b.small
Quick wins:
- Always check browser console (F12) for errors
- Always check Airbase Console logs
- Always test locally before deploying
- Always deploy to staging first
Happy troubleshooting! 🔧