gitpod-io / gitpod

The developer platform for on-demand cloud development environments to create software faster and more securely.
https://www.gitpod.io
GNU Affero General Public License v3.0
12.79k stars 1.23k forks source link

detecting state #6778

Closed konne closed 2 years ago

konne commented 2 years ago

Bug description

like you see in this picture this service runs perfectly and can be accessed with the browser, but it is marked with a detecting state.

image

Steps to reproduce

I don't know if you can reproduce it.

We have this situation that the port detection works perfect for node services that are running in docker containers, but not for the pgadmin that is also running inside a docker container.

Workspace affected

workspace: apricot-scorpion-yeo25j03

Expected behavior

No response

Example repository

No response

Anything else?

No response

mahmoudajawad commented 2 years ago

This issue does exactly occur to me now randomly. I'm working around this by stopping the workspace and starting it again.

akosyakov commented 2 years ago

Just to clarify: it happens only when you run docker in Gitpod?

konne commented 2 years ago

@akosyakov for me, we run everything inside docker, so I can confirm that it happened with something that runs inside docker, but no other assumptions around that

akosyakov commented 2 years ago

@csweichel I looked at supervisor logs when it happens and https://github.com/gitpod-io/gitpod/blob/bb1349fd9489661007bcd92cbff91438212e1e86/components/supervisor/pkg/ports/ports.go#L486-L495 is never executed for such port. The last log is auto-exposing port. There was not changes in exposed ports service besides removing global port, so it seems it blocks on control port request to server. I am not sure. Can we see traces?

csweichel commented 2 years ago

I am not sure. Can we see traces?

Unfortunately we don't trace this interface 🤦

That said, auto-exposure is only neccesary in the "public exposure" case since we've moved away from Kubernetes services. Hence we could make this part be a bit more "tolerant" towards auto-exposure failure.

akosyakov commented 2 years ago

It actually happened to me very often today and it seems first hanging port blocks all consequent:

Screenshot 2021-11-25 at 14 30 20
akosyakov commented 2 years ago

Hence we could make this part be a bit more "tolerant" towards auto-exposure failure.

I am not sure what do you mean? It does not fail, it hangs forever.

corneliusludmann commented 2 years ago

/assign

corneliusludmann commented 2 years ago

@akosyakov Do you have a workspace ID or a link to the logs for your case?

I had a look in the logs of the workspace apricot-scorpion-yeo25j03 of the issue opener and I cannot find the issue that you observed there (missing auto-exposed port log). For the port that is marked as detecting in the screenshot (3980) there is a auto-exposed port message (log entry).

akosyakov commented 2 years ago

@akosyakov Do you have a workspace ID or a link to the logs for your case?

I actually was able to reproduce it with new workspaces today. I think the workspace id was ivory-swift-u1uxar3a and port 24678. It happened like 4-6 hours ago.

It was opened for this context: https://github.com/trusktr/solid-lume-starter/commit/35c342675ca82244027be2f309edea615ba4c051 and start a server with npm i && npm run dev command.

corneliusludmann commented 2 years ago

Here is an update of my findings so far:

akosyakov commented 2 years ago

I don't see the behavior @akosyakov described above. I always see both logs auto-exposing port and auto-exposed port, even in the workspaces of Anton. Either I missed something or Anton skipped the entry by mistake.

I think you are right, I overlooked something by mistake. I could not see them hanging right now. Actually all returns successfully.

akosyakov commented 2 years ago

@iQQBot you can follow internal investigation here: https://gitpod.slack.com/archives/C01KGM9BH54/p1638873457412200

geropl commented 2 years ago

Relevant update: https://github.com/gitpod-io/gitpod/issues/7054#issuecomment-988777393

akosyakov commented 2 years ago

@iQQBot supervisor reconnects to the server each 10 mins, during such reconnect we can miss some events, so let's add a mitigation which sync with server on reconnect.

Do you need some code pointers?

iQQBot commented 2 years ago

Why reconnects to server each 10min?

marcoaleixo commented 2 years ago

I'm having this "detecting..." problem. By accident I discovered that if we run "gp forward-port any_port" Gitpod automatically is able to detect the state of the ports. I'm posting this if anyone in future have the same bug until the team doesn't fix it.

akosyakov commented 2 years ago

By accident I discovered that if we run "gp forward-port any_port" Gitpod automatically is able to detect the state of the ports.

Yeah, it sounds exactly like a problem of missing events. If you forward another port a new event is issued which delivers proper state for first port too.

akosyakov commented 2 years ago

should be fixed by https://github.com/gitpod-io/gitpod/pull/7621

olleyt commented 1 year ago

@akosyakov the issue is reproducing again after my account was migrated to the new Gitpod version. Port 300 is not opening when I run a Docker container on it.

Could this issue be reproduced in the new release?

axonasif commented 1 year ago

Hi @olleyt, is this still happening? Also, could you please share an example workspace ID and a timestamp of the event?

olleyt commented 1 year ago

yes, it is still happening for example this workspace : xcymr2gwvy0.ws-us96b.gitpod.io or this one ny59rvseewn.ws-us96b.gitpod.io

timestamp: Mon 01 May 2023 10:11:20 AM UTC

as a workaround we used gp preview command and then gp url and prepending port in that url

laushinka commented 1 year ago

This was resolved yesterday. See https://www.gitpodstatus.com/incidents/6h1gd447lk7b.