Docker Compose CLI Can't Parse Validation Script Output

I'm running a project in Docker on my local machine, and I'm trying to run my unit tests through the Interpreter in IntelliJ. The project uses multiple containers managed by docker-compose, so I'm trying to use the Docker Compose option for the interpreter. I have my Docker server settings configured as shown, and the IDE is able to connect to it.

However, when I go to configure the interpreter, I encounter a problem verifying the PHP version.

 

The idea.log gives me the following output:


2018-04-25 17:17:11,009 [92844743]   WARN - php.config.phpInfo.PhpInfoUtil - Failed to parse validation output:  
2018-04-25 17:17:11,009 [92844743]   WARN - .PhpRemoteInterpreterComponent - Can not update phpinfo
com.intellij.execution.ExecutionException: Failed to parse validation script output
    at com.jetbrains.php.config.phpInfo.PhpInfoUtil.parsePhpInfo(PhpInfoUtil.java:59)
    at com.jetbrains.php.config.phpInfo.PhpInfoUtil.getPhpInfo(PhpInfoUtil.java:132)
    at com.jetbrains.php.remote.interpreter.ui.PhpRemoteInterpreterComponent.reloadPhpInfo(PhpRemoteInterpreterComponent.java:100)
    at com.jetbrains.php.config.interpreters.PhpInterpreterComponent.lambda$init$0(PhpInterpreterComponent.java:143)
    at com.jetbrains.php.ui.PhpUiUtil$2.lambda$actionPerformed$0(PhpUiUtil.java:115)
    at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2846)
    at com.jetbrains.php.ui.PhpUiUtil$2.actionPerformed(PhpUiUtil.java:114)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:193)
    at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:153)
    at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:357)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:837)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:762)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:434)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1077)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:694)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:427)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1682)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1631)
    at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1646)
    at com.jetbrains.php.ui.PhpUiUtil.editConfigurable(PhpUiUtil.java:87)
    at com.jetbrains.php.config.PhpInterpreterConfigurationForm$2.actionPerformed(PhpInterpreterConfigurationForm.java:63)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6541)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:837)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:762)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:434)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.awt.Dialog.show(Dialog.java:1077)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:694)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:427)
    at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1682)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1631)
    at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:69)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
    at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:69)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
    at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:63)
    at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$null$1(MacOSApplicationProvider.java:103)
    at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$submit$7(MacOSApplicationProvider.java:197)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:447)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:431)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:415)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:837)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:434)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: org.xml.sax.SAXParseException; Premature end of file.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.jetbrains.php.config.phpInfo.PhpInfoUtil.parsePhpInfo(PhpInfoUtil.java:50)
    ... 130 more

This looks like it could be a permissions problem, but I can't see what permission is failing or why. Has anyone run into this?

2
10 comments
Avatar
Permanently deleted user

Thanks for the link, Andrey. Unfortunately, the solutions discussed in that thread didn't seem to resolve my problem.

I also forgot to mention a detail that could be important: This problem occasionally doesn't occur. The IDE is able to correctly determine the PHP version at seemingly random times, while other times it is not.

0
Avatar
Permanently deleted user

What PhpStorm version do you use at the moment?

0
Avatar
Permanently deleted user

Is there any solution? 

 

my part of error log
```
2018-07-11 18:28:32,474 [ 487090] WARN - php.config.phpInfo.PhpInfoUtil - Failed to parse validation output: Could not open input file: /root/.phpstorm_helpers/phpinfo.php
2018-07-11 18:28:32,474 [ 487090] WARN - .PhpRemoteInterpreterComponent - Can not update phpinfo
com.intellij.execution.ExecutionException: Failed to parse validation script output
at com.jetbrains.php.config.phpInfo.PhpInfoUtil.parsePhpInfo(PhpInfoUtil.java:59)
```
why it trying to create/root/.phpstorm_helpers/phpinfo.php  in /root directory ?

0

There might have been some caching issues with the home directory and the current login.
A general advice here would be to delete both deployment configuration (if used for creating the remote interpreter) and the interpreter itself, and then to add them back using correct credentials.

2

Getting this issue on Ubuntu 18.04 - Exceptions are just like posted above. None of the other solutions posted here seem to work. 

Caused by: org.xml.sax.SAXParseException; Premature end of file.

Seems like a bad thing. How can I debug further?

Also: It doesn't seem to be trying to build the container. If I remove the image it just fails immediately. Docker-compose is installed, it works from the command line running docker-compose run [service] php -i works fine...

0

> Caused by: org.xml.sax.SAXParseException; Premature end of file.

The error is too general, e.g. `php -version` returned by remote server has a malformed format. 

I would suggest troubleshooting this at https://youtrack.jetbrains.com/newIssue - it's easier to share logs & screenshots (incl. privately) this way.

0

@Dmitry  - Thank you for your response. I actually meant to post back here with our results but couldn't find the issue again. 

This actually solved it for us: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000174084-docker-compose-does-not-work-on-ubuntu-using-default-settings?page=1#community_comment_360000041339

The default Ubuntu install has issues with Docker communication it seems. We found it by trying to create a docker-compose run configuration. The error message (like in this ticket) wasn't helpful at all. Might be something to add to the docs or improve the error handling?

Thanks,

-Seth

0

@Seth, it would be great if you could submit this to our tracker at https://youtrack.jetbrains.com/newIssue attaching logs & screenshots to reproduce this

 

0

For me it was that the service name changed on its own to a different service that doesn't contain `php`. Could help to check for that.

0

Please sign in to leave a comment.