Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SIGSEGV php-fpm and 502 Bad Gateway Nginx #2128

Answered by divine
Arkango asked this question in Q&A
Discussion options

  • Laravel-mongodb Version: 3.7
  • PHP Version: 7.4
  • Database Driver & Version: mongodb 1.8.1

Description:

After a correct installation of the mongodb driver for php I installed using composer in a laravel project this library.

Steps to reproduce

  1. in php:7.4-fpm-alpine container I run
apk add --update --no-cache --virtual .docker-php-mongodb-dependancies \
 heimdal-dev && \
 pecl install mongodb && \
 docker-php-ext-enable mongodb && \
 apk del .docker-php-mongodb-dependancies && \
 php -m;
  1. I have another container to use composer
composer:
 image: composer:latest
 container_name: composer
 volumes:
 - ./src:/var/www/html
 working_dir: /var/www/html
 depends_on:
 - php
 networks:
 - laravel
  1. composer require jenssegers/mongodb
  • Installation request for mongodb/mongodb (locked at 1.7.1, required as ^1.7) -> satisfiable by mongodb/mongodb[1.7.1].

To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/php-cli.ini

  1. the module in the php container is correctly installed and I am able to connect to the mongo server using a php driver

  2. I bypassed the composer error usign --ignore-platform-reqs

  3. Laravel mongo db authentication works, but when i try to execute query i have the following errors
    php | [22-Oct-2020 15:15:40] WARNING: [pool www] child 8 exited on signal 11 (SIGSEGV) after 35.431576 seconds from start
    php | [22-Oct-2020 15:15:40] NOTICE: [pool www] child 9 started
    nginx | 2020年10月22日 15:15:40 [error] 6#6: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.29.0.1, server: localhost, request: "GET /test HTTP/1.1", upstream: "fastcgi://172.29.0.4:9000", host:

Expected behaviour

I tried editing permission and some configuration file in order to execute correctly the request but nothing

Actual behaviour

I recieved a 502 Bad gateway error due to php-fpm SIGSEGV

my nginx config file
Schermata 2020年10月23日 alle 08 47 49

You must be logged in to vote

Hello,

I don't see how your error related to this library at all. As it has been already said you've misconfigured your docker/php installation and still you didn't provide actual php errors.

That's really sad.

Thanks!

Replies: 5 comments 1 reply

Comment options

Hello,

I don't see how your error related to this library at all. As it has been already said you've misconfigured your docker/php installation and still you didn't provide actual php errors.

That's really sad.

Thanks!

You must be logged in to vote
0 replies
Answer selected by divine
Comment options

  • Laravel-mongodb Version: 3.7
  • PHP Version: 7.4
  • Database Driver & Version: mongodb 1.8.1

Description:

After a correct installation of the mongodb driver for php I installed using composer in a laravel project this library.

Steps to reproduce

  1. in php:7.4-fpm-alpine container I run
apk add --update --no-cache --virtual .docker-php-mongodb-dependancies \
 heimdal-dev && \
 pecl install mongodb && \
 docker-php-ext-enable mongodb && \
 apk del .docker-php-mongodb-dependancies && \
 php -m;
  1. I have another container to use composer
composer:
 image: composer:latest
 container_name: composer
 volumes:
 - ./src:/var/www/html
 working_dir: /var/www/html
 depends_on:
 - php
 networks:
 - laravel
  1. composer require jenssegers/mongodb
  • Installation request for mongodb/mongodb (locked at 1.7.1, required as ^1.7) -> satisfiable by mongodb/mongodb[1.7.1].

To enable extensions, verify that they are enabled in your .ini files:

  • /usr/local/etc/php/php-cli.ini
  1. the module in the php container is correctly installed and I am able to connect to the mongo server using a php driver
  2. I bypassed the composer error usign --ignore-platform-reqs
  3. Laravel mongo db authentication works, but when i try to execute query i have the following errors
    php | [22-Oct-2020 15:15:40] WARNING: [pool www] child 8 exited on signal 11 (SIGSEGV) after 35.431576 seconds from start
    php | [22-Oct-2020 15:15:40] NOTICE: [pool www] child 9 started
    nginx | 2020年10月22日 15:15:40 [error] 6#6: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.29.0.1, server: localhost, request: "GET /test HTTP/1.1", upstream: "fastcgi://172.29.0.4:9000", host:

Expected behaviour

I tried editing permission and some configuration file in order to execute correctly the request but nothing

Actual behaviour

I recieved a 502 Bad gateway error due to php-fpm SIGSEGV

my nginx config file
Schermata 2020年10月23日 alle 08 47 49

You can see on this configuration https://github.com/Smolevich/demo-mongo-application/blob/master/docker-compose.yml for example

You must be logged in to vote
0 replies
Comment options

@divine I haven't other php logs, i tried to setup a log folder, but nothing has been created.
@Smolevich I copied your php/nginx docker config and I have the same result.
My running machine is a Mac with OSx v. 10.15.7
I tried to had more resources to my docker instance but nothing.
Consider to install correctly this library in my php container i used php -m 'memory_limit=-1' composer require jenssegers/mongodb .

this belowe is my php info config file

Screenshot_2020年10月23日 PHP 7 3 23 - phpinfo()

You must be logged in to vote
0 replies
Comment options

 $manager = new \MongoDB\Driver\Manager("mongodb://user:user123@mongo:27017/homestead");
 $stats = new \MongoDB\Driver\Command(["dbstats" => 1]);
 $res = $manager->executeCommand("homestead", $stats);
 $stats = current($res->toArray());
 print_r($stats);

this code is in my laravel route without the library i can be able to execute the commands

You must be logged in to vote
0 replies
Comment options

@divine @Smolevich I did some debug on the service and in the connection string $config the password was not taken, the library doesn't show to me a connection error but the 502 php fpm error. I cleared the laravel config:cache and it works unexpectedly

You must be logged in to vote
1 reply
Comment options

Php-fpm process web requests, you don't show code that received http request
Show steps for reproduce or you can create PR here with demonstration problem
Now looks like error of configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2128 on October 23, 2020 08:04.

AltStyle によって変換されたページ (->オリジナル) /