0

I was running VS Code server without any issues for months on GCP. However, recently I had to update my machine. After installation I found out that code server is gone. So I installed it again using the official installation script. However, now when I try to run the code server I am getting error that [error listen EADDRINUSE: address already in use 127.0.0.1:8080]

$ code-server
[2023-03-29T02:48:05.018Z] info  code-server 4.11.0 85e083580dec27ef19827ff42d3c9257d56ea7e3
[2023-03-29T02:48:05.019Z] info  Using user-data-dir ~/.local/share/code-server
[2023-03-29T02:48:05.023Z] error listen EADDRINUSE: address already in use 127.0.0.1:8080

(conda)jupyter@splintered-learning:~$ ps
  PID TTY          TIME CMD
 3233 pts/2    00:00:00 bash
14556 pts/2    00:00:00 ps

(conda)jupyter@splintered-learning:~$ lsof -i tcp:8080
bash: lsof: command not found

(conda)jupyter@splintered-learning:~$ npx kill-port 8080
Process on port 8080 killed

(conda)jupyter@splintered-learning:~$ code-server
[2023-03-29T02:58:03.042Z] info  code-server 4.11.0 85e083580dec27ef19827ff42d3c9257d56ea7e3
[2023-03-29T02:58:03.042Z] info  Using user-data-dir ~/.local/share/code-server
[2023-03-29T02:58:03.046Z] error listen EADDRINUSE: address already in use 127.0.0.1:8080
(conda)jupyter@splintered-learning:~$

I tried finding if there is some version running in the background but there isn't any. How can I fix this issue?

UPDATE 1: I think I have found a process running on the culprit port 8080.

(conda)jupyter@splintered-learning:~$ sudo ps -ef | grep 8080
root      1191     1  0 02:30 ?        00:00:03 /opt/bin/proxy-forwarding-agent --proxy=https://us-central1.notebooks.cloud.google.com/tun/m/4592f092208ecc84946b8f8f8016274df1b36a14/ --host=localhost:8080 --backend=2db2eaccd95db6df --proxy-timeout=60s --shim-websockets=false --shim-path=websocket-shim --health-check-path=/api/kernelspecs --health-check-interval-seconds=30 --debug=false
jupyter  25029  3233  0 03:05 pts/2    00:00:00 grep 8080

Now the question is how to fix this?

exan
  • 3,236
  • 5
  • 24
  • 38
  • Before upgrading the Jupyter notebooks on GCP, I was forwarding ports on VS code server. Is this what's causing the error? May be this port forwarding script is looking for olders vs code server and is unable to locate the newer version. How do I unforward this port then? – exan Mar 29 '23 at 03:14

0 Answers0