Skip to content
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

Seems like you are running VS Code in a remote environment (VS Code running remote docker container) #550

Closed
1 task
malanciault opened this issue Dec 23, 2024 · 17 comments
Assignees
Labels
app:desktop application app:vs code bug Something isn't working os:macos resolved status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member.

Comments

@malanciault
Copy link

Software

VS Code

Operating System / Platform

macOS

Your Pieces OS Version

11.02

Early Access Program

  • Yes, this is related to an Early Access Program feature.

Kindly describe the bug and include as much detail as possible on what you were doing so we can reproduce the bug.

I'm having the same problem as this: #269

Using VS Code project within a docker container and getting this message:

Woops! It seems like you are running VS Code in a remote environment & Pieces for VS Code cannot connect to Pieces OS. Please refer to our documentation on how to resolve this issue.

Image

Pieces OS version:

Image

I followed this guide but with no luck: https://docs.pieces.app/product-highlights-and-benefits/connecting-to-a-remote-pieces-os-instance

LAN IP:

Image

VS Code settings, pieces custom URL:

Image

What else can I try?

Thanks!

@pieces-support-bot
Copy link

Hi @malanciault - Thank you so much for creating this issue. Your issue has been automatically triaged and routed to the proper Pieces team member. Look for a follow-up within the next 24 hours.

Based on the details you provided, you might find these related issues helpful:

In the meantime, please check out these helpful resources:

We appreciate your patience and contribution to making Pieces better!

@pieces-support-bot pieces-support-bot bot added bug Something isn't working app:desktop application os:macos app:vs code status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member. labels Dec 23, 2024
@malanciault
Copy link
Author

To add more info, even when I have no VS Code project opened, I still get the same error message, so it is not about remote docker...

Image

@robert-at-pieces
Copy link

robert-at-pieces commented Dec 30, 2024

Hello @malanciault. It looks like our documentation is a little out of date. Starting with Pieces OS version 11.0.0 the default port is no longer 1000. Pieces OS now tries to open on port 39300. If for some reason it fails to open on that port, it will try each sequentially up to 39333.

In your case you should be able to try http://192.168.0.129:39300.

Give it a shot and keep us posted! Thanks.

@malanciault
Copy link
Author

Still no luck

Image

Image

Anything else I could try ?

@robert-at-pieces
Copy link

How is your VSCode remote instance being hosted? Inside docker?

@malanciault
Copy link
Author

In fact, look, I don't even think it's related to a remote instance:
Image

This is what I get when I open VS Code, even before opening any project.

Thanks for your help!

@malanciault
Copy link
Author

malanciault commented Dec 30, 2024

Conducting more test.

So, If I remove the Custom URL, then it seems to work before I open a project:
Image

If I open a project that is not remote, it is also working :)

But If I open a remote project, then it does not work:
Image

So to answer your question:

How is your VSCode remote instance being hosted? Inside docker?

Yes, inside Docker.

@robert-at-pieces
Copy link

robert-at-pieces commented Dec 30, 2024

TLDR: There is an issue on our end. We will need to issue a patch to allow listening on all interfaces.


@malanciault Thank you for your patience. After further investigation it seems some networking changes in the latest major release are partly to blame for this issue.

The main issue identified is that, for tighter security by default, the default listening interface of Pieces Server is loopback starting from version 11.0.0.

Because you are connecting remotely from the DevContainer, the server will not listen to the address you have provided.

Docker mounts access to localhost through 'host.docker.internal' resolution from within the container.

We can see this works from the DevContainer by running the command:

 curl host.docker.internal:39300/.well-known/health

And it responds with something like:

ok:b454f7e3-bf2d-4ac9-b5b3-f4d8eeed5e6a

Unfortunately, the host.docker.internal resolution does not play well with our Webview tool windows which cannot resolve host.docker.internal.

In local testing, switching our server back to listening on all interfaces resolved the problem by being able to use my LAN address in the custom url.

We will work on having a setting able to support changing this.

@malanciault
Copy link
Author

OK thanks.

Is there something I can do on my end for it to work before a new version ?

Thanks

@robert-at-pieces
Copy link

We have a patch to the VSCode plugin currently being tested in staging. I would recommend holding off for this patch as it would be simpler. When the patch is out you should be able to remove the customUrl completely and it will detect Pieces OS automatically.


The workaround for this issue would be a little complex. You would have to create a dns name entry like 'pieceshost' and add it to the /etc/hosts of the container and have it resolve to 'host.docker.internal'.

Outside of the container you would have to setup this dns name to resolve to 'localhost'.

You can then specify a custom url like "http://pieceshost:39300" and it should then be able to resolve Pieces OS in the container and in the Copilot webview.

@robert-at-pieces robert-at-pieces self-assigned this Jan 2, 2025
@malanciault
Copy link
Author

Thanks Robert, I will wait for the patch. How can I be informed when the patch is released ?

Thanks!

@robert-at-pieces
Copy link

VSCode should show a new version in the extension browser when it has been released.

I will also be sure to comment on this ticket.

Looking to release the patch today or tomorrow.

@robert-at-pieces
Copy link

@malanciault version 2.0.1 of the VSCode extension is out now: https://marketplace.visualstudio.com/items?itemName=MeshIntelligentTechnologiesInc.pieces-vscode

I have tested this version on MacOS and Windows using multiple DevContainers and the connection was successful when the custom URL is blank.

Let us know if your issue has been resolved! Thanks!

@malanciault
Copy link
Author

So, the plugin has been updated and is enabled within the container:
Image

I closed VS Code.

I ensured that Pieces OS is running
Image

But still:
Image

Let me know what I am missing! Thanks

@robert-at-pieces
Copy link

@malanciault Would you be willing to set some time up for a video call to get to the bottom of this?

@malanciault
Copy link
Author

Of course, thanks for offering, send me an email at [email protected].

Thanks again!

@robert-at-pieces
Copy link

This issue has been resolved in Pieces for VSCode extension version 2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:desktop application app:vs code bug Something isn't working os:macos resolved status:triaged The ticket has been reviewed, prioritized, categorized, and assigned to the appropriate team member.
Projects
None yet
Development

No branches or pull requests

2 participants