0

When login form requests login_check action, nginx throws 502 error. Cannot figure out why is this happens

2015/11/07 18:49:37 [error] 26038#0: *2 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: test.local, request: "POST /admin/login/check HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "test.local", referrer: "http://test.local/admin/login"

site nginx config:

server {
    server_name test.local;
    root /var/www/test.local/web;

    location / {
        # try to serve file directly, fallback to app.php
        try_files $uri /app_dev.php$is_args$args;
    }

    location ~ .php(/|$) {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
    }

    error_log /var/log/nginx/test.local_error.log;
    access_log /var/log/nginx/test.local_access.log;
}
Alexdevid
  • 38
  • 1
  • 5
  • The actual problem is that your PHP process has died. What are the ~10 last lines of `/var/log/php5-fpm.log`? – lxg Nov 07 '15 at 17:01
  • @lxg yesterday ` [08-Nov-2015 22:40:11] WARNING: [pool www] child 8431 exited on signal 11 (SIGSEGV - core dumped) after 72.516228 seconds from start [08-Nov-2015 22:40:11] NOTICE: [pool www] child 8534 started ` Last 2 lines where error occured – Alexdevid Nov 08 '15 at 19:41
  • Segfault, nice. Has this happened before? When did this start occuring? After you’ve changed something? Have you installed any unusual or possibly incompabitle modules? – lxg Nov 08 '15 at 21:26
  • @lxg I did not noticed it before. Before that, I had apache2+php installed and had that segfault too. I removed all unnecessary extensions (like PhalconPHP, GD, XDebug and otheres) but it did not help. Then I installed php-fpm, but the error still exists. Something in Symfony security component causes it when I try to login. And it occurs only when I use model provider. It works fine with `in_memory` provider, but I want to load users from database. >. – Alexdevid Nov 09 '15 at 10:56
  • Can you please try the following: Put the code that causes the error in a Symfony command and execute it from the CLI. If you can reproduce the error, prepend `strace` to the call, i.e. `strace app/console your:command`. Then post the last ~500 lines of the strace output to some pastebin and give me the URL. – lxg Nov 09 '15 at 11:18
  • @lxg, How is it possible to make login in CLI? There is no Request and Session. http://pastebin.com/cGaKS8Sb I think I'll dive into symfony package to find the line of code that produces this error – Alexdevid Nov 09 '15 at 14:18
  • Something like this http://stackoverflow.com/questions/9550079/how-to-programmatically-login-authenticate-a-user or google "symfony automatic login" – lxg Nov 09 '15 at 14:38

0 Answers0