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

Docker Compose v2 - read /dev/stderr: bad file descriptor triggered by proc_open #107

Open
Plopix opened this issue Dec 29, 2021 · 3 comments

Comments

@Plopix
Copy link
Collaborator

Plopix commented Dec 29, 2021

Q A
Bug report? yes
Feature request? no
BC Break report? no
Environment Mac

Coming from this issue: #103

I also have read /dev/stderr: bad file descriptor with docker compose v2.

I have debugged and that is coming from proc_open.

I don't really understand how to fix this though. The problem is that somehow docker compose v2 detaches a thread/process or something and proc_open loses track of it.

It works like before for stop, start, etc. but for exec (used by ez enter) somehow something runs in the background, and Symfony Process triggers an exception.

read /dev/stderr: bad file descriptor is displayed by the proc_open

I did a reproducer, when you have a working project with eZ Launchpad

mkdir /tmp/testprocess
cd /tmp/testprocess
composer require symfony/process

Then use/adap this code:

<?PHP
// test.php

include "vendor/autoload.php";

use Symfony\Component\Process\Process;

$command = "<RUN `ez ps c` and copy/paste the string here> exec engine /bin/bash";

$process = Process::fromShellCommandline($command);
$process->setTimeout(2 * 3600);
$process->setTty(true);
$process->mustRun();

Example of $command

PROJECTNETWORKNAME=test PROJECTPORTPREFIX=42 PROJECTCOMPOSEPATH=/System/Volumes/Data/Users/plopix/Projects/Test PROVISIONINGFOLDERNAME=provisioning HOST_COMPOSER_CACHE_DIR=/System/Volumes/Data/Users/plopix/Projects/.composer_cache DEV_UID=501 DEV_GID=33 COMPOSER_CACHE_DIR=/var/www/composer_cache PROJECTMAPPINGFOLDER=/var/www/html/project BLACKFIRE_CLIENT_ID= BLACKFIRE_CLIENT_TOKEN= BLACKFIRE_SERVER_ID= BLACKFIRE_SERVER_TOKEN= DOCKER_HOST= DOCKER_CERT_PATH= DOCKER_TLS_VERIFY= PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin XDEBUG_ENABLED=0 docker-compose -p test -f /Users/plopix/Projects/Test/provisioning/dev/docker-compose.yml -f /Users/plopix/Projects/Test/provisioning/dev/docker-compose-osx.yml exec engine /bin/bash

This is ez ps c + exec engine /bin/bash

Run php test.php and see that is working => you get access to the container
Change the Docker Compose version to version 2 => see the error.

Any ideas are welcome! ping @YohannsMonnier @bdunogier @lserwatka @SylvainGuittard @florianalexandre @amine-betari @yhanini @anaelChardan @kmadejski @hubformation @sklimaszewski

There is probably a simple trick, and experts of proc_open (and related) might see the problem easily here.

@CodeCasterNL
Copy link

Related: docker/compose#9115

@Plopix
Copy link
Collaborator Author

Plopix commented Jan 20, 2022

hey, @CodeCasterNL that's exactly it.

@nicolasgreckas, I am pinging you here. You might have a solution for us to somehow change the Descriptors with Symfony? (Thanks :))

@Webarkitekt
Copy link

Hello, any news about the possibility to use Virtiofs and Docker compose v2 with launchpad ? I have serious latency with react components on the backend.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants