Leantime / leantime

Leantime is a goals focused project management system for non-project managers. Building with ADHD, Autism, and dyslexia in mind.
https://leantime.io
GNU Affero General Public License v3.0
4.59k stars 596 forks source link

[Bug]: Cannot Login Fresh Install Leantime 3.2.1 #2710

Closed swanadiva closed 4 weeks ago

swanadiva commented 1 month ago

What is your set up?

Self Hosted Server

Version

3.2.1

Describe the issue

Hi, just trying to install leantime 3.2.1 on my own server using apache setup. Installation is successfull i think because the database is well migrated, but everytime i try to login it's always redirected to login page again and when i check th log file in leantime.log there is error like this

`[2024-09-25 16:25:46] production.ERROR: foreach() argument must be of type array|object, null given {"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, null given at /var/www/html/leantime/vendor/illuminate/collections/Arr.php:255) [stacktrace]

0 /var/www/html/leantime/app/Core/Exceptions/HandleExceptions.php(255): Leantime\Core\Exceptions\HandleExceptions->handleError()

1 /var/www/html/leantime/vendor/illuminate/collections/Arr.php(255): Leantime\Core\Exceptions\HandleExceptions->Leantime\Core\Exceptions\{closure}()

2 /var/www/html/leantime/app/Core/Console/ConsoleKernel.php(154): Illuminate\Support\Arr::flatten()

3 /var/www/html/leantime/app/Core/Console/ConsoleKernel.php(36): Leantime\Core\Console\ConsoleKernel->commands()

4 /var/www/html/leantime/app/Core/Console/ConsoleKernel.php(253): Leantime\Core\Console\ConsoleKernel->bootstrap()

5 /var/www/html/leantime/app/Domain/Cron/Controllers/Run.php(60): Leantime\Core\Console\ConsoleKernel->call()

6 /var/www/html/leantime/app/Core/Events/EventDispatcher.php(470): Leantime\Domain\Cron\Controllers\Run->Leantime\Domain\Cron\Controllers\{closure}()

7 /var/www/html/leantime/app/Core/Events/EventDispatcher.php(74): Leantime\Core\Events\EventDispatcher::executeHandlers()

8 /var/www/html/leantime/app/Core/Events/DispatchesEvents.php(28): Leantime\Core\Events\EventDispatcher::dispatch_event()

9 /var/www/html/leantime/app/Core/Http/HttpKernel.php(109): Leantime\Core\Http\HttpKernel::dispatch_event()

10 /var/www/html/leantime/app/Core/Bootstrap/Bootloader.php(154): Leantime\Core\Http\HttpKernel->terminate()

11 /var/www/html/leantime/app/Core/Bootstrap/Bootloader.php(129): Leantime\Core\Bootstrap\Bootloader->handleRequest()

12 /var/www/html/leantime/public/index.php(13): Leantime\Core\Bootstrap\Bootloader->boot()

13 {main}

"} [2024-09-25 16:25:46] production.INFO: Command Output: [2024-09-25 16:25:46] production.INFO: Cron run finished`

and i can't login at all Screenshot_20240925_162603_Termius

Reproduction steps

1. 2. 3. ...

Additional Notes

No response

PGostek commented 1 month ago

Similar story here, but run on docker on the Synology DSM. I tried a full fresh installation of 3.20 or 3.2.1, but still behave as described above.

marcelfolaron commented 1 month ago

Do you have ssl set up? I realized this may be the source of the problem. The cookies have the “secure” flag set in 3.2

Marcel Folaron - Co-Founder

phone. 206-371-1325

email. @.***

web. https://leantime.io

On Thu, Sep 26, 2024 at 08:38 PGostek @.***> wrote:

Similar story here, but run on docker on the Synology DSM. I tried a full fresh installation of 3.20 or 3.2.1, but still behave as described above.

— Reply to this email directly, view it on GitHub https://github.com/Leantime/leantime/issues/2710#issuecomment-2376836974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFXS4WICTHXCBGCCZPTZYP527AVCNFSM6AAAAABO2DAQD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZWHAZTMOJXGQ . You are receiving this because you were assigned.Message ID: @.***>

swanadiva commented 1 month ago

no, not yet, but can we unflag the "secure" cookies by set it up in the config file or any other files?

fvbuelow commented 1 month ago

Same problem here on Unraid docker.

vladimirdulov commented 1 month ago

It looks like it caused by the commit.

https://github.com/Leantime/leantime/commit/cfe45394bc837ef358a3adc7f891cd3074f13f45#diff-7d7f8f3296724f453ed9b7898d373759994164cbcb4800f014d1c5c11fcdf175

I've reverted changes in app/Core/Console/ConsoleKernel.php and the error has disappeared.

foreach() argument must be of type array|object, null given {"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, null given at /var/www/html/leantime/vendor/illuminate/collections/Arr.php:255)
PGostek commented 1 month ago

It looks like it caused by the commit.

cfe4539#diff-7d7f8f3296724f453ed9b7898d373759994164cbcb4800f014d1c5c11fcdf175

I've reverted changes in app/Core/Console/ConsoleKernel.php and the error has disappeared.

foreach() argument must be of type array|object, null given {"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, null given at /var/www/html/leantime/vendor/illuminate/collections/Arr.php:255)

Is there any way I can do that mod for the docker image? Or should we wait for the next official release ?

vladimirdulov commented 1 month ago

You can try to download app/Core/Console/ConsoleKernel.php from the repo and push it to the docker container (don't forget to create a backup copy of the file in the container before file replacement). https://github.com/Leantime/leantime/blob/103c79ecb5ac4af169a5ff74731a18509a6d17fb/app/Core/Console/ConsoleKernel.php If you feel unsure about it, better to wait when it gets sorted and released.

blqdev commented 1 month ago

You can try to download app/Core/Console/ConsoleKernel.php from the repo and push it to the docker container (don't forget to create a backup copy of the file in the container before file replacement). https://github.com/Leantime/leantime/blob/103c79ecb5ac4af169a5ff74731a18509a6d17fb/app/Core/Console/ConsoleKernel.php If you feel unsure about it, better to wait when it gets sorted and released.

This doesn't work for me - replacing ConsoleKernel.php causes the same issue but with no log/error entry.

Installing 3.2.0 causes the same issue, also with no log/error entry.

Installing 3.1.4 causes Error 500.

Does it matter if I'm running MariaDB instead of MySQL?

swanadiva commented 1 month ago

Do you have ssl set up? I realized this may be the source of the problem. The cookies have the “secure” flag set in 3.2 Marcel Folaron - Co-Founder phone. 206-371-1325 email. @. web. https://leantime.io On Thu, Sep 26, 2024 at 08:38 PGostek @.> wrote: Similar story here, but run on docker on the Synology DSM. I tried a full fresh installation of 3.20 or 3.2.1, but still behave as described above. — Reply to this email directly, view it on GitHub <#2710 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFXS4WICTHXCBGCCZPTZYP527AVCNFSM6AAAAABO2DAQD2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZWHAZTMOJXGQ . You are receiving this because you were assigned.Message ID: @.***>

I've tried everything that mention in the reply, but there is still problem and this is the only solution that can work for me. Setup the SSL

gramakri commented 1 month ago

I was looking into fixing the Cloudron package and hit this issue. It seems the CLI is throwing exceptions. Web interface generally works. The init, migrate and cron commands all fail with the same exception.

root@7a205e0a-e703-4deb-b8e6-8eabb113190c:/app/code# /app/code/bin/leantime db:migrate
ErrorException: foreach() argument must be of type array|object, null given in /app/code/vendor/illuminate/collections/Arr.php:255
Stack trace:
#0 /app/code/app/Core/Exceptions/HandleExceptions.php(255): Leantime\Core\Exceptions\HandleExceptions->handleError()
#1 /app/code/vendor/illuminate/collections/Arr.php(255): Leantime\Core\Exceptions\HandleExceptions->Leantime\Core\Exceptions\{closure}()
#2 /app/code/app/Core/Console/ConsoleKernel.php(154): Illuminate\Support\Arr::flatten()
#3 /app/code/app/Core/Console/ConsoleKernel.php(36): Leantime\Core\Console\ConsoleKernel->commands()
#4 /app/code/app/Core/Console/ConsoleKernel.php(233): Leantime\Core\Console\ConsoleKernel->bootstrap()
#5 /app/code/app/Core/Bootstrap/Bootloader.php(163): Leantime\Core\Console\ConsoleKernel->handle()
#6 /app/code/app/Core/Bootstrap/Bootloader.php(129): Leantime\Core\Bootstrap\Bootloader->handleRequest()
#7 /app/code/bin/leantime(14): Leantime\Core\Bootstrap\Bootloader->boot()
#8 {main}
root@7a205e0a-e703-4deb-b8e6-8eabb113190c:/app/code# /app/code/bin/leantime cron:run
ErrorException: foreach() argument must be of type array|object, null given in /app/code/vendor/illuminate/collections/Arr.php:255
Stack trace:
#0 /app/code/app/Core/Exceptions/HandleExceptions.php(255): Leantime\Core\Exceptions\HandleExceptions->handleError()
#1 /app/code/vendor/illuminate/collections/Arr.php(255): Leantime\Core\Exceptions\HandleExceptions->Leantime\Core\Exceptions\{closure}()
#2 /app/code/app/Core/Console/ConsoleKernel.php(154): Illuminate\Support\Arr::flatten()
#3 /app/code/app/Core/Console/ConsoleKernel.php(36): Leantime\Core\Console\ConsoleKernel->commands()
#4 /app/code/app/Core/Console/ConsoleKernel.php(233): Leantime\Core\Console\ConsoleKernel->bootstrap()
#5 /app/code/app/Core/Bootstrap/Bootloader.php(163): Leantime\Core\Console\ConsoleKernel->handle()
#6 /app/code/app/Core/Bootstrap/Bootloader.php(129): Leantime\Core\Bootstrap\Bootloader->handleRequest()
#7 /app/code/bin/leantime(14): Leantime\Core\Bootstrap\Bootloader->boot()
#8 {main}
blqdev commented 4 weeks ago

Can confirm setting up SSL resolved the issue.