upgrade to 3.17 sql error

snoopy6 years ago

Hi. I upgraded from v3.14 to v3.17 (Windows). During first startup, database is updated with new settings:
https://pastebin.com/M7NwUFym

Everything seems to work, new coordinates are received. But when service is restarted, it tries to add constrain to DB and fails:
https://pastebin.com/5JiEkUWE
Service stops by itself, repeated restarts do not help. If I rollback DB to pre-upgrade backup, everything repeats again: DB updated, service restart, DB fails, service stop.

v3.16 does not have this bug, however, it also displays one error during every service restart:

INFO|5820/0|Service traccar|18-05-30 20:42:17|INFO 5/30/18 8:42 PM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|5820/0|Service traccar|18-05-30 20:42:17|INFO 5/30/18 8:42 PM: liquibase: ./schema/changelog-master.xml: changelog-3.8::changelog-3.8-dropuniquetoken::author: Change set changelog-3.8::changelog-3.8-dropuniquetoken::author failed, but failOnError was false.  Error: Constraint "UK_USER_TOKEN" not found; SQL statement:
INFO|5820/0|Service traccar|18-05-30 20:42:17|ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token [90057-196] [Failed SQL: ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token]
INFO|5820/0|Service traccar|18-05-30 20:42:17|INFO 5/30/18 8:42 PM: liquibase: Successfully released change log lock

I'm using default conf files, no other customizations too.

Anton Tananaev6 years ago

Do you have database.checkConnection configured somewhere?

snoopy6 years ago

No. As I said, the server is not customized at all, defaults everywhere.

Anton Tananaev6 years ago

The error means that there is some issue in your database schema.

snoopy6 years ago

How could it happen, if I never accessed the database directly?

Any way to fix it manually?

Anton Tananaev6 years ago

Probably some issue with upgrade. Just revert to the backup that you did before the upgrade and try again.

snoopy6 years ago

I did that several times, and the result is the same.

Anton Tananaev6 years ago

Please provide wrapper log. Upload it somewhere and post a link.

snoopy6 years ago
Anton Tananaev6 years ago

I can see that you constantly hit a timeout which usually means that you don't have enough resources on your server.

snoopy6 years ago

Do you mean these lines?

INFO|wrapper|Service traccar|18-05-30 20:26:38|Win service stop - timeout: 30000

Those are being logged everytime I stop windows service manually. And I was doing that a lot during my upgrade attempts.

Server is fine, no significant CPU load or RAM usage.

Anton Tananaev6 years ago

That's not what supposed to happen when you stop service, obviously.