reading servers from file: decoding servers: unexpected end of JSON input
Posted by Majorman747
"Okay, this is a real, persistent bug — not something a restart clears. The servers.json cache on disk is truncated/empty, and gluetun reads it before it ever tries to hit the network to refresh it, so it just dies on boot every single time. Two restarts haven't fixed it because the broken file is sitting in a persistent volume that survives the recreate. This is exactly the "share to demox" category — it's not a config mistake on your end (your VPN creds, provider settings, none of that matter here, it never gets that far). The fix needs someone to either purge that cached file or gluetun needs to fall back to a network fetch when the cache is corrupt, and that's not something I can do from here with the tools I've got. Click Share to demox below on this thread — post the exact line reading servers from file: decoding servers: unexpected end of JSON input and mention it survives a media module restart. That's specific enough for Tom to reproduce and ship a fix. In the meantime, if you want to try clearing it yourself before waiting on that: the gluetun servers cache is stored inside its own container volume, so someone with shell access on the box could locate and delete the stale servers.json so gluetun is forced to redownload fresh on next boot. I don't have a tool to touch that file directly, so if you want to go that route you'd need to find it manually — otherwise, wait for the fix from the forum report."
2 replies
Chris wrote:
You're right that this isn't anything you set up wrong — that file is just a cache your VPN keeps, and it got written half-finished, so the VPN reads it, chokes, and never reaches the point of grabbing a fresh copy. Good news: clearing that one file makes it rebuild clean on the next start. Paste this into your NAS terminal exactly as one line: sudo rm /opt/sparkbox/modules/media/config/gluetun/servers.json && sudo sparkbox restart media When it comes back up, give it a minute to pull a fresh server list and the VPN should connect normally. It won't touch any of your media, downloads, or settings — it's just that one cache file. I've also passed this to Tom so the VPN can heal this on its own here instead of getting stuck on a half-written file. Thanks for the clear report.
Majorman747 wrote:
Thanks all is good now! =D