'User Name or Password is incorrect' after upgrade

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Post Reply
mehargags
Posts: 3
Joined: Tue May 05, 2020 11:43 pm

'User Name or Password is incorrect' after upgrade

Post by mehargags »

Hi everyone,
I'm getting stuck with a recent migrate + upgrade we did.

I had an timetrex running on CentOS7 with PGSQL 9.2... it started prompting to upgrade a few months back and one fine day it just stopped working. The admin of our TT "not so techie" tried to upgrade but then it got stuck on the database upgrade, because New TT is not compatible below PGSQL version 9.4

So I took over with this non functioning Timetrex trying to resurrect it. For safety and to get things onto latest greatest version, I setup a complete new VPS with Debian 10 & PostgresSQL 12. I backed up (pg_dumpall) and restored the Database to it and then downloaded fresh Timtrex and connected it to the database successfully. Upon running the installer it said Installing/upgrading database may take upto 10 mins, hit yes, gave me Congratulations, successfully timetrex to 12.1.3 and gave me note: in order to access new features, you may need to apply Administrator permissions preset to each administrator employee, then I got a final congratulations, you have successfully upgraded Timtrex, you may now login...

However, I can't seem to login with any of the user/passwords that were working before. I set the logging in ini file, here is the log attached just to keep the thread clean, but I'll paste in the "error" lines here for attention:

Code: Select all

APIAuthentication::getCompanyName():   ERROR: Primary Company does not exist!
Validator::Error(): Validation Error: Label: user_name Value: "0" Msg: User Name or Password is incorrect
Array: APIFactory::returnHandler(): returnHandler v2 ERROR: 0
ProgressBar::error(): error: 'xxxx Key: xxx.5449) Message: INVALID DATA
Also I see a few Warnings for Write Permissions:

Code: Select all

Factory::saveCache(): WARNING: Unable to write cache file, likely due to permissions or locking! Cache ID: registration_key Table: system_setting File: /tmp/timetrex/cache_6/cache_system_setting_registration_key
while /tmp/timetrex is there and writeable by everyone (777)

I tried the command line but it could not find any such user (tried with multiple users)

Code: Select all

su www-data -c "php tools/set_admin_permissions.php ari"
This account is currently not available.
I went into PGSQL DB into USERS table and I can see the 7 Users there. It also shows reset token for one of those I tried to reset passwords with.

Can you hint me what could the issue so I can fix the login ?

Many thanks
Attachments
tt-log.txt
(8.52 KiB) Downloaded 185 times
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: 'User Name or Password is incorrect' after upgrade

Post by shaunw »

Did you copy the timetrex.ini.php from the old system to the new system, then just change the minimum necessary settings? It has encryption keys and such in it, so if you didn't do that you will lose all access to encrypted data.

We have a FAQ with steps to follow when migrating TimeTrex from one server to another, it is focused on Windows, but most of the same steps apply to Linux too:
https://help.timetrex.com/latest/commun ... to_another
mehargags
Posts: 3
Joined: Tue May 05, 2020 11:43 pm

Re: 'User Name or Password is incorrect' after upgrade

Post by mehargags »

Hey Shaun... that was it!!!
No I did not... and I was literally thinking of that as the next step... but decided to post here first :oops:
All that I missed was copying the salt, primary_company_id and uuid_seed from the old ini which were much needed for encryption keys to match... so putting these 3 into the new ini worked right away.

Thanks for your prompt and precise reply, really appreciate!!

One last question, since I'm migrating to a new server, it would help keeping all dependencies like PHP and PGSQL to latest... so
Is Timetrex compatible with latest PHP 7.4.x ?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Re: 'User Name or Password is incorrect' after upgrade

Post by shaunw »

mehargags wrote: Thu May 14, 2020 1:04 am Is Timetrex compatible with latest PHP 7.4.x?
Yes.
mehargags
Posts: 3
Joined: Tue May 05, 2020 11:43 pm

SOLVED 'User Name or Password is incorrect' after upgrade

Post by mehargags »

Great to know!!

thanks for the help. Is there a way I can mark this thread "Solved" ? Would help people reading in future
Post Reply