Common Problems
The panel cannot connect to the server (refused or timed out)
sv_enableHttpServer is missing or the port is wrong. Add set sv_enableHttpServer true to server.cfg and restart; the script prints a red line on start while it is missing. In the panel use the port of endpoint_add_tcp, see Adding a Server. If info.json opens but the panel still times out, your host's DDoS filter drops the request: DDoS-Protected Hosts.
"Unauthorized: Invalid or missing API key" or "Too many failed attempts"
The key in the panel does not match tgiann_stats_secret_key. Fix it in Settings > Connection. After 10 wrong keys in a minute the server answers 429 for a minute.
The console says "add this line to server.cfg ... add_unsafe_child_process_permission"
FXServer's sandbox blocks programs started by a resource, so the media service cannot start. Add add_unsafe_child_process_permission "tgiann-fivem-stats-script" to server.cfg before ensure tgiann-fivem-stats-script and restart the server, see Installation.
"no device found", "Use --allow-fs-read" or "No such export MediaGetConnection" in the console, the panel shows HTTP 500
An earlier 3.x version is installed. It kept its files in your server data folder, which FXServer's sandbox blocks. Update the script, move the old tgiann-media folder into the script folder and add the sandbox line to server.cfg, see Updating from an Older Version.
"mysql_connection_string is empty or not readable"
The script cannot read oxmysql's connection string, so player names, jobs, money and Database Backups are off. If server.cfg limits who can read it with add_convar_permission, add add_convar_permission tgiann-fivem-stats-script read mysql_connection_string and restart the server. Otherwise set mysql_connection_string for oxmysql.
"another program answers on 127.0.0.1:6174, not the media service"
Another program or resource already uses the media port, so the script's requests reach it instead of the media service. Set a free port with set tgiann_media_port 6175 before ensure tgiann-fivem-stats-script, open it in the firewall and restart the server, see Ports and Firewall.
"The media service is not running, check the server console"
The media service did not start. Look for red [tgiann-media] or [media] lines in the console. A line about add_unsafe_child_process_permission means the sandbox line is missing in server.cfg, see above. On Linux, cannot start: spawn EACCES or cannot make .../ffmpeg executable means the script could not make the files in media/bin executable: set their permissions to 755 in your host's file manager or SFTP client and restart the resource.
Statistics, logs and media are gone after an update
They are stored in tgiann-media/ inside the script folder, and deleting the old folder deleted them. Put your copy of that folder back into the script folder while the server is stopped. Next time follow Updating from an Older Version.
The Media page shows "Needs HTTPS on the game server"
The panel runs on HTTPS and browsers block plain HTTP files on it. Turn HTTPS on: HTTPS.
The console shows an "https:" error
With auto the certificate needs TCP port 80 open and free, and a public IP. Open the port (Ports and Firewall), add a filter for it if your host has a DDoS filter (DDoS-Protected Hosts), stop programs using port 80, or switch to custom / off (HTTPS).
Pictures do not load in my own game on a test PC at home
Behind a home router auto builds links with your outside IP. Use set tgiann_media_https "off", see HTTPS > Test server at home.
/mediatest prints "failed, screenshot timed out"
The player's game did not send the screenshot in time. Make sure screencapture or screenshot-basic is started before this script, and that players can reach the media port (Ports and Firewall). On slow PCs raise Screenshot timeout in Settings > Players and items.
TakeImage returns "upload limit reached or media service is down"
The player started more screenshots than Player screenshots allows per minute, or it is 0. See Settings > Players and items.
Backup download fails
The file comes from the media port, which must be open to the internet: Ports and Firewall. The link works for 10 minutes; click download again for a new one.
My script's debug logs do not show
Lowest level kept is info by default and drops debug lines. Lower it in Settings > Logs.
Items I do not care about fill the Items page
Add them to Ignored items in Settings > Players and items. The list updates on the next hourly scan.
Old statistics are missing after the update
The old tables are imported in parts on the first start; watch for stats: imported <n> rows from <table> lines. An import that stopped continues on the next start. See Updating from an Older Version.