0
votes

I have problem the serve side of api-platform. I'm building a API which worked fine until I had to restart my computer. Then when I tried to restart the server with docker-compose up -d some containers are crashing (see docker-composer ps n°1 below).

I've reinstall api-platform and put all the old code in it and it work well until a new restart of my computer.

When I do docker-composer restart the 2 container which is crashing are "api-platform-230_copie1_cache-proxy_1" and "api-platform-230_copie1_php_1" (see docker-compose ps n°2)

The docker logs for cache_proxy_1 is :

mathieu:api-platform-2.3.0_copie1 Mathieu$ docker logs api-platform-230_copie1_cache-proxy_1
+ varnishd -a :80 -f /etc/varnish/default.vcl -s malloc,256m
Error:
Message from VCC-compiler:
Backend host '"api"' could not be resolved to an IP address:
	Name does not resolve
(Sorry if that error message is gibberish.)
('/etc/varnish/default.vcl' Line 6 Pos 11)
  .host = "api";
----------#####-

Running VCC-compiler failed, exited with 2
VCL compilation failed
+ varnishd -a :80 -f /etc/varnish/default.vcl -s malloc,256m
Error:
Message from VCC-compiler:
DNS lookup(php): Name does not resolve
('/etc/varnish/default.vcl' Line 21 Pos 3)
  "php";
--#####-

Running VCC-compiler failed, exited with 2
VCL compilation failed
+ varnishd -a :80 -f /etc/varnish/default.vcl -s malloc,256m
Error:
Message from VCC-compiler:
DNS lookup(php): Name does not resolve
('/etc/varnish/default.vcl' Line 21 Pos 3)
  "php";
--#####-

Running VCC-compiler failed, exited with 2
VCL compilation failed
+ varnishd -a :80 -f /etc/varnish/default.vcl -s malloc,256m
Debug: Platform: Linux,4.9.93-linuxkit-aufs,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Debug: Child (19) Started
+ varnishlog
+ varnishd -a :80 -f /etc/varnish/default.vcl -s malloc,256m
Error:
Message from VCC-compiler:
DNS lookup(php): Name does not resolve
('/etc/varnish/default.vcl' Line 21 Pos 3)
  "php";
--#####-

Running VCC-compiler failed, exited with 2
VCL compilation failed

The docker logs for php_1 is :

mathieu:api-platform-2.3.0_copie1 Mathieu$ docker logs api-platform-230_copie1_php_1
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for phpoffice/phpspreadsheet 1.4.0 -> satisfiable by phpoffice/phpspreadsheet[1.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/05-opcache.ini
    - /usr/local/etc/php/conf.d/20-apcu.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for phpoffice/phpspreadsheet 1.4.0 -> satisfiable by phpoffice/phpspreadsheet[1.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/05-opcache.ini
    - /usr/local/etc/php/conf.d/20-apcu.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for phpoffice/phpspreadsheet 1.4.0 -> satisfiable by phpoffice/phpspreadsheet[1.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/05-opcache.ini
    - /usr/local/etc/php/conf.d/20-apcu.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for phpoffice/phpspreadsheet 1.4.0 -> satisfiable by phpoffice/phpspreadsheet[1.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/05-opcache.ini
    - /usr/local/etc/php/conf.d/20-apcu.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
    - Installation request for phpoffice/phpspreadsheet 1.4.0 -> satisfiable by phpoffice/phpspreadsheet[1.4.0].

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/php.ini
    - /usr/local/etc/php/conf.d/05-opcache.ini
    - /usr/local/etc/php/conf.d/20-apcu.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Do you have an idea of the problem?

I'm not really a developer, I'm cardiologist so please be indulgent

I'm in localhost. I'm using mac and the last version of api-platform (2.3.0)

Last thing, I don't know how to install bundle properly with docker and api platform so I do it with composer.phar directly in the api directory. Can it be the source of the problem?

Thanks

docker-compose ps n°1

docker-compose ps n°2

1
Can you check the logs of said containers? Maybe they tell us a little more details about why the crash happens. docker logs CONTAINER is the command, where CONTAINER is your container name. You can use the --since X flag to get the last minutes/hours, where X is "42m" for 42 minutes (you get the idea). - GxTruth

1 Answers

0
votes

I think that the problem came from the installation of "yectep/phpspreadsheet-bundle". I reinstall api-platform, install composer.phar, updated "symfony/flex" installed "symfony/dotenv" and everything was ok until I've installed "yectep/phpspreadsheet-bundle". My problem is know how to transfer data (more than 100000 entries) from an excel to my database without this bundle, but it is another question !