Error 500 after composer update in symfony 3 - symfony

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?

Related

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.

Sylius template rendering exception - channel not found

I just installed a copy of Sylius on my dev server (Ubuntu), configured the database parameters, resolved all dependencies, and ran sylius:install. Install completed successfully, and all looked good.
When trying to access the front-end (web/app_dev.php), however, I get an error thrown during template rendering:
Uncaught PHP Exception Twig_Error_Runtime: "An exception has been
thrown during the rendering of a template ("Channel could not be
found!") in "SyliusWebBundle:Frontend:layout.html.twig" at line 55."
at
/var/www/mysite.com/public_html/vendor/twig/twig/lib/Twig/Template.php
line 182 Context: { "exception": "Object(Twig_Error_Runtime)" }
I'm not entirely sure what channel it's unable to find, or how to resolve this.

symfony 2.8 debug fatal error double message

Environment: Symfony 2.8.1 with XAMPP Version 5.5.24 on Windows 7.
If I trigger a fatal error in a controller, anything as simple as $array = ; in production environment, I'm getting a default php error:
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\tgsupport-test\src\AppBundle\Controller\DefaultController.php on line 16
followed by symfony custom error page message. Obviously I'd want to avoid to show eorr info in production.
Moreover in prod.log I see a double critical error: under php.CRITICAL and request.CRITICAL. Is really useful to show the same error twice?
I'm using default configuration, indeed I just installed default framework without any custom setting and I triggered my error in AppBundle/DefaultController, so I was wondering if I'm missing anything.
I missed a php.ini configuration to avoid to display error messages in page.

Symfony2: __toString() must not throw an exception

I am deploying my Symfony2 application, but I am getting the following error:
FatalErrorException in classes.php line 0:
Error: Method Symfony\Component\HttpFoundation\Request::__toString() must not throw an exception
Apache is slightly more descriptive, stating something about Monolog:
PHP Fatal error: Method Symfony\\Component\\HttpFoundation\\Request::__toString() must not throw an exception in /my/path/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php on line 0
It is also the only thing It is not clear to me how this is happening. Dev-environment on my local machine is running fine.
I have tried to clear the prod cache, the composer cache and restarted apache service. I also did a fresh "composer install" after clearing its cache.
Anyone has an idea how this can be solved? Am running Symfony v2.7.4.
You should to check your $_COOKIE or $_SESSION for example;
The trouble is you could have array value in $_COOKIE, so on your debug environment you could fall into the following situation:
Debug::enable() //see, i don't exclude E_NOTICE here
$request = Request::createFromGlobals();
echo $request->__toString();
//so, from now you've got your Exception because of
//Debug package converts E_NOTICE to Fatal
//which turns into Exception
So if you want to fix this trouble you need to:
find the real reason of exception triggering (notice, deprecated, strict message, etc)
exclude it from Debug: Debug::enable(~E_NOTICE);
OR just remove (string)$request from your code if possible;
see Request code:
//part of __toString() method
foreach ($this->cookies as $k => $v) {
$cookies[] = $k.'='.$v;
}

Resources