"Failed to parse validation script output" for remote Docker compose CLI interpreter

I'm getting the following error in PhpStorm 2022.2.3:

When I execute:

docker compose exec app /usr/local/bin/php -v

It shows PHP version correctly.

And here's an excerpt from the logs:

2022-11-03 14:43:05,019 [30752053]   FINE - #c.j.p.c.p.PhpInfoUtil - Loaded helper: /opt/.phpstorm_helpers/phpinfo.php
2022-11-03 14:43:06,773 [30753807]   FINE - #c.j.p.c.p.PhpInfoUtil - Parsing validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

2022-11-03 14:43:06,776 [30753810]   INFO - STDERR - [Fatal Error] :1:1: Content is not allowed in prolog.
2022-11-03 14:43:06,777 [30753811]   WARN - #c.j.p.c.p.PhpInfoUtil - Failed to parse validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

2022-11-03 14:43:19,416 [30766450]   WARN - #c.i.o.o.e.ConfigurableCardPanel - auto-dispose 'PHP' id=reference.webide.settings.project.settings.php
2022-11-03 14:43:19,416 [30766450]   WARN - #c.i.o.o.e.ConfigurableCardPanel - auto-dispose 'PHP' id=reference.webide.settings.project.settings.php
2022-11-03 14:43:20,013 [30767047]   INFO - #c.i.c.ComponentStoreImpl - Saving appeditorConfigEncodings took 68 ms
13 comments
Comment actions Permalink
Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

That typically means there's something in your docker-compose config that prevents the container that IDE creates to communicate with your app. Is it possible to share your docker-compose & all related config files? 

You can share them privately at https://uploads.jetbrains.com/, just let us know the upload ID.

0
Comment actions Permalink

Hello! 

Have you an solution about this error?
I am exatally the same error :/ 

1
Comment actions Permalink

Same problem here after updating to 2022.2.3

0
Comment actions Permalink

There's still no solution to this because the details of the issue are unclear. It would be great if you could send us more info about your setup/project via Help | Contact Support or describe it here.

Would it help if you re-add this PHP Interpreter?

Would it help if you change the lifecycle of the interpreter to "docker-compose run" instead of "docker-compose exec"?

0
Comment actions Permalink

Dmitry Tronin hi!

Both options, run and exec, are have the same error. See into my print screens.


This is my docker-compose.yml:

version: '3.9'
services:
api_cadastrodasorte:
build:
context: .
volumes:
- '..:/var/www/html/cadastrodasorteapi.belezanatural.com.br'
- './cadastrodasorteapi.belezanatural.com.br.conf:/etc/nginx/sites-enabled/cadastrodasorteapi.belezanatural.com.br.conf'
ports:
- '8081:80'
entrypoint:
- /opt/99-entrypoint.sh
working_dir: /var/www/html/cadastrodasorteapi.belezanatural.com.br
environment:
PHP_IDE_CONFIG: serverName=cadastrodasorteapi.belezanatural.com.br

Docker configuration on PHP Storm > Settings:


I am using the Rancher Desktop on version 1.6.2 with dockerd as container engine.

My PHP Storm version/build:


The generated log is the same sent by Mr Wolowski.

Do you need some information more?

0
Comment actions Permalink

Thanks. I can see your docker-compose.yml file is in a subfolder. 

Would it work if you move it inside the root of your project? Volume mappings inside the file itself would have to be adjusted in that case.

0
Comment actions Permalink

2022.3 Beta fixed the issue for me

0
Comment actions Permalink

Dmitry Tronin
I try it, but doesnt work too :/
So, I installed 2022.3 Beta like Matt was mensioned, but doesnt work again.

0
Comment actions Permalink

Can you share your entrypoint and Dockerfile files? 

Does running docker compose run api_cadastrodasorte php -v manually in terminal work?

0
Comment actions Permalink

I managed to fix it, but the unfortunate thing is that I don't really know how.

Yesterday I did some testing because it worked for some of my projects and for some it didn't. My projects tend to have similar docker-compose configurations, but I established that it was a docker-compose.yml value

PHP_IDE_CONFIG=serverName=docker_dev_${PROJECT_NAME}

that somehow made the difference. It's the only place where the PROJECT_NAME variable was used so basically it was down to PHP_IDE_CONFIG. But I don't know why it would work for some values and for others not.

Today I opened the project in question and found that it now works (regardless of the PHP_IDE_CONFIG value).

The other thing that could be a factor is that I'm managing my PhpStorm settings using a GitHub repository and a couple of days ago my PAT token that is used in communication with GitHub expired. Earlier today I generated a new one and synced IDE settings using Overwrite Remote option. I'm not sure how this could be related, but just for the record.

0
Comment actions Permalink

Thanks! Looks similar to https://youtrack.jetbrains.com/issue/WI-59878. If that happens again - feel free to submit that as a new bug report at https://youtrack.jetbrains.com/newIssue attaching some files that reproduce the issue - we'll investigate that closely.

0
Comment actions Permalink

Exact output than Diego at https://intellij-support.jetbrains.com/hc/en-us/community/posts/8402591953554/comments/8519244465426 a few comments before.

I'm using two separated projects with `docker-compose` in `network_mode` set to `bridge`. Having two windows with PHPStorm on each project, one connect without any problem while the other shows same output on log file, as well as in the UI.

The version of PHPStorm I'm using is:

PhpStorm 2022.3
Build #PS-223.7571.212, built on December 1, 2022

Runtime version: 17.0.5+1-b653.14 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.15.0-56-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 1960M
Cores: 8
Registry:
    run.processes.with.pty=TRUE


Current Desktop: KDE

 

`docker-compose` version is `v2.14.0` and `docker` daemon and cli is `20.10.21 build baeda1f`.

My `docker-compose.yml` are extremely simple, using `version: '3.4'`. For the record, an example:

version: '3.4'

name: 'backend'

services:
php:
network_mode: bridge
build:
context: ../
dockerfile: .docker/Dockerfile
environment:
PHP_IDE_CONFIG: "serverName=localhost"
volumes:
- ../app:/srv/app
- ./php:/usr/local/etc/php
- ~/.ssh/:/home/root/.ssh

web:
network_mode: bridge
links:
- 'php:php'
image: nginx:1.19-alpine
working_dir: /srv/app
volumes:
- ../app:/srv/app
- ./nginx:/etc/nginx/conf.d
ports:
- "8080:80"
depends_on:
- php

 

Any idea here?

0
Comment actions Permalink

I made it work. Based in some other tickets in YouTrack, a env variable was missing under the desired CLI. So, in my case, the `COMPOSE_PROJECT_NAME` should be set as the same value than the key `name` in your `docker-compose.yml` file.

0

Please sign in to leave a comment.