-
Notifications
You must be signed in to change notification settings - Fork 297
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
VS Code fails to connect to a PHP code in a running container. #3024
Comments
This works for me on Mac. Did maybe the container stop? |
The container is running. One symptom of the issue is that VS Code opens a second window for this. What I would expect to see is that the current window, open to code which is running in the container, be connected for debugging. This would be similar to what happens with Visual Studio when you attach the debugger to an existing running process. |
Tried to reproduce this here without luck. Could you try running that last command inside the container to see if that somehow fails?
|
In that container, I can't run bash, only sh. cd /proc/proc # ls -d [0-9]* |
/proc # xargs -0 < /proc/1/cmdline |
php-fpm: pool www |
So on pids 6, 7, and 8 there was a Permission denied error. Could this be the problem? |
I think we ignore these. I can reproduce something similar with the Apache container, but not the PHP one. Your log shows Alpine 3.7, I see 3.6 (unsupported) with the Apache and 3.8 with the PHP container when using the repository you linked to. Could you append the Dockerfile you PHP container is using? |
FROM php:7.2.7-fpm-alpine3.7 |
That may have been the wrong one, but similar. Here's the likely one; |
TL;DR: |
More testing shows that we currently don't run with Alpine 3.7. You could use a newer image with Alpine 3.8 or newer. (I see a long list of newer PHP FPM images on Docker Hub.) @Chuxel Should we run on Alpine 3.7 (I'm not sure what the lowest version is that worked before) or can we update the documentation to require Alpine 3.8+? We also need to add a version check and fail with a useful error message. |
Yeah I think that is reasonable - 3.7 is end of life (so is 3.8 actually). The distro updates very quickly. I should likely tweak the Apline 3.10 definition to be like Ubuntu in that regard with multiple variations. |
Thanks! I updated the alpine version, and made a few other changes. My Apache VirtualHost which proxies PHP to the php container uses 8090, and the Docker file for this container now modifies the php-fpm port to the same value. One remaining quibble: VS Code opened in a separate window, and I had to install the PHP debug extension into the container. I'd still like to see any of that happen behind the scenes, stay in the window I started from and have it all just work - the way that Visual Studio does in attaching to a running process. Here is my current docker file:FROM php:7.3.18-fpm-alpine3.11 |
@rspiewak47 I'll track the addition of a version check (for >=3.8) here. Could you open a new issues for the remaining requests? |
Will do, thanks!
-------- Original message --------From: Christof Marti <[email protected]> Date: 6/5/20 3:05 PM (GMT-05:00) To: microsoft/vscode-remote-release <[email protected]> Cc: rspiewak47 <[email protected]>, Mention <[email protected]> Subject: Re: [microsoft/vscode-remote-release] VS Code fails to connect to a
PHP code in a running container. (#3024)
@rspiewak47 I'll track the addition of a version check (for >=3.8) here. Could you open a new issues for the remaining requests?
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "#3024 (comment)",
"url": "#3024 (comment)",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
Fixed with #3280 |
Steps to Reproduce:
https://www.cloudreach.com/en/resources/blog/containerize-this-how-to-use-php-apache-mysql-within-docker-containers/
A second VS Code window opens, and then displays a dialog box indicating "An error occurred attaching to the container."
There is no more specific indication in the log:
remoteContainers.0519.log
The text was updated successfully, but these errors were encountered: