-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
PlatformIO IDE extension does not work on code-server v3.0.1 from Docker Hub #1448
Comments
I've had a quick look at this. platformio starts a server listening on 127.0.0.1:8010. This is because it usually only needs to be accessible on the same machine when running on the desktop. The catch is that this can't be exposed by Docker, as Docker only maps through to non-loopback addresses. platformio home supports a --host argument to get it to listen on another interface, so it can be started with --host=0.0.0.0 so that it can be exposed by Docker. Not sure what the right fix is though. Should platformio know that it's running in a server environment, or should there be some special logic in code-server to handle it? It'd be nice to get it working out of the box without any custom Dockerfiles involved. |
@x-cubed, I agree it would be best if this could "just work" without any custom Dockerfiles. However for the time being, where would I configure my platformio home to launch using the --host argument? |
We could fix this with the addition of our #1453 feature. Thoughts @code-asher ? |
Yeah, seems like we could just access it at |
Just got this to run on my system will leave this for anyone it may help... In the PIO terminal on code-server use the command 'pio home --host x.x.x.x --port 8010' where x.x.x.x is the IP of the docker then bridge the docker port to the host like @r0zzy5 showed. You should then have access to the PIO webgui through http://y.y.y.y:8010 where y.y.y.y is the docker host IP |
Any update on this? |
@ricreis394 do the solutions above not work for you? If not, we can take a look into this again. |
@jsjoeio when I click to open PlatformIO Home Page, the UI tries to load a frame which is pointer to 127.0.0.1:, which obviously cannot load. The commands used in command line are as follows: These 2 above loads something, but not completely, using the subsubdomain port like: |
Ah okay! Hmm..I am not familiar with PlatformIO. Would it be possible for you to provide reproduction steps using the latest version of code-server? If you need an example, look at our bug report template. With that, I'd be happy to take a closer look for you. |
OS/Web Information
Steps to Reproduce
ExpectedIt should appear the PIO Home webpage ActualAppears ScreenshotNoteswhen I click to open PlatformIO Home Page, the UI tries to load a frame which is pointer to The commands used in command line are as follows: These 2 above loads something, but not completely, using the subsubdomain port like: This issue can be reproduced in VS Code: No |
Awesome! Thanks so much for the detailed repro steps @ricreis394 - we'll take a look at this in the next milestone/sprint! EDIT: meant to tag you @ricreis394😅 |
+1 to this issue. The bug mentions a reverse proxy, but I don't think is necessary to repro. I can repro this behind my Traefik reverse proxy or at <server_local_ip>:port. I did not test whether localhost works because my server is headless. I have a Dockerfile here that installs PlatformIO automatically and reproduces the issue. |
I've been struggling with the same issue for a while as well. What worked for me is quite a blunt method, but I've done a global replace for all occurrences of '127.0.0.1' in the platformio-core directory (/config/.platformio) with '0.0.0.0'. Well, I wouldn't like say solved as it's a nuisance that there's no easy interface for setting the ip address to be used for communicating with the pio-core as part of the platformio extension... |
That's awesome to hear - thanks for sharing @yqboy! @RoboMagus let us know if you get a chance to try using that setting option and see if it fixes your issue |
That setting @yqboy mentions is actually a fix of mine that got merged ;) |
Oh HA! Totally missed it. Nice :D Okay well keep us posted. |
Please explain me, What should i do to config code server with working platformIO. Now i use caddy, and don't know how to configure |
I currently use a Dockerfile as below to ensure the prerequisites are met for installing the PlatformIO plugin. FROM ghcr.io/linuxserver/code-server
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends python3 python3-distutils python3-dev python3-pip curl make && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* Then ensure that the PlatformIO settings in VScode are set correctly. I.e. set the IP to 0.0.0.0 instead of 127.0.0.1, and make the port static. I have it set to 8010. Then make sure this port is exported when starting the docker container ( Do note though that only one instance can be opened and linked to PIO at any given time, as only one port can be set to static and each new session requires it's own port. |
@RoboMagus change to 0.0.0.0, and doesn't work |
I'm was experiencing the same issues with effectively the same setup as @utya, except with a compose file. I also tried installing code-server without docker and had similar issues - with enough tinkering I was eventually able to access PIO directly at $LOCAL_IP:8010, but code-server refused to show anything in the extension window. Just to be clear, my exact symptoms are:
|
any progress? here I have this message at start, don't know if it is related to this issue: Error: Traceback (most recent call last): |
I am not familiar with this extension or how it works, but if you can write out full repro steps (assume I know nothing...), then I can take a look faster |
hi, I have found a solution, but I don't use Docker but Ubuntu directly but should be applicable to a Docker container. Since Platformio sits in an iframe it doesn't work properly if it doesn't refer to 127.0.0.1 I used a caddy server as a proxy and in the visx the pio home server starts at 0.0.0.0 but in the iframe it is taken from the package json and referring to https but always +50 ie the Pio server starts on port 8010 but in the iframe there is https: // IP: 8060 / session / so you can refer to 8010 via the caddy file and there is no mixed content. However, I took a static entry for the session key because I use several PCs. With a dynamic one, "Not found" was always displayed hi, ich habe eine Lösung gefunden allerdings nutze ich keinen Docker sondern direkt Ubuntu sollte aber auf einen Docker Container anwendbar sein. Da Platformio in einen Iframe sitzt funktioniert es nicht richtig wenn es nicht auf 127.0.0.1 verweist ich habe einen Caddyserver als Proxy genutzt und in der visx startet der pio Home Server auf 0.0.0.0 aber im Iframe wird er eintrag aus der Package json genommen und auf https verwiesen jedoch immer +50 d.h. der Pio Server startet auf Port 8010 aber im Iframe steht dann https://IP:8060/session/ so kann man dann über die Caddyfile von 8060 auf 8010 verweisen und es ist kein gemischter Inhalt. Allerdings habe ich beim Sessionkey einen Statischen Eintrag genommen da ich mehrere PC's verwende bei einem Dynamischen kam immer "Not found" |
My dockerfile posted above has stopped working. If I connect a terminal to the code-server container and run
I get the error logs:
It looks like these code-server docs explain why MS' extension marketplace isn't used and suggest Open VSX. PlatformIO has this tracking issue to add itself to Open VSX. I'm going to continue following these issues, but I'm likely going to switch to a VSCode VM. |
Has anyone been able to get PlatformIO running in docker in code-server? |
Closing this out since from what I can tell, this is an extension issue? Instead of using 127.0.0.1 I think they need to use It reproduces in Codespaces as well, so it does seem to be an issue with the extension and/or VS Code core. |
I am trying to install the PlatformIO IDE extension on a code-server v3.0.1 instance hosted in a docker container. I am running Docker Desktop on Windows 10 Pro and accessing code-server using Chrome 80. The extension seems to install fine using the extension manager in code-server, but when I try to open the PlatformIO Home tab, Chrome reports that 127.0.0.1:8010 did not send any data and therefore the PlatformIO Home page is not shown:
I am using the following Dockerfile:
And the following docker-compose.yml:
The text was updated successfully, but these errors were encountered: