TeslaLogger icon indicating copy to clipboard operation
TeslaLogger copied to clipboard

Unknown column 'sessionId' in 'field list'

Open c-schulz-rd13 opened this issue 5 months ago • 2 comments

🚨 MySQL Exception: "Unknown column 'sessionId' in 'field list'" in SuCSession (TeslaLogger 1.63.6.0)

Hi, since lately I'm seeing the following recurring MySQL error in the logs:

MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown column 'sessionId' in 'field list'
at TeslaLogger.SuCSession..ctor (System.Object jsonSession, TeslaLogger.Car car)
at TeslaLogger.GetChargingHistoryV2Service.ParseJSON (System.String sjson, TeslaLogger.Car car)
...

Apparently, TeslaLogger is expecting a sessionId column in the database (most likely in the sucSession table), but that column doesn't exist in my schema. This causes Supercharger sessions to fail when being saved.

Steps to Reproduce:

  1. Fresh install with the current docker-compose setup
  2. Drive to a Supercharger and begin charging
  3. View logs via docker logs teslalogger → error appears immediately

System Info:

  • TeslaLogger version: latest (1.63.6.0) master as of 11.06.2025
  • Setup: Docker with mariadb and TeslaLogger services
  • mariadb:10.4.7
  • No manual schema changes were made

Expected Behavior:

The column sessionId should either:

  • be automatically created through a database migration script OR
  • be treated as optional in the code if missing

Suggestion:

  • Add the missing column via migration script
  • Or: check for column existence in code before using it to avoid runtime exceptions

Thanks for your great work — TeslaLogger is otherwise running perfectly! 🙌

Best regards, rd13

c-schulz-rd13 avatar Jun 11 '25 15:06 c-schulz-rd13

maybe related to #1569

I think there is a exception during UpdateTeslalogger:Start(), so subsequent db changes are skipped.

https://github.com/bassmaster187/TeslaLogger/blob/d3b8ea7bd8aecd6246515145b0d0f0663d6fc14f/TeslaLogger/UpdateTeslalogger.cs#L53

bassmaster187 avatar Jun 13 '25 06:06 bassmaster187

Yes could be related to #1569.

c-schulz-rd13 avatar Jun 13 '25 17:06 c-schulz-rd13