Error during deployment of Symfony 5 on Heroku - symfony
I really need help for this one. I created an app (with login and signup) that allows you to monitor ongoing projects and their associated tasks. Each project has a user as creator. I deployed it on Heroku, when I create a project, I should be redirected to my account (/account) and have all the projects listed, but it does not work. I know the project is created because I can see its details on another URL like /project/[id]/details, but I can no longer go back to /account URL. I get this error on my website :
Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
my Heroku logs :
2022-05-17T10:13:06.508011+00:00 heroku[router]: at=info method=GET path="/account" host=ebi-tracker.herokuapp.com request_id=51d1ce91-7b3d-4619-9692-cd8fcb849910 fwd="77.198.36.214" dyno=web.1 connect=0ms service=23ms status=500 bytes=1113 protocol=https
2022-05-17T10:13:06.503594+00:00 app[web.1]: [2022-05-17T10:13:06.502577+00:00] deprecation.INFO: Deprecated: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero {"exception":"[object] (ErrorException(code: 0): Deprecated: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /app/vendor/twig/twig/src/Extension/CoreExtension.php:940)"} []
2022-05-17T10:13:06.506126+00:00 app[web.1]: {"message":"Matched route \"app_account\".","context":{"route":"app_account","route_parameters":{"_route":"app_account","_controller":"App\\Controller\\UserController::account"},"request_uri":"http://ebi-tracker.herokuapp.com/account","method":"GET"},"level":200,"level_name":"INFO","channel":"request","datetime":"2022-05-17T10:13:06.486637+00:00","extra":{}}
2022-05-17T10:13:06.506484+00:00 app[web.1]: {"message":"Checking for authenticator support.","context":{"firewall_name":"main","authenticators":1},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.486973+00:00","extra":{}}
2022-05-17T10:13:06.506917+00:00 app[web.1]: {"message":"Checking support on authenticator.","context":{"firewall_name":"main","authenticator":"App\\Security\\LoginAuthenticator"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.486978+00:00","extra":{}}
2022-05-17T10:13:06.507429+00:00 app[web.1]: {"message":"Authenticator does not support the request.","context":{"firewall_name":"main","authenticator":"App\\Security\\LoginAuthenticator"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.486983+00:00","extra":{}}
2022-05-17T10:13:06.507973+00:00 app[web.1]: {"message":"Read existing security token from the session.","context":{"key":"_security_main","token_class":"Symfony\\Component\\Security\\Http\\Authenticator\\Token\\PostAuthenticationToken"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.499829+00:00","extra":{}}
2022-05-17T10:13:06.508459+00:00 app[web.1]: {"message":"User was reloaded from a user provider.","context":{"provider":"Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider","username":"jnguessan2003#gmail.com"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.502157+00:00","extra":{}}
2022-05-17T10:13:06.509406+00:00 app[web.1]: {"message":"Deprecated: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero","context":{"exception":{"class":"ErrorException","message":"Deprecated: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero","code":0,"file":"/app/vendor/twig/twig/src/Extension/CoreExtension.php:940"}},"level":200,"level_name":"INFO","channel":"deprecation","datetime":"2022-05-17T10:13:06.502577+00:00","extra":{}}
2022-05-17T10:13:06.511950+00:00 app[web.1]: {"message":"Uncaught PHP Exception Twig\\Error\\RuntimeError: \"An exception has been thrown during the rendering of a template (\"The Symfony\\Polyfill\\Intl\\Icu\\IntlDateFormatter::__construct() method's argument $locale value 'fr' behavior is not implemented. Only the locale \"en\" is supported. Please install the \"intl\" extension for full localization capabilities.\").\" at /tmp/build_4ffe4d79/templates/pages/account/index.html.twig line 29","context":{"exception":{"class":"Twig\\Error\\RuntimeError","message":"An exception has been thrown during the rendering of a template (\"The Symfony\\Polyfill\\Intl\\Icu\\IntlDateFormatter::__construct() method's argument $locale value 'fr' behavior is not implemented. Only the locale \"en\" is supported. Please install the \"intl\" extension for full localization capabilities.\").","code":0,"file":"/tmp/build_4ffe4d79/templates/pages/account/index.html.twig:29","previous":{"class":"Symfony\\Polyfill\\Intl\\Icu\\Exception\\MethodArgumentValueNotImplementedException","message":"The Symfony\\Polyfill\\Intl\\Icu\\IntlDateFormatter::__construct() method's argument $locale value 'fr' behavior is not implemented. Only the locale \"en\" is supported. Please install the \"intl\" extension for full localization capabilities.","code":0,"file":"/app/vendor/symfony/polyfill-intl-icu/IntlDateFormatter.php:148"}}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2022-05-17T10:13:06.505321+00:00","extra":{}}
2022-05-17T10:13:06.512287+00:00 app[web.1]: {"message":"Stored the security token in the session.","context":{"key":"_security_main"},"level":100,"level_name":"DEBUG","channel":"security","datetime":"2022-05-17T10:13:06.506763+00:00","extra":{}}
2022-05-17T10:13:06.512571+00:00 app[web.1]: 10.1.27.78 - - [17/May/2022:10:13:06 +0000] "GET /account HTTP/1.1" 500 831 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0
Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("The Symfony\Polyfill\Intl\Icu\IntlDateFormatter::__construct() method's argument $locale value 'fr' behavior is not implemented. Only the locale "en" is supported. Please install the "intl" extension for full localization capabilities.
So, install the intl extension.
On Heroku you can do that by adding ext-intl as a dependency in your composer.json:
{
"require": {
"ext-intl": "*"
}
}
Then commit and redeploy.
You might also have to enable an appropriate locale, but see if the above works on its own first.
Related
Error 500 after composer update in symfony 3
i try to clone my project into my computer. I had clone the repository and done "composer update". All without any errors. when i try to visit my site show this error Call to a member function has() on null 500 Internal Server Error - FatalThrowableError and the debug CRITICAL - Call to a member function has() on null CRITICAL - Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function has() on null" at C:\xampp\htdocs\richiesta_analisi\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Controller\Controller.php line 234 is the same repository that i had in remote so i don't understand why don't work. i tryed to clear cache and composer upgrade but nothing. Can you help me?
Error loading repositories
In the Azure portal, when I go to my Container Registry and click on Repositories (under Services), my repositories don't load and I get the error message Error loading repositories. The console of Chrome contains the following error messages: GET https://REMOVED.azurecr.io/v2/_catalog 401 (Unauthorized) - REMOVED.azurecr.io/v2/_catalog:1 [Microsoft_Azure_ContainerRegistries] 1:20:06 PM - efe5474C39B089216811DEA68B8392644A0C676A067.js:24 (With body:) MsPortalFx.Base.Diagnostics.ErrorReporter 1 MsPortalFx.Base.Diagnostics.ErrorReporter: _errorData: undefined _sourceErrorLevel: undefined baseTypes: ["MsPortalFx.Errors.AjaxError","MsPortalFx.Errors.Error"] code: undefined data: {"type":"GET","sessionId":"9e259d2b5dab4ad2972a1e6b76e844d2","status":401,"statusText":"Unauthorized","duration":28.5} errorLevel: 2 errorThrown: Unauthorized extension: Microsoft_Azure_ContainerRegistries handled: undefined innerErrors: [] jqXHR: {"readyState":4,"responseText":"{\"errors\":[{\"code\":\"UNAUTHORIZED\",\"message\":\"authentication required\",\"detail\":[{\"Type\":\"registry\",\"Name\":\"catalog\",\"Action\":\"*\"}]}]}\n","responseJSON":{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"registry","Name":"catalog","Action":"*"}]}]},"status":401,"statusText":"Unauthorized"} message: ajaxExtended call failed name: Error source: undefined stack: null textStatus: error timestamp: 1567.8750000000002 type: MsPortalFx.Errors.AjaxError The error says I'm unauthorized, but I have the Owner role, so this should not be possible. Other users that are owner don't get this error. Any clue how I can fix this?
The error resolved itself after a couple of days. I tried using a different browser and a different computer. Both methods still showed the error. So I think it might have been a bug.
just uploaded my AKS and needed to pull lots of images from ACR. also got error afterwards due to load: {"type":"MsPortalFx.Errors.FetchDataError","baseTypes":["MsPortalFx.Errors.FetchDataError","MsPortalFx.Errors.DataError","MsPortalFx.Errors.Error"],"_errorData":{"readyState":4,"responseText":"","status":500,"statusText":"Internal Server Error"},"extension":"Microsoft_Azure_ContainerRegistries","errorLevel":2,"timestamp":10180.93499999668,"source":"DataCache:2:3","message":"","name":"Error","innerErrors":[],"dataSetName":"DataCache:2:3"}
JMS Call to a member function has() on null
Bundle version 1.3.1 | Symfony version 3.3 | PHP version 7.1.9 Expected behavior After installing the different bundles (JMSTranslationBundle, JMSDIExtraBundle, checking if i had sensio/framework-extra-bundle), and after i made the right configuration in config.yml and routing_dev.yml, the right behavior should be that the /_trans lead me to a translation interface (working), and change nothing else. Actual behavior Getting on a route different from /_trans return Call to a member function has() on null with error 500. Therefore, the whole site is dead, except the translation UI. Steps to reproduce Install JMSTranslationBundle, then when asked, install JMSDIExtraBundle to get the web ui After that, test the /_trans. This should work. But when you get to your others routes, they return 500 error
I have exactly the same issue (Sf 3.3.9/PHP 7.1.9). I have to remove the line related to "JMSDiExtraBundle" in AppKernel to make my app works again. This is the only workaround I found, not very efficient. Very low trace log information, this is what I have: Stack Trace: Logs: CRITICAL 19:56:59 php Call to a member function has() on null CRITICAL 19:56:59 request Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function has() on null" at /Users/stephanfo/PhpstormProjects/openbuy/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php line 233 Exception: Any help would be helpful. Thanks, Stef.
Akeneo - Cannot access specific parts of the backend (http 500)
I am having some trouble to test akeneo (PIM based on symfony) features, as some parts of akeneo backend return the following error: Sorry, page was not loaded correctly It specifically occurs if I click under enrich, or settings. I checked under app/logs, here is what I found: [2016-11-05 13:57:36] request.CRITICAL: Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("There are no activated locales") in "/var/www/html/pim-community-standard/vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/Resources/views/Attribute/index.html.twig" at line 68." at /var/www/html/pim-community-standard/app/cache/prod/classes.php line 5700 {"exception":"[object] (Twig_Error_Runtime(code: 0): An exception has been thrown during the rendering of a template (\"There are no activated locales\") in \"/var/www/html/pim-community-standard/vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/Resources/views/Attribute/index.html.twig\" at line 68. at /var/www/html/pim-community-standard/app/cache/prod/classes.php:5700, LogicException(code: 0): There are no activated locales at /var/www/html/pim-community-standard/vendor/akeneo/pim-community-dev/src/Pim/Bundle/UserBundle/Context/UserContext.php:110)"} [] I searched almost everything I could find in forums, but I'm still stuck with this issue. Another error is also logged (depending on where I click): [2016-11-05 13:58:55] request.CRITICAL: Uncaught PHP Exception LogicException: "There are no activated locales" at /var/www/html/pim-community-standard/vendor/akeneo/pim-community-dev/src/Pim/Bundle/UserBundle/Context/UserContext.php line 110 {"exception":"[object] (LogicException(code: 0): There are no activated locales at /var/www/html/pim-community-standard/vendor/akeneo/pim-community-dev/src/Pim/Bundle/UserBundle/Context/UserContext.php:110)"} [] These are the two errors that I was able to find in logs. I double checked the install & all requirements (ubuntu 1.14). Everything seems fine. Would you have an idea? Thanks in advance!
Try to go "My Account - Additional" and select 2 locales, English and Spanish for example. Then go to console and delete the folder pim-community-standard/app/cache/ When starting again Akeneo, view all akeneo_pim logs, or make a tail -f /logs* in the logsfolder.
Difference between messages : 'server returning 404' AND 'No route found for GET /routeName
windows 8. symfony 2.7 installed with default settings on d:\htdocs\sym\again\blog\ With apache, running the URL: http://localhost/sym/again/blog/web/hello , returns the following error: Oops! An Error Occurred The server returned a "404 Not Found". Something is broken. Please let us know what you were doing when this error... INFO: The above error is different from regular apache 404 'object not found' message. for http://localhost/NonExistingPage With the built in PHP server php app/console server:run, running the URL http://localhost:8000/NonExistingRoute returns No route found for "GET /NonExistingRoute" 404 Not Found - NotFoundHttpException 1 linked Exception: ResourceNotFoundException ยป while running the URL http://localhost:8000/hello, returns the actual page. Question: What is the different between the errors ? My understanding: the regular apache error is simply when a file is requested that is not found by apache The 'Oops! An Error Occurred The server returned a "404 Not Found". Something is broken' is what is confusing me, I don't understand why/how it is different from the route not found errors. the route not found means that it reached symfony but did not find any route matching /NonExistingRoute in the routes file. Another Strange thing: if routing.yml is changed to: offtopic_books_homepage: path: /sym/again/blog/web/hello defaults: { _controller: OfftopicBooksBundle:Default:index } then http://localhost:8000/sym/again/blog/web/hello - returns the expected page. (with app/console running) Whereas http://localhost/sym/again/blog/web/hello - gives the following error: Oops! An Error Occurred The server returned a "404 Not Found". Why ?
In this case please reset cache for prod env: php app/console c:c -e prod Note: Please use dev env and app_dev.php for development, not production environment.