Troubleshooting & FAQ Guide
Welcome to the central troubleshooting hub! If you're seeing an error, check the categories below. Every entry follows the Error → Reason → Solution format for quick resolution.
Environment & Setup
nodejs-quickstart: command not found
- Reason: The CLI is not installed globally or your PATH is missing.
- Solution: Use
npx nodejs-quickstart-structure init(recommended) or install globally vianpm install -g nodejs-quickstart-structure.
Invalid Node.js version
- Reason: You are likely running a version below Node.js 18.x.
- Solution: Upgrade your local Node.js environment. We recommend Node.js LTS (v22.x).
EBUSY: resource busy or locked (Windows)
- Reason: A file is locked by another process (IDE, terminal, or Antivirus).
- Solution: Close your IDE, restart your terminal as Administrator, and try the command again.
Security & Quality (Snyk/Sonar)
403 Forbidden or Unauthorized (Snyk)
- Reason: Missing or invalid
SNYK_TOKENin your environment. - Solution:
- Local Development: If your local scan fails, you need to authenticate your machine:bash
npx snyk auth # This opens a browser window to log you in. - CI/CD: Ensure the Secret in GitHub/GitLab is named exactly
SNYK_TOKEN. Check your provider's "Repository Secrets" section.
- Local Development: If your local scan fails, you need to authenticate your machine:
sonar.organization is missing
- Reason: SonarCloud requires an organization key in
sonar-project.properties. - Solution: Find your Org Key in the SonarCloud UI and update the properties file.
Could not find a default branch (SonarCloud)
- Error:
ERROR Could not find a default branch for project... - Reason: The project hasn't been imported/created in the SonarCloud UI yet.
- Solution:
- Log in to SonarCloud.
- Click "+" -> Analyze new project and import your repository.
- Critical Step: Go to Administration -> Analysis Method and ensure "Automatic Analysis" is OFF, and "GitHub Actions" (or your provider) is selected.
- Ensure the Project Key (e.g.,
org_repo-name) in the SonarCloud UI matches the one in yoursonar-project.properties.
Husky & Git Hooks
Hooks not running after generation
- Reason:
npm installwas run beforegit init. - Solution: Run
git init, thennpx husky install.
Docker & Infrastructure
port is already allocated (e.g., 9093)
- Reason: Another container or local service is using the port.
- Solution: Stop all containers with
docker compose downor find the process usinglsof -i :9093(Mac/Linux) ornetstat -ano | findstr :9093(Windows).
dial unix /var/run/docker.sock: no such file or directory
- Reason: The Docker socket is not mounted or the path is incorrect for your OS.
- Solution (Windows Git Bash): Use double slashes in your mount:
-v //var/run/docker.sock:/var/run/docker.sock.
permission denied (Docker API)
- Reason: The user running the tool doesn't have permissions to the socket.
- Solution: Run your CI container as
root(e.g.,--user rootin docker run) or add the user to thedockergroup.
CI/CD & Automation
Jenkins: Invalid tool type "nodejs"
- Reason: The NodeJS Plugin is missing or Jenkins hasn't been restarted.
- Solution: Install the plugin and visit
http://localhost:8080/restart.
Jenkins: Tool type "nodejs" does not have an install of "nodejs" configured
- Reason: The tool is not named
nodejsin the settings. - Solution: Go to Manage Jenkins > Tools, Add NodeJS, and set the Name exactly to
nodejs.
Jenkins: fatal: not in a git directory (Obtain Jenkinsfile)
- Reason: "Lightweight checkout" is failing to pull the config.
- Solution: Go to Pipeline Configure, and UNCHECK the "Lightweight checkout" box.
Jenkins/Bitbucket: buildx 0.17.0 or later
- Error:
compose build requires buildx 0.17.0 or later - Reason: Your environment doesn't support BuildKit.
- Solution: Set
DOCKER_BUILDKIT=0in your environment (Jenkinsfile or bitbucket-pipelines.yml).
Bitbucket Pipelines: --mounts is not allowed
- Error:
Error response from daemon: authorization denied by plugin pipelines: --mounts is not allowed - Reason: Bitbucket Pipelines Cloud prohibits host volume mounts (bind mounts) for security. If your
docker-compose.ymluses- .:/appfor internal migration services or code sync, Bitbucket's security plugin will block the build. - Solution:
- CI-Specific Compose: Create a
docker-compose.ci.ymlthat removes allvolumessections and removes the dedicated migration service container. - Run Migrations on Host: In your pipeline script, run the migration command directly (e.g.,
npm run migrate) once the database container is online. This uses the code already present in the CI runner instead of mounting it from the host. - Support CI Overrides: Update your orchestrator (e.g.,
scripts/run-e2e.js) to detect the CI environment and use the-f docker-compose.ci.ymlflag if it exists.
- CI-Specific Compose: Create a
GitLab/Jenkins: Healthcheck Timeout
- Error:
Timed out waiting for: http://127.0.0.1:3001/health - Reason:
- Shared runners are slow; Kafka/DB haven't finished booting.
- Networking Collision: If Jenkins is running in a container,
127.0.0.1refers to Jenkins itself, not your app.
- Solution:
- Increase timeout to 300000ms (5 mins) in
scripts/run-e2e.js. - Use Host Alias:
- Jenkins/Local: Set
WAIT_ON_HOST = 'host.docker.internal'andTEST_URL = 'http://host.docker.internal:3001'. - GitLab CI: Set
WAIT_ON_HOST = 'docker'andTEST_URL = 'http://docker:3001'in your.gitlab-ci.ymlvariables. - This allows the CI build container to "reach out" to your application container!
- Jenkins/Local: Set
- Increase timeout to 300000ms (5 mins) in
Flyway & Database Migration Errors
- Problem: Infrastructure is healthy, but the app fails to start its web server.
- Reason: The application waits for the Database to be ready and for Flyway migrations to complete before opening its port.
- Common Fixes:
- Slow DB Boot: On some environments, MySQL/Postgres takes >60s to start. Our scripts automatically wait, but you may need to check
docker compose logsto see if the DB is still initializing. - Migration Failure: Check logs for
Migration failedorAccess denied. This usually means the.envcredentials don't match thedocker-compose.ymlenvironment variables. - Wait-for-it: Ensure your
Dockerfileorentrypointcorrectly uses thewait-for-it.shscript to block the app until the DB port is open.
- Slow DB Boot: On some environments, MySQL/Postgres takes >60s to start. Our scripts automatically wait, but you may need to check
Skipping Expensive E2E Tests
- Problem: E2E tests are taking too long or failing on slow CI runners.
- Solution: You can temporarily disable the E2E stage:
- Jenkins: Comment out the
stage('E2E Test')block in yourJenkinsfile. - GitHub Actions: Add
if: falseto thee2e-testsjob in.github/workflows/ci.yml. - GitLab CI: Add
when: manualto therun_e2e_testsjob in.gitlab-ci.yml. - Bitbucket: Comment out the
- step: name: Run E2E Testssection in your pipeline YAML.
- Jenkins: Comment out the
Authentication & API
Swagger: Failed to fetch on /auth/google or /auth/github
- Problem: Clicking "Execute" returns "Failed to fetch" and a CORS error.
- Reason: Browser security (CORS) prevents the Swagger UI from following a redirect (
302) to an external domain (like Google/GitHub) inside an AJAX request. - Solution:
- Manual Test: Copy the URL
http://localhost:3000/auth/googledirectly into your browser's address bar. It will work perfectly. - API Test: Use the
POST /auth/social/exchangeendpoint in Swagger. This is a JSON API and does not have redirect issues.
- Manual Test: Copy the URL
Swagger: 500 Internal Server Error on /auth/social/exchange
- Problem: Receiving a 500 error with "Failed to authenticate" when sending a code to Swagger.
- Reason: OAuth2 codes are single-use and URL-encoded by the browser.
- Solution:
- Get a FRESH code: Visit the login URL in your browser again to get a new code (they expire after one use!).
- URL Decode: If the code in your address bar contains
%2F, you must replace it with a literal/before pasting it into Swagger (e.g.,4%2F0Af...becomes4/0Af...). - Match Redirect URI: Ensure the
redirectUriin your JSON body exactly matches the one registered in your Google/GitHub console.
Generator Issues
Templates not rendering correctly
- Reason: Editing
.ymlfiles instead of the.yml.ejstemplates. - Solution: Always modify the files inside the
templates/directory ending in.ejs.
TIP
Found a new issue? Feel free to Open an Issue on GitHub!