Upgraded to TracCar 4 - Users lost Admin privileges.

Xesyl6 years ago

I upgraded to TracCar 4 running MySQL just now, and all my Admin users, including the default Admin user have lost admin privileges on the server.

I attempted to run the commands:

UPDATE tc_users SET administrator=b'1' WHERE id='1';

or

UPDATE tc_users SET administrator=b'0' WHERE id='1';

And neither appear to work (it's a bit field so 1 or 0 appear to be the only options).

Is there any other way of recovering admin on the server now?

Anton Tananaev6 years ago

Set it to 1 and restart service.

Xesyl6 years ago

Okay that worked, thanks for the tip to reboot after changing it.

socstur6 years ago

@Xesyl ...can you provide some more details on how you got admin privileges back after upgrading to 4.0? I think I’ll run into the same issue when I update my 3.x to 4.0.

Xesyl6 years ago

Sure, while this will work for MySQL, I'm not sure how to do it if you're using the flat file DB (sqlite maybe?).

Basically you login to MySQL (mysql -u <username> -p)

Select the Traccar DB.

use <dbname>;

Find the ID of the user who needs it:

select id from tc_users where email like 'email@address.com';

Update the user to be admin:
update tc_users set administrator=(1) where id='<id>' (the <id> is the number from the previous command). Make sure it's administrator=(1) as this sets the binary bit to 1 it's not an integer so '1' won't work.

Finally stop and restart Traccar and it should be good to go.

socstur6 years ago

Thanks!!! I’m using MySQL as well so will try it when I get to update it.