Reputation: 179
I am currently developing a web application with Symfony that's supposed to connect to a remote Web-Service. Then synchronise database from the client to the server and vice-versa and some other crap.
The Web-service server is on an IIS in the LAN. Symfony2 is running with Wamp on my machine.
So, the connexion and request code to the web-service in a simple php script is perfectly functional. Or at least, it does what I want it to do. And any connexion to the IIS server is perfectly fine. A bit slow though, but the machine is quite a mess.
Now I put that same code into a Symfony2 class, and here comes the hell. When I try to load that page, I get a
101 error (ERR_CONNECTION_RESET)
Web-service server's log indicates me that the login, request and response were sent. So my guess is the problem is comin' from my machine, but not quite sure about it.
The really funny thing : I somehow managed to make it work for about 10 times. Then 101 again...
I disabled the Windows 7 LAN firewall both side, same result.
Any clue is very welcome. Thanks.
Upvotes: 3
Views: 3506
Reputation: 1
I had the same issue on Windows using XAMPP, and solved by:
composer require "twig/twig:^2.0"
Upvotes: 0
Reputation: 150
Mike WP made it. TwigEngine need LF line endings to work properly. You can use this console command then you'll have to update/reinstall vendors.
git config --global core.autocrlf input
Upvotes: 0
Reputation: 175
I spent hours debugging this with a colleague. He was getting the same error but it was working properly on my machine (we're using Windows 7, 64bit, WAMPServer 2.2d, 32bit).
Here is what the culprit was:
- the file TwigEngine.php had Unix-style line endings (LF) on my machine but on his machine it had Windows-style line endings (CR+LF)
- after changing the line endings to LF only, it works fine on his machine too
That would possibly explain the other answer above "all I needed to do is just resave TwigBundle/TwigEngine.php" if the editor changed the format of the line endings.
The underlying cause was the installation of git, he had picked the default ("Windows-style check-outs") and I had selected "as-is").
After some more research. here is an explanation of the cause for this: https://github.com/symfony/symfony/issues/3216
Hopefully this helps someone else save some time.
Upvotes: 3
Reputation: 179
In fact, I think (in my case at least) those errors are twig related. Sometimes, when there's a critical error related to twig logged in app/logs/dev.log, I got that 101. Those critical errors are often syntaxic, so no real deal here. And once they are dealt with, no problem anymore.
The strange thing is that sometimes, clearing the cache allows me to load the page 3 or 4 times.
Upvotes: 0
Reputation: 1341
I had same problem after 4 hours of "debuging" i found that all I needed to do is just resave
TwigBundle/TwigEngine.php
I have no clue why
Upvotes: 0
Reputation: 1900
I solve the problem...
I set the second parameter of AppKernel in app_dev.php to FALSE and now works fine
$kernel = new AppKernel('dev', FALSE);
I will continue investigating...
Upvotes: 0