Verifying Demo Uploads¶
This guide explains how to verify that demo uploads are working correctly in the MatchZy Auto Tournament system.
Setup Required
Before verifying demo uploads, make sure you've completed the Demo Upload Setup Guide.
Overview¶
MatchZy automatically uploads demo files after matches complete. The system receives these uploads via the /api/demos/:matchSlug/upload endpoint and stores them in data/demos/{matchSlug}/.
Verification Steps¶
1. Check Demo Upload Configuration¶
Before a match starts, verify that demo upload is configured:
API Endpoint: GET /api/demos/:matchSlug/status
Response:
{
"success": true,
"matchSlug": "r1m1",
"matchId": 1,
"serverId": "server-123",
"matchStatus": "loaded",
"demoUploadConfigured": true,
"expectedUploadUrl": "https://your-domain.com/api/demos/r1m1/upload",
"hasDemoFile": false,
"demoFilePath": null,
"note": "MatchZy should upload demos to the expected URL after match/map completion"
}
What to check:
- ✅
demoUploadConfiguredshould betrue - ✅
expectedUploadUrlshould be a valid URL - ⚠️ If
demoUploadConfiguredisfalse, check thatwebhook_urlis set in settings
2. Verify Demo Upload Command Was Sent¶
When a match is loaded, check the logs for:
Or check the match load response:
API Endpoint: POST /api/matches/:slug/load
The response includes:
{
"success": true,
"demoUploadConfigured": true,
"rconResponses": [
{
"success": true,
"command": "matchzy_demo_upload_url \"https://your-domain.com/api/demos/r1m1/upload\""
}
]
}
3. Monitor Demo Upload Logs¶
Watch the application logs during and after a match. You should see:
When upload starts:
[Demo Upload] Upload request received
matchSlug: r1m1
filename: match_demo.dem
matchId: 12345
mapNumber: 1
When upload completes:
[Demo Upload] Demo uploaded successfully
matchSlug: r1m1
filename: match_demo.dem
fileSize: 15.23 MB
path: r1m1/match_demo.dem
4. Check Demo File Exists¶
After a match completes, verify the demo file was saved:
API Endpoint: GET /api/demos/:matchSlug/info
Response:
{
"success": true,
"hasDemo": true,
"filename": "match_demo.dem",
"size": 15972352,
"sizeFormatted": "15.23 MB"
}
Or check the file system:
5. Download Demo File¶
Test downloading the demo:
API Endpoint: GET /api/demos/:matchSlug/download
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
-o demo.dem \
http://localhost:3000/api/demos/r1m1/download
Troubleshooting¶
Demo Upload Not Configured¶
Symptoms:
demoUploadConfigured: falsein status endpoint- No demo upload command in logs
Solutions:
- Ensure
webhook_urlis set in Settings - Verify
SERVER_TOKENenvironment variable is set - Check that the match was loaded after webhook URL was configured
Demo Upload Fails¶
Symptoms:
- Logs show "Failed to configure demo upload"
- MatchZy server logs show errors
Solutions:
- Verify RCON connection to server is working
- Check MatchZy plugin version (0.8.24+)
- Ensure server can reach the webhook URL (not localhost)
- Check server logs for MatchZy errors
Demo File Not Received¶
Symptoms:
- Match completes but no demo file
- Status shows
hasDemoFile: false
Solutions:
- Check MatchZy server logs for upload errors
- Verify the upload URL is accessible from the server
- Check that
SERVER_TOKENmatches in both systems - Verify MatchZy has permission to write demos
- Check application logs for upload errors
Demo Upload Received But File Missing¶
Symptoms:
- Logs show "Demo uploaded successfully"
- But file doesn't exist on disk
Solutions:
- Check disk space:
df -h - Verify write permissions on
data/demos/directory - Check application logs for file write errors
- Verify the file path is correct
Testing Demo Upload Manually¶
You can test the demo upload endpoint manually using curl:
# Create a dummy demo file
echo "dummy demo content" > test.dem
# Upload it (requires SERVER_TOKEN)
curl -X POST \
-H "X-MatchZy-Token: YOUR_SERVER_TOKEN" \
-H "MatchZy-FileName: test_demo.dem" \
-H "MatchZy-MatchId: 12345" \
-H "MatchZy-MapNumber: 1" \
--data-binary @test.dem \
http://localhost:3000/api/demos/r1m1/upload
Expected Response:
Log Locations¶
- Application logs: Check console output or log files
- MatchZy server logs: Check CS2 server console/logs
- Demo files:
data/demos/{matchSlug}/
Related Endpoints¶
GET /api/demos/:matchSlug/status- Check demo upload configurationGET /api/demos/:matchSlug/info- Check if demo file existsGET /api/demos/:matchSlug/download- Download demo filePOST /api/demos/:matchSlug/upload- Upload endpoint (used by MatchZy)
Related Documentation¶
- Enabling Demo Uploads - Complete setup guide for demo uploads
- Server Setup - CS2 server setup guide