Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 when calling save() or update() #2642

Closed
braska opened this issue Jul 25, 2014 · 7 comments
Closed

502 when calling save() or update() #2642

braska opened this issue Jul 25, 2014 · 7 comments

Comments

@braska
Copy link

braska commented Jul 25, 2014

I get an error 502 when calling \Phalcon\Mvc\Model::save() or \Phalcon\Mvc\Model::update(). In nginx logs I see:
2014/07/26 01:15:12 [error] 18552#0: *78 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: ************, server: goldkamea.agrimart.ru, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "***********"
In other logs I found nothing.

@phalcon
Copy link
Collaborator

phalcon commented Jul 25, 2014

Could you please submit a full script to reproduce the problem along with the OS and Phalcon version?

@braska
Copy link
Author

braska commented Jul 25, 2014

<?php

/*CREATE TABLE `persons` (
`id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8*/

$di = new Phalcon\DI\FactoryDefault();

$di->setShared('db', function() use ($di) {
    $connection = new \Phalcon\Db\Adapter\Pdo\Mysql(array(
        "host" => "localhost",
        "username" => "myuser",
        "password" => "mypassword",
        "dbname" => "phalcon_test",
        "charset"   => "utf8"
    ));
    return $connection;
});


class Persons extends \Phalcon\Mvc\Model {
}

$person = new Persons();
//this method works 
$person->create(array('name'=>'John'));


//this method calls 502
$person->save(array('name'=>'Martin'));

//and this method calls 502
$person->update(array('name'=>'Martin'));

Phalcon 1.3.2, ubuntu 12.04, php 5.5.15 (from ppa:ondrej/php5), nginx 1.6.0 (from ppa:nginx/stable), mariaDB 10.0.12
but I've tried Phalcon 1.3.1 and 1.2.6 and I again received 502.
All Phalcon dependencies are installed.

@braska
Copy link
Author

braska commented Jul 25, 2014

GDB output:

root@44051-10001:/tmp# gdb /usr/sbin/php5-fpm core-php5-fpm.19216 
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/sbin/php5-fpm...Reading symbols from /usr/lib/debug/usr/sbin/php5-fpm...done.
done.
[New LWP 19216]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php-fpm: pool www                                                       '.
Program terminated with signal 4, Illegal instruction.
#0  0x00007f2ddc21e70a in is_numeric_string.part.260.constprop.354 () from /usr/lib/php5/20121212/phalcon.so

@Ni-vek
Copy link

Ni-vek commented Jul 26, 2014

This error often comes from nginx socket. See this link : http://www.nginxtips.com/502-bad-gateway-using-nginx/

@braska
Copy link
Author

braska commented Jul 26, 2014

Other sites on this server that don't use phalcon work fine.

@braska
Copy link
Author

braska commented Jul 26, 2014

I can't continue to work because of this problem((( Have anyone any other opinions?

@braska
Copy link
Author

braska commented Jul 28, 2014

Now it works.
I followed these instructions given by 'ghost': #1385 (comment)

@braska braska closed this as completed Jul 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants