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

EC2 Guide doesn't work #44

Closed
bigxalx opened this issue Jun 30, 2021 · 5 comments
Closed

EC2 Guide doesn't work #44

bigxalx opened this issue Jun 30, 2021 · 5 comments
Assignees

Comments

@bigxalx
Copy link

bigxalx commented Jun 30, 2021

Been following this guide step-by-step.
https://github.com/cdr/deploy-code-server/blob/main/guides/aws-ec2.md#deploying-code-server-on-aws-ec2

In the last step you're supposed to simply browse to the instance's public IP. This silently fails (Page loads forever, and after quite some time I get "Can't open this page because the server where it's located isn't responding").

Anything I can do to debug this?

@bpmct bpmct self-assigned this Jul 13, 2021
@bpmct
Copy link
Member

bpmct commented Jul 13, 2021

Hi @bigxalx. So sorry for the late response, not sure how I missed this.

I just added some troubleshooting steps for this. I am thinking this may because port 80 is not open on your EC2 instance's firewall. https://github.com/cdr/deploy-code-server/tree/main/deploy-vm#troubleshooting

@bigxalx
Copy link
Author

bigxalx commented Aug 3, 2021

Thanks for the response. I made sure port 80 is open in my EC2 Security settings and the ubuntu firewall is disabled.

Here are the debug outputs:

The last few lines for journalctl -u code-server@coder:

Aug 03 09:22:18 ip-172-31-40-0 systemd[1]: Starting code-server...
Aug 03 09:22:18 ip-172-31-40-0 systemd[1]: Started code-server.
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.018Z] info  code-server 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.020Z] info  Using user-data-dir ~/.local/share/code-server
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.031Z] info  Using config file ~/.config/code-server/config.yaml
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.031Z] info  HTTP server listening on http://127.0.0.1:39039 (randomized by --link)
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.032Z] info    - Authentication is disabled (disabled by --link)
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.032Z] info    - Not serving HTTPS (disabled by --link)
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.151Z] info  Detected an acceptable latency of 6ms
Aug 03 09:22:19 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:22:19.388Z] info  visit https://github.com/login/oauth/authorize?client_id=c5128a90cf53e7f89771&response_type=code&scope=read%3>
Aug 03 09:23:59 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:23:59.177Z] info  Failed to login: unable to login: read session token: read msg: failed to read JSON message: failed to get re>
Aug 03 09:23:59 ip-172-31-40-0 code-server[1659]: [2021-08-03T09:23:59.180Z] error --link agent exited with 1
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: code-server@coder.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: code-server@coder.service: Failed with result 'exit-code'.
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: code-server@coder.service: Scheduled restart job, restart counter is at 16.
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: Stopped code-server.
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: Starting code-server...
Aug 03 09:23:59 ip-172-31-40-0 systemd[1]: Started code-server.
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.540Z] info  code-server 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.542Z] info  Using user-data-dir ~/.local/share/code-server
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.554Z] info  Using config file ~/.config/code-server/config.yaml
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.555Z] info  HTTP server listening on http://127.0.0.1:39349 (randomized by --link)
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.555Z] info    - Authentication is disabled (disabled by --link)
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.555Z] info    - Not serving HTTPS (disabled by --link)
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.653Z] info  Detected an acceptable latency of 4ms
Aug 03 09:24:00 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:24:00.904Z] info  visit https://github.com/login/oauth/authorize?client_id=c5128a90cf53e7f89771&response_type=code&scope=read%3>
Aug 03 09:25:40 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:25:40.685Z] info  Failed to login: unable to login: read session token: read msg: failed to read JSON message: failed to get re>
Aug 03 09:25:40 ip-172-31-40-0 code-server[1706]: [2021-08-03T09:25:40.688Z] error --link agent exited with 1
Aug 03 09:25:40 ip-172-31-40-0 systemd[1]: code-server@coder.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 09:25:40 ip-172-31-40-0 systemd[1]: code-server@coder.service: Failed with result 'exit-code'.
Aug 03 09:25:41 ip-172-31-40-0 systemd[1]: code-server@coder.service: Scheduled restart job, restart counter is at 17.
Aug 03 09:25:41 ip-172-31-40-0 systemd[1]: Stopped code-server.
Aug 03 09:25:41 ip-172-31-40-0 systemd[1]: Starting code-server...
Aug 03 09:25:41 ip-172-31-40-0 systemd[1]: Started code-server.
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.024Z] info  code-server 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.026Z] info  Using user-data-dir ~/.local/share/code-server
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.038Z] info  Using config file ~/.config/code-server/config.yaml
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.038Z] info  HTTP server listening on http://127.0.0.1:36455 (randomized by --link)
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.038Z] info    - Authentication is disabled (disabled by --link)
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.038Z] info    - Not serving HTTPS (disabled by --link)
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.128Z] info  Detected an acceptable latency of 3ms
Aug 03 09:25:42 ip-172-31-40-0 code-server[1754]: [2021-08-03T09:25:42.366Z] info  visit https://github.com/login/oauth/authorize?client_id=c5128a90cf53e7f89771&response_type=code&scope=read%3>

systemctl status code-server@coder

● code-server@coder.service - code-server
     Loaded: loaded (/lib/systemd/system/code-server@.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-08-03 09:20:35 UTC; 13s ago
   Main PID: 1586 (node)
      Tasks: 27 (limit: 1160)
     Memory: 43.8M
     CGroup: /system.slice/system-code\x2dserver.slice/code-server@coder.service
             ├─1586 /usr/lib/code-server/lib/node /usr/lib/code-server
             ├─1605 /usr/lib/code-server/lib/node /usr/lib/code-server
             └─1617 /usr/lib/code-server/lib/coder-cloud-agent bind --code-server-addr=127.0.0.1:46597

Aug 03 09:20:35 ip-172-31-40-0 systemd[1]: Starting code-server...
Aug 03 09:20:35 ip-172-31-40-0 systemd[1]: Started code-server.
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.763Z] info  code-server 3.11.0 4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.764Z] info  Using user-data-dir ~/.local/share/code-server
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.776Z] info  Using config file ~/.config/code-server/config.yaml
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.776Z] info  HTTP server listening on http://127.0.0.1:46597 (randomized by --link)
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.776Z] info    - Authentication is disabled (disabled by --link)
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.776Z] info    - Not serving HTTPS (disabled by --link)
Aug 03 09:20:36 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:36.867Z] info  Detected an acceptable latency of 3ms
Aug 03 09:20:37 ip-172-31-40-0 code-server[1605]: [2021-08-03T09:20:37.756Z] info  visit https://github.com/login/oauth/authorize?client_id=c5128a90cf53e7f89771&response_type=code&scope=read%3>

systemctl status coder-cloud-redirect

● coder-cloud-redirect.service - coder-cloud-redirect
     Loaded: loaded (/etc/systemd/system/coder-cloud-redirect.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-08-03 08:56:45 UTC; 29min ago
   Main PID: 408 (python3)
      Tasks: 1 (limit: 1160)
     Memory: 8.9M
     CGroup: /system.slice/coder-cloud-redirect.service
             └─408 /usr/bin/python3 /usr/bin/coder-cloud-redirect.py 80

Aug 03 08:56:45 ip-172-31-40-0 systemd[1]: Started coder-cloud-redirect.

@bpmct
Copy link
Member

bpmct commented Aug 13, 2021

There don't appear to be any bugs there 🤔

Are you able to visit the github oauth URL ok from the logs?

@cypressf
Copy link

I'm seeing the same issue. The bug is in this line:

Oct 15 16:20:36 ip-172-31-26-142 code-server[1641]: [2021-10-15T16:20:36.758Z] info Failed to login: unable to login: read session token: read msg: failed to read JSON message: failed to get reader: failed to read frame header: EOF

@bpmct
Copy link
Member

bpmct commented Feb 13, 2022

The --link service code-server uses is now deprecated unfortunately. We plan to add improved documentation using another service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants