Troubleshooting

Common issues, symptoms, and fixes encountered with Friendly Jenkins.

Port Conflicts

  • Symptom: listen tcp …​ bind: address already in use (e.g., MySQL 3306).

  • Fix: change service port in .env (e.g., MYSQL_PORT=3307) or stop the conflicting container.

  • Pipelines probe ports with ss / netstat / lsof; install at least one of them. Example (Debian/Ubuntu):

    sudo apt-get update && sudo apt-get install -y iproute2 net-tools lsof

    RHEL/CentOS:

    sudo yum install -y iproute net-tools lsof

Pipeline Fails with Exit Code 127

  • Symptom: script returned exit code 127 in Create, Update or Deploy. The cause is in the console lines above the banner: command not found.

  • Cause: the controller is not running the project image. The official jenkins/jenkins image has no yq, rsync or Docker CLI.

  • Check: docker exec jenkins-qa-master sh -c 'for c in yq rsync docker; do command -v $c || echo "MISSING $c"; done' must print three paths.

  • Fix: run hub.friendly-tech.com/qa-jenkins/friendly-jenkins-master: docker compose pull, then docker compose up -d.

Parameter Fields Stuck on Loading

  • Symptom: in Build with Parameters, fields stay on Loading…​ or [Loading services…​].

  • Cause: the parameter scripts are waiting for approval. Only an administrator can approve them.

  • Fix: as an administrator, approve them in Manage Jenkins → In-process Script Approval.

  • Do not approve the signature new java.io.File java.lang.String: it lets every sandboxed script read any file on the controller. Without it, the runner filter on List-Environments shows Scripts not permitted, and the rest of the form works.

No Agent Selected

  • Symptom: Deploy-Environment stops with No agent selected.

  • Fix: choose an agent in DEPLOY_RUNNER. The controller does not run containers.

502 from nginx After a Restart

  • Cause: the container’s IP changed, and nginx still uses the old one.

  • Fix: docker exec nginx-proxy nginx -s reload.

Plugins Could Not Be Loaded

  • Symptom: Some plugins could not be loaded due to unsatisfied dependencies after an update, usually with Pipeline: Declarative. Pipeline jobs do not work until this is fixed.

  • Cause: older plugins are left in data/plugins.

  • Fix: stop the controller, move data/plugins aside and start it again; the plugins come from the image. Plugins added by hand must be added to plugins.txt.

  • You have data stored in an older format afterwards is usually left over from removed plugins. Review it under Manage Jenkins → Manage Old Data, and discard it only after the new version has run for a few days: this cannot be undone.

403 from Jenkins

  • Everything returns 403: if the nginx allow-list is enabled, your IP address is not on it. Connect through the office network or VPN, or ask an administrator to add it.

  • Only /manage or a job’s Configure returns 403: that action needs an administrator. See Access and permissions.

  • 429 at login: if rate limits are enabled, there were too many attempts from your IP address. Wait a minute.

Agent Does Not Connect

Check docker compose logs jenkins-agent:

  • 403 or timeout on JENKINS_URL: JENKINS_URL points directly at port 8080, which is not published, or the agent’s IP is not on the nginx allow-list. Use https://jenkins.friendly-tech.com.

  • Connection to port 50000 fails: test it with nc -z jenkins.friendly-tech.com 50000, then check the firewall on the master host.

  • Authentication error: the secret is wrong or has changed. Copy it again; see Agent setup.

Volume Permission Errors

  • Symptom: Operation not permitted when changing ownership under /opt/qa-envs/<env>/volumes/.

  • Fix: sudo chown -R 1000:1000 /opt/qa-envs/<env>/volumes/ on the agent.

Missing Environment Variables

  • Symptom: Error: <VAR> is not set.

  • Fix: append the variable to <service>.env or .env, then redeploy:

    echo "MYSQL_ROOT_PASSWORD=password123" >> mysql.env
    docker compose up -d

Health Checks Failing

  • Symptom: docker compose ps shows Up (unhealthy).

  • Fix:

    • Increase timeouts/retries:

healthcheck:
  test: ["CMD", "mysqladmin", "ping"]
  interval: 10s
  timeout: 10s
  retries: 5
  start_period: 60s
  • Use CMD-SHELL when env expansion is needed:

test: ["CMD-SHELL", "mysql -u $$MYSQL_USER -p$$MYSQL_PASSWORD -e 'SELECT 1'"]

Shared Library Not Loading

  • Symptom: MissingMethodException: No such DSL method 'createEnvStep'.

  • Fix:

    • Verify Global Pipeline Library points to the correct Git URL and credentials.

    • Manually sync library if needed:

cd shared-library && git pull
docker cp vars/ jenkins-qa-master:/var/jenkins_home/qa-library/
  • Confirm webhook secret matches WEBHOOK_SECRET_EXPECTED.

Webhook Not Firing Sync

  • Ensure URL token matches Jenkins job token.

  • X-Gitlab-Token header must equal configured secret.

  • Branch/tag must match allowed regex (commonly main or version tags).

Recovering Deleted Environments

  • If backups exist on master: restore tarball into /var/jenkins_home/qa-data/envs/ then redeploy.

  • If not: re-create the environment from templates; Docker volumes may remain if only “Stop” was used.