Troubleshooting
GitHub Actions Failed
SonarQube Scan Fail
Deploy Fail - Permission Denied
# Staging server
sudo chmod 755 /home/enfection-[client]/htdocs/[client].dev.enfection.com/wp-content/themes
sudo chown -R ubuntu:ubuntu /home/enfection-[client]/htdocs/[client].dev.enfection.com/wp-content/themes
Deploy Fail - SSH Connection
# Test SSH manually
ssh -i ~/.ssh/deploy_key ubuntu@13.202.105.210
# Check authorized_keys
cat ~/.ssh/authorized_keys
GitHub Secret ගෙ STAGING_SSH_KEY correct ද verify කරන්න.
Site Not Loading
# Nginx check
sudo nginx -t
sudo systemctl status nginx
# CloudPanel logs
tail -f /home/enfection-[client]/logs/[client].dev.enfection.com/error.log
SonarQube Down
ssh ubuntu@43.205.140.176
cd /opt/sonarqube
# Check memory
free -h
# Restart
docker-compose restart
docker logs sonarqube -f
SSL Expired
Theme Not Updating on Staging
# Check theme files deployed
ls /home/enfection-[client]/htdocs/[client].dev.enfection.com/wp-content/themes/[client]-theme/
# WordPress cache clear
# WP Admin → Settings → (cache plugin) → Clear cache
new-project.sh Errors
| Message | Cause | Fix |
|---|---|---|
No WordPress site at /home/enfection-<slug>-dev/... |
CloudPanel site missing, or the slug / site user doesn't match | Create the site in CloudPanel with domain <slug>.dev.enfection.com and site user enfection-<slug>-dev, then run the same command again |
HUB_API_TOKEN missing |
Token not in ~/.enfection-config |
hub.enfection.com → Admin → WP sites → API tokens → Create token → add the two lines |
Hub API returned 401 |
Token wrong or revoked | Create a new token, replace HUB_API_TOKEN |
REMOTE HOST IDENTIFICATION HAS CHANGED |
STAGING_SERVER_IP points to an old IP (now another machine), or the server was rebuilt |
Don't just accept it. Check the IP in ~/.enfection-config matches the Elastic IP; then ssh-keygen -R <old-ip> |
| Step 5 failed, Steps 1-3 done | Anything in the hub/plugin step | Fix it and run the same command again: the existing repo is detected and Steps 1-3 are skipped |
GitHub Actions: SSH i/o timeout / unable to authenticate
dial tcp …:22: i/o timeout→ the security group blocks GitHub. Port 22 must be open to0.0.0.0/0(safe only because SSH is key-only, see Server Management).unable to authenticateright after an IP change → the repo'sSTAGING_SERVER_IPsecret still has the old IP. Update it in every theme repo and the docs repo:gh secret set STAGING_SERVER_IP --body <ip> --repo Enfection-Dev-Lab/<repo>
First SonarQube run fails: no scheme was found for /api/...
The workflow started before its secrets existed (older versions of new-project.sh). Re-run the job from the
repo's Actions tab; the secrets are there now.
WordPress: "Sign in with Enfection Hub" Problems
| Message | Fix |
|---|---|
| Hub shows Bad redirect | The hub tool's redirect URI must be exactly https://<slug>.dev.enfection.com/wp-login.php?action=enfection_hub (Admin → WP sites → Manage) |
| You don't have access to this site | Add the developer's email in hub.enfection.com → Admin → WP sites |
| There is no account on this site for … | Settings → Enfection Hub on the site: tick "Create an account" (the script sets this) |
| The App ID or secret … is wrong | Re-run new-project.sh with the same slug (gives the site a new secret and rewrites wp-config) |
| Developer can't log in with a password | By design: hub-created accounts sign in only through the hub |
| Need to get in without the hub | Use the CloudPanel admin account (password in Vaultwarden) |