Last active
April 1, 2026 13:05
-
-
Save Java4all/08b9b9f84bd8382f017f59e09a411a38 to your computer and use it in GitHub Desktop.
check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Check config values being loaded | |
| docker exec jenkins-failure-agent python3 -c " | |
| from src.config import load_config | |
| cfg = load_config('/app/config.yaml') | |
| print(f'Jenkins URL: {cfg.jenkins.url}') | |
| print(f'Jenkins User: {cfg.jenkins.username}') | |
| print(f'Jenkins Token: {cfg.jenkins.api_token[:10]}...' if cfg.jenkins.api_token else 'Token: EMPTY') | |
| print(f'Verify SSL: {cfg.jenkins.verify_ssl}') | |
| " | |
| # 2. Test connection with verbose error | |
| docker exec jenkins-failure-agent python3 -c " | |
| import requests | |
| from src.config import load_config | |
| cfg = load_config('/app/config.yaml') | |
| try: | |
| resp = requests.get( | |
| f'{cfg.jenkins.url}/api/json', | |
| auth=(cfg.jenkins.username, cfg.jenkins.api_token), | |
| verify=cfg.jenkins.verify_ssl, | |
| timeout=10 | |
| ) | |
| print(f'Status: {resp.status_code}') | |
| print(f'OK: {resp.ok}') | |
| except Exception as e: | |
| print(f'ERROR: {type(e).__name__}: {e}') | |
| " | |
| # 3. Check GitHub config values | |
| docker exec jenkins-failure-agent python3 -c " | |
| from src.config import load_config | |
| cfg = load_config('/app/config.yaml') | |
| print(f'GitHub Enabled: {cfg.github.enabled}') | |
| print(f'GitHub URL: {cfg.github.base_url}') | |
| print(f'GitHub Token: {cfg.github.token[:10]}...' if cfg.github.token else 'Token: EMPTY') | |
| print(f'Verify SSL: {cfg.github.verify_ssl}') | |
| " | |
| # 2. Test GitHub connection with verbose error | |
| docker exec jenkins-failure-agent python3 -c " | |
| import requests | |
| from src.config import load_config | |
| cfg = load_config('/app/config.yaml') | |
| try: | |
| resp = requests.get( | |
| f'{cfg.github.base_url}/user', | |
| headers={'Authorization': f'token {cfg.github.token}'}, | |
| verify=cfg.github.verify_ssl, | |
| timeout=10 | |
| ) | |
| print(f'Status: {resp.status_code}') | |
| print(f'Response: {resp.text[:200]}') | |
| except Exception as e: | |
| print(f'ERROR: {type(e).__name__}: {e}') | |
| " | |
| # 4. Check if GITHUB_ENABLED is set | |
| docker exec jenkins-failure-agent env | grep -i github |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment