# SonarQube report upload timeout

If the scanner still fails with **"Failed to upload report"** / **SocketException: An established connection was aborted** after increasing client timeouts to 1 hour, the limit is usually on the **server** (scan.appmonitor.co.za).

## Client (already applied)

- `sonar.ws.timeout=3600`
- `sonar.scanner.socketTimeout=3600`
- `sonar.scanner.connectTimeout=3600`
- Aggressive exclusions in IEB `sonarqube_scan.bat` to keep report &lt;100MB

## IEB exclusions (report size reduction)

| Excluded | Reason (~file count) |
|----------|----------------------|
| `**/core/**`, `**/core-dev/**` | Base framework (~1.6k files) |
| `**/*.css` | CSS (~4.5k files) – remove from exclusions if you need CSS analysis |
| `**/*.sql` | SQL scripts (~1.3k) – remove if you need SQL analysis |
| `**/tools/**` | Tools/tests – remove if you want tools analyzed |
| `**/data/Scripts/archive*/**`, `**/data/Scripts/published*/**` | Archived SQL |
| `**/*.Designer.cs` | WinForms generated |
| `**/*.jpg`, `**/*.png`, `**/*.gif`, `**/*.ico`, `**/*.pdf`, `**/*.PDF`, `**/*.xlsx`, `**/*.zip`, `**/*.map`, `**/*.refresh` | Non-source / binaries |
| `**/components/**`, `**/release/**`, `**/BuildProcessTemplates/**`, `**/Service References/**`, `**/Web References/**` | Build/generated |
| `**/.scannerwork/**`, `**/.sonarqube/**` | Scanner cache |

## Server-side (scan.appmonitor.co.za)

Ask the server admin to:

1. **Reverse proxy (e.g. Nginx)**  
   - `client_max_body_size` large enough for the report (e.g. 500M).  
   - `proxy_read_timeout`, `proxy_connect_timeout`, `proxy_send_timeout` at least 3600s (1 hour).

2. **SonarQube**  
   - Check any HTTP/request timeout settings and set them high enough for large uploads.

3. **Firewall / load balancer**  
   - Ensure long-lived HTTPS connections are not closed by idle timeouts.

## Reducing report size

To avoid timeouts, keep the report smaller:

- Tighten `sonar.exclusions` in the batch file (exclude more non-source paths).
- Scan only the main source tree (e.g. a single `sonar.sources` path) if the project is very large.
