monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.68k stars 2.17k forks source link

Constructor failed #6719

Open IngwiePhoenix opened 1 year ago

IngwiePhoenix commented 1 year ago

I tried to create a new contact and got this stacktrace:

root@FriendlyWrt /s/s/m/s/logs ((v4.0.0))# cat laravel-2023-06-27.log
[2023-06-27 13:36:06] production.ERROR: Constructor failed {"userId":1,"exception":"[object] (IntlException(code: 0): Constructor failed at /sdcard/srv/monica/app/Helpers/CollectionHelper.php:62)
[stacktrace]
#0 /sdcard/srv/monica/app/Helpers/CollectionHelper.php(62): Collator->__construct()
#1 /sdcard/srv/monica/app/Helpers/CollectionHelper.php(33): App\\Helpers\\CollectionHelper::getCollator()
#2 /sdcard/srv/monica/app/Helpers/GenderHelper.php(25): App\\Helpers\\CollectionHelper::sortByCollator()
#3 /sdcard/srv/monica/app/Http/Controllers/ContactsController.php(182): App\\Helpers\\GenderHelper::getGendersInput()
#4 /sdcard/srv/monica/app/Http/Controllers/ContactsController.php(148): App\\Http\\Controllers\\ContactsController->createForm()
#5 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ContactsController->create()
#6 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#7 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#8 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#9 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#10 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#11 /sdcard/srv/monica/vendor/pragmarx/google2fa-laravel/src/Middleware.php(15): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): PragmaRX\\Google2FALaravel\\Middleware->handle()
#13 /sdcard/srv/monica/vendor/asbiin/laravel-webauthn/src/Http/Middleware/WebauthnMiddleware.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): LaravelWebauthn\\Http\\Middleware\\WebauthnMiddleware->handle()
#15 /sdcard/srv/monica/app/Http/Middleware/EnsureEmailIsVerified.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\EnsureEmailIsVerified->handle()
#17 /sdcard/srv/monica/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Laravel\\Passport\\Http\\Middleware\\CreateFreshApiToken->handle()
#19 /sdcard/srv/monica/app/Http/Middleware/CheckCompliance.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckCompliance->handle()
#21 /sdcard/srv/monica/app/Http/Middleware/CheckVersion.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckVersion->handle()
#23 /sdcard/srv/monica/app/Http/Middleware/CheckLocale.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckLocale->handle()
#25 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#27 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#29 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#31 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#33 /sdcard/srv/monica/app/Http/Middleware/SentryContext.php(42): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\SentryContext->handle()
#35 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#37 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#38 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#40 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#42 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Router.php(797): Illuminate\\Pipeline\\Pipeline->then()
#44 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack()
#45 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute()
#46 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute()
#47 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
#48 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#49 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#51 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#52 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#54 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#55 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#57 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#59 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#61 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#63 /sdcard/srv/monica/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#64 /sdcard/srv/monica/public/index.php(54): Illuminate\\Foundation\\Http\\Kernel->handle()
#65 {main}
"}

PHP verrsion is 8.2.7, and Monica on 4.0.0

Any ideas?

Thanks!

rahilarious commented 1 year ago

Facing same issue here. Using docker image and official docs

DunklerPhoenix commented 1 year ago

Did someone found a solution? Is there an newer Image for chandler?

zarunet commented 1 year ago

For what it's worth, i was able to get around this by deleting the locale cookie on my browser.

Seems like Laravel encrypts cookies and LanguageDetector isn't expecting that, thus setting the locale to what amounts to random garbage. This gets then passed to php-intl which Does Not Like It™

DunklerPhoenix commented 1 year ago

This really helps. Thank you :3