"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
1

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.

2

I was dealing with the same error. I managed to fix that by changing a configuration on: Settings > Build, Execution, Deployment > Docker > Tools and checking the box "Use Compose V2"

 

 

After that, I went to the PHP CLI configuration and just pushed the refresh button, and it works

2

Hello! 

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

1

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.

1

I had this problem on Windows. In the PhpStorm configurations, Docker was usingWSL, but inside the PHP Interpreter, I configured it to use Docker for Windows. I did Build, Execution and Deployment > Docker and selected Docker for Windows instead of WSL. It fixed the problem

1
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

Same problem here after updating to 2022.2.3

0

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

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

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

2022.3 Beta fixed the issue for me

0

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

0

Can you share your entrypoint and Dockerfile files? 

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

0

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

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

+1

I am facing the same issue 

I'm using Docker composer with a PHP. When trying to set the interpreter I choose Docker compose and connecting with existing container and then it fails with the error "Failed to parse script validation output".

If I execute php -v inside the container everything seems fine,

What is the expected result?
An installed php version should be shown

What happens instead?
Failed to parse validation script output message and PHP version: not installed label

It's working fine with docker-compose run lifecycle

PS:

OS : RHEL 8.8

ddev version v1.21.6

PhpStorm 2023.1.2

Docker version 24.0.2, build cb74dfc

Docker Compose version v2.18.1

docker-compose version 1.24.0, build 0aa59064

docker-py version: 3.7.2

CPython version: 3.6.8

OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018

 

Settings > Build, Execution, Deployment > Docker > Tools and checking the box "Use Compose V2" didn't work for me.

Getting below error in ide.log

 

2023-06-15 11:30:07,860 [1825374] FINE - #c.j.p.c.p.PhpInfoUtil - Parsing validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

2023-06-15 11:30:07,861 [1825375] INFO - STDERR - [Fatal Error] :1:1: Content is not allowed in prolog.

2023-06-15 11:30:07,861 [1825375] WARN - #c.j.p.c.p.PhpInfoUtil - Failed to parse validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

2023-06-15 11:30:07,862 [1825376] FINE - #c.j.p.c.p.PhpInfoUtil -

com.intellij.execution.ExecutionException: Failed to parse validation script output

0

Unfortunately, `Failed to parse validation script output` and `Content is not allowed in prolog` are pretty generic messages and there is a whole bunch of reasons why they may appear.

Usually, more detailed logs could help to understand the situation deeper. To increase the log level, you might want to add the following lines to "Help > Diagnostic tools > Debug logs settings":
#com.jetbrains.php
#com.intellij.execution

@Minalsharma888 Would it be possible to enabled the extended logging, reproduce the issue, collect logs (Help > Collect Logs...) and submit a YouTrack issue?

0

2023-06-15 23:56:48,403 [ 421548]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:56:48,534 [ 421679]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/bin/ddev describe --json-output]
2023-06-15 23:56:48,534 [ 421679]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev
2023-06-15 23:56:48,534 [ 421679]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {DDEV_NONINTERACTIVE=>true} (+CONSOLE)
2023-06-15 23:56:48,534 [ 421679]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:56:48,535 [ 421680]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:56:58,655 [ 431800]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/bin/ddev describe --json-output]
2023-06-15 23:56:58,655 [ 431800]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev
2023-06-15 23:56:58,655 [ 431800]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {DDEV_NONINTERACTIVE=>true} (+CONSOLE)
2023-06-15 23:56:58,655 [ 431800]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:56:58,655 [ 431800]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:56:58,771 [ 431916]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/bin/ddev describe --json-output]
2023-06-15 23:56:58,771 [ 431916]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev
2023-06-15 23:56:58,771 [ 431916]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {DDEV_NONINTERACTIVE=>true} (+CONSOLE)
2023-06-15 23:56:58,771 [ 431916]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:56:58,772 [ 431917]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:57:00,725 [ 433870]   INFO - #c.i.i.b.BookmarkManager - no state loaded for old bookmarks
2023-06-15 23:57:00,732 [ 433877]   INFO - #c.i.i.f.FavoritesManager - no state loaded for old favorites
2023-06-15 23:57:08,890 [ 442035]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/bin/ddev describe --json-output]
2023-06-15 23:57:08,890 [ 442035]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev
2023-06-15 23:57:08,890 [ 442035]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {DDEV_NONINTERACTIVE=>true} (+CONSOLE)
2023-06-15 23:57:08,891 [ 442036]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:57:08,891 [ 442036]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:57:09,017 [ 442162]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/bin/ddev describe --json-output]
2023-06-15 23:57:09,017 [ 442162]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev
2023-06-15 23:57:09,017 [ 442162]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {DDEV_NONINTERACTIVE=>true} (+CONSOLE)
2023-06-15 23:57:09,017 [ 442162]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:57:09,017 [ 442162]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/bin/ddev, describe, --json-output]
2023-06-15 23:57:14,878 [ 448023]   FINE - #c.j.p.l.p.r.t.PhpParameterBasedTypeProvider - COMPUTING MethodTypesMap
2023-06-15 23:57:14,879 [ 448024]   FINE - #c.j.p.l.p.r.t.PhpParameterBasedTypeProvider - DONE COMPUTING MethodTypesMap => 87
2023-06-15 23:57:22,545 [ 455690]   FINE - #c.j.p.c.p.PhpInfoUtil - Loaded helper: /opt/.phpstorm_helpers/phpinfo.php
2023-06-15 23:57:22,639 [ 455784]   FINE - #c.i.e.c.GeneralCommandLine - Executing [/usr/local/bin/docker compose -f /home/minsharm/Downloads/drupalddev/.ddev/.ddev-docker-compose-full.yaml exec -T -e IDE_INTERPRETER_TYPE=DOCKER_COMPOSE_CREDENTIALS -e JETBRAINS_REMOTE_RUN=1 web php -dxdebug.remote_enable=0 -dxdebug.mode=off /opt/.phpstorm_helpers/phpinfo.php]
2023-06-15 23:57:22,639 [ 455784]   FINE - #c.i.e.c.GeneralCommandLine -   working dir: /home/minsharm/Downloads/drupalddev/.ddev
2023-06-15 23:57:22,639 [ 455784]   FINE - #c.i.e.c.GeneralCommandLine -   environment: {COMPOSE_PROJECT_NAME=>ddev-drupalddev, DOCKER_HOST=>unix:///var/run/docker.sock} (+NONE)
2023-06-15 23:57:22,640 [ 455785]   FINE - #c.i.e.c.GeneralCommandLine -   charset: UTF-8
2023-06-15 23:57:22,640 [ 455785]   FINE - #c.i.e.c.GeneralCommandLine - Building process with commands: [/usr/local/bin/docker, compose, -f, /home/minsharm/Downloads/drupalddev/.ddev/.ddev-docker-compose-full.yaml, exec, -T, -e, IDE_INTERPRETER_TYPE=DOCKER_COMPOSE_CREDENTIALS, -e, JETBRAINS_REMOTE_RUN=1, web, php, -dxdebug.remote_enable=0, -dxdebug.mode=off, /opt/.phpstorm_helpers/phpinfo.php]
2023-06-15 23:57:22,842 [ 455987]   FINE - #c.j.p.c.p.PhpInfoUtil - Parsing validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

2023-06-15 23:57:22,843 [ 455988]   INFO - STDERR - [Fatal Error] :1:1: Content is not allowed in prolog.
2023-06-15 23:57:22,843 [ 455988]   WARN - #c.j.p.c.p.PhpInfoUtil - Failed to parse validation output: Could not open input file: /opt/.phpstorm_helpers/phpinfo.php

0

I had the same issue.
Solved it by lowercasing the environment variable for the project name.

Docker setup base on DDEV
With phpstorm DDEV plugin

phpstorm: 2023.2.4
phpstorm: Build #PS-232.10227.13
ddev version v1.22.5

The suggestion for the environment variable put me in the right direction.
Issue in my case was the case sensitivity.

My project name has a capital in it: ddev-D10-study
That name was set correctly as environment variable in phpstorm: COMPOSE_PROJECT_NAME=ddev-D10-study
But in the .yaml configuration file for the DDEV docker setup it appeared to be lowercase: name: ddev-d10-study

So in phpstorm I changed it to lowercase: COMPOSE_PROJECT_NAME=ddev-d10-study
And that did the trick.

0

请先登录再写评论。