[BUG] Updating from 3.1.4 to the latest version makes Leantime unusable as login does not work anymore
If you have problems with the installation please use our community forum
What set up are you using
- [ ] Cloud Hosted Version
- [X] Self Hosted
Describe the bug After updating to the latest version, Leantime updates the database upon first login. After that, I can't login to Leantime any more. No error message, the credentials just won't work. I had to manually revert back to 3.1.4 and restore my database backup to use Leantime again.
To Reproduce Use a 3.1.4 self-hosted installation and update to the latest version.
Expected behavior Being able to login after Leantime has updated the database.
Leantime Version reverted back to 3.1.4, wanted to use the latest version
PHP / MySQL Version PHP 8.1.9 / MySQL 9.0.1
I am also getting the same error. Message in leantime.log:
[2024-09-08 19:21:05] production.CRITICAL: PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'zp_calendar' already exists in /var/www/html/leantime/app/Domain/Install/Repositories/Install.php:239 Stack trace: #0 /var/www/html/leantime/app/Domain/Install/Repositories/Install.php(239): PDOStatement->execute() #1 /var/www/html/leantime/app/Domain/Install/Controllers/Index.php(95): Leantime\Domain\Install\Repositories\Install->setupDB() ... #41 /var/www/html/leantime/app/Core/Bootstrap/Bootloader.php(129): Leantime\Core\Bootstrap\Bootloader->handleRequest() #42 /var/www/html/leantime/public/index.php(13): Leantime\Core\Bootstrap\Bootloader->boot()
i have the same problem, do you found a solution?
Do you have any other error messages from the logs?
Here is a fix which worked for me, means in case you have (e.g. the commercial) plugins installed:
- stop leantime (docker)
- move all the subdirs from /plugins to safe backup place; /plugins dir must be empty
- start leantime (docker), login should work fine again; however, additional steps 4-6 are still required
- redownload ALL apps from "app marketplace / explore apps" (re-)using your license key for each app
- disable ALL apps under "app marketplace / my apps"
- enable ALL apps under "app marketplace / my apps" again
A bit alarming (receiving a generic "error 500" message even on the login screen) and a bit tedious (fiddling with individual license keys and plugins/apps again) - but overall fixed in under 10 minutes.
I hope you find this information helpful and it saves you time.
Thank you for the write up. The update from 3.1.4 to 3.2 requires all plugins to be disabled before the update. https://github.com/Leantime/leantime/releases/tag/v3.2.0
I'll see if we can check plugin versions early in the stack to not cause a 500 but some plugins tie in pretty early in the call stack.
@marcelfolaron Thank you, Marcel. Personally I can live with that information & behavior, there are probably other more important topics.
This doesn't fix the initial problem I have reported. I have not used any plugins at all and made sure there are none active when performing the upgrade to the latest Leantime version.
@RKLBusinessDevelopment Sorry to hear that. Can you please enable debug and please let us know of the detailed error information in your case? I assume you run your very own classic installation not based the official docker image, correct?
As for @mattjbayly - sounds like the installer already ran but has not finished the first time. Depending on your server configuration (esp. php running as apache module or via fcgi) it could be something like max_execution_time being set to low, so that the scripts which invoke the MySQL statements are limited in some way. Can you please provide the output of phpinfo? I assume you run your very own classic installation not based the official docker image, correct?
Thank you!
However, it is strange that setupDB is being run, as I would expect to run updateDB as all of you seem to update - not to freshly install.
So somewhat makes 3.2.x believe, that there is no (accessible) leantime database - and it starts an installation into an already existing database, which then fails as of course tables/views already exist.
These 2 commits introduced with 3.2.0 could be relevant:
https://github.com/Leantime/leantime/commit/d58e1648f3d1fd8a115b6ba712b74000533385aa
https://github.com/Leantime/leantime/commit/85a96484e0017f24f9d82e79f59a29e4b00b9d36
@RKLBusinessDevelopment @mattjbayly Possibly there is an issue with the database/schema versioning - or detecting the version correctly. Thus it would be helpful if you please provide the version information as it is currently stored in your leantime MySQL database. Then we can hopefully see what might be the actual issue / root cause.
Exactly same story here, but run on docker on Synolog DSM. I tried a full fresh installation of 3.20 or 3.2.1, but still behave as described above.
Hi, same here. I just updated your official docker image on synology to 3.2.1 After that the login is no longer possible. After login the page just refresh and shows the login screen again.
From what I can gather across other issue reports, the main problem is a new config that set cookies to be secure only. Meaning they have to be served via https. You can either try use a self signed certificate via reverse proxy or you can set the config in app/core until we have a fix out to make this a config var. Solution is outlined here: https://github.com/Leantime/leantime/issues/2699
Thanks! Setting the secure flag to false helped!
3.3 now has a config for LEANTIME_SESSION_SECURE which solves this issue