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
Comments
Could you please submit a full script to reproduce the problem along with the OS and Phalcon version? |
<?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 |
GDB output:
|
This error often comes from nginx socket. See this link : http://www.nginxtips.com/502-bad-gateway-using-nginx/ |
Other sites on this server that don't use phalcon work fine. |
I can't continue to work because of this problem((( Have anyone any other opinions? |
Now it works. |
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.
The text was updated successfully, but these errors were encountered: