usefathom / fathom

Fathom Lite. Simple, privacy-focused website analytics. Built with Golang & Preact.
https://usefathom.com/
MIT License
7.55k stars 368 forks source link

Logs full or "syntax error at or near", no metrics #299

Closed jakubgs closed 2 years ago

jakubgs commented 4 years ago

I'm running a self-hosted instance of Fathom using the usefathom/fathom:latest image together with a PostgreSQL DB using the postgres:9.6-alpine image.

Since 3 days ago the Fathom UI shows no metrics, and my logs are FULL of errors like this:

ERROR:  syntax error at or near ""<=/-*>x73hxddo', ... <LOADS_OF_OMITTED_IDS>

With a query so long it doesn't fit in a single line of logs, which appears to be caused by a huge list of IDs. The statements connected to this error appears to be this:

DELETE FROM pageviews WHERE id IN(<LOADS_OF_OMITTED_IDS>);

One thing I noticed that one of the IDs repeats itself over and over again. The log file from just today is roughly 1.9 GB already.

jakubgs commented 4 years ago

I tried setting FATHOM_DEBUG: true but it doesn't seem to have given me any new info.

jakubgs commented 4 years ago

I downgraded the image to version-1.2.1 tag but that didn't fix the issue, syntax errors are still there.

jakubgs commented 4 years ago

I've managed to recover functionality by removing the database and re-creating sites based on a pg_dump I've created. I've lost a few days of data but that's not that bad since it was a fresh install.

I'm going to be sticking to 1.2.1 for now, since my assumption is that this was caused by me using the latest docker tag which contained some kind of broken version which applies an incompatible migration to my database which made it impossible to revert back to 1.2.1.

I have backed up the previous DB so if there's a way to recover the data for previous days I'd appreciate info on how to do that.