I addedd ssl and changed the login password, and now i am not able to login with the password i created, even after running systemctl restart code-server@vscode
Did you change the password in the config.yaml file as explained here ?
funny thing is, restarting the server fixed the problem.
Install the vscode following the instructions in this tutorial but when starting the web page I get an error and I can’t continue. Please help me.
Hello,
welcome to NethServer Community!
I couldn’t reproduce your issue, the tutorial should work.
Are there errors regarding vscode in /var/log/messages
?
Let’s check if the service is started:
systemctl status code-server@vscode -l
Please share the reverse proxy config:
db proxypass show
Do you use tomcat?
`
Hello, thanks for your reply.
messages in /var/log/messages:
grep -r "vscode" /var/log/messages
Feb 16 03:43:44 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[16975]: /var/lib/nethserver/db/proxypass: OLD vscode.xxxxxxxxxxx.net=(undefined)
Feb 16 03:43:44 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[16975]: /var/lib/nethserver/db/proxypass: NEW vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|enabled|WebSocketsPath|
Feb 16 03:43:46 server update: /var/lib/nethserver/db/hosts: OLD vscode.xxxxxxxxxxx.net=(undefined)
Feb 16 03:43:46 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[16975]: /var/lib/nethserver/db/hosts: NEW vscode.xxxxxxxxxxx.net=self|Description|vhost Reverse
Feb 16 03:43:46 server update: Event: host-modify vscode.xxxxxxxxxxx.net
Feb 16 03:48:04 server /sbin/e-smith/db[20771]: /var/lib/nethserver/db/configuration: NEW pki=configuration|CertificateDuration|3650|ChainFile|/etc/letsencrypt/live/server.xxxxxxxxxxx.net/chain.pem|CommonName||CountryCode||CrtFile|/etc/letsencrypt/live/server.xxxxxxxxxxx.net/cert.pem|EmailAddress||KeyFile|/etc/letsencrypt/live/server.xxxxxxxxxxx.net/privkey.pem|LetsEncryptChallenge|http|LetsEncryptDomains|xxxxxxxxxxx.net,server.xxxxxxxxxxx.net,www.xxxxxxxxxxx.net,mail.xxxxxxxxxxx.net,collabora.xxxxxxxxxxx.net,cloud.xxxxxxxxxxx.net,allison.xxxxxxxxxxx.net,app.xxxxxxxxxxx.net,firebase.xxxxxxxxxxx.net,quest.xxxxxxxxxxx.net,www.xxxxxxxxxxx.net,web.xxxxxxxxxxx.net,vbox.xxxxxxxxxxx.net,blog.xxxxxxxxxxx.net,vscode.xxxxxxxxxxx.net,orionwebs.net|LetsEncryptMail|xxxxxxxxxxx.net@gmail.com|LetsEncryptShortChain|enabled|Locality||Organization||OrganizationalUnitName||State||SubjectAltName|
Feb 16 03:51:20 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[24270]: /var/lib/nethserver/db/proxypass: OLD vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|enabled|WebSocketsPath|
Feb 16 03:51:20 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[24270]: /var/lib/nethserver/db/proxypass: NEW vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|enabled|WebSocketsPath|code-server
Feb 16 03:56:16 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[25499]: /var/lib/nethserver/db/proxypass: OLD vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|enabled|WebSocketsPath|code-server
Feb 16 03:56:16 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[25499]: /var/lib/nethserver/db/proxypass: NEW vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|disabled|WebSocketsPath|
Feb 16 03:57:58 server /usr/libexec/nethserver/api/nethserver-httpd/proxypass/update[26173]: /var/lib/nethserver/db/proxypass: OLD vscode.xxxxxxxxxxx.net=VhostReverse|CertVerification|no|Description||HTTP|no|HTTPS|yes|PreserveHost|yes|SslCertificate||Target|http://localhost:8088|ValidFrom||WebSockets|disabled|WebSocketsPath|
systemctl status code-server@vscode -l
● code-server@vscode.service - code-server
Loaded: loaded (/usr/lib/systemd/system/code-server@.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2022-02-16 03:59:51 -05; 5h 54min ago
Main PID: 1454 (node)
CGroup: /system.slice/system-code\x2dserver.slice/code-server@vscode.service
├─1454 /usr/lib/code-server/lib/node /usr/lib/code-server
├─2501 /usr/lib/code-server/lib/node /usr/lib/code-server
└─4607 /usr/lib/code-server/lib/node /usr/lib/code-server/vendor/modules/code-oss-dev/out/bootstrap-fork --type=ptyHost
Feb 16 03:59:51 server.xxxxxxxxxxx.net systemd[1]: Started code-server.
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.670Z] info code-server 4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.673Z] info Using user-data-dir ~/.local/share/code-server
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.687Z] info Using config file ~/.config/code-server/config.yaml
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.688Z] info HTTP server listening on http://127.0.0.1:8088/
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.688Z] info - Authentication is enabled
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.688Z] info - Using password from ~/.config/code-server/config.yaml
Feb 16 03:59:52 server.xxxxxxxxxxx.net code-server[1454]: [2022-02-16T08:59:52.688Z] info - Not serving HTTPS
Feb 16 04:00:23 server.xxxxxxxxxxx.net code-server[1454]: [04:00:23] Extension host agent started.
Feb 16 07:01:23 server.xxxxxxxxxxx.net systemd[1]: [/usr/lib/systemd/system/code-server@.service:6] Failed to parse service type, ignoring: exec
Proxy config:
db proxypass show
vscode.xxxxxxxxx.net=VhostReverse
CertVerification=no
Description=
HTTP=no
HTTPS=yes
PreserveHost=yes
SslCertificate=
Target=http://localhost:8088
ValidFrom=
WebSockets=enabled
WebSocketsPath=
I don’t use tomcat, i use 8088 port in config.yaml
cat /home/vscode/.config/code-server/config.yaml
bind-addr: 127.0.0.1:8088
auth: password
password: xxxxxxxxxxxxxxxxxxxxxxx
cert: false
I think vscode is runnig, this is the screenshot when i try access:
Thanks for your help
There’s an open issue regarding the recent version 4. Seems we need to wait for a fix for apache reverse proxy.
As a workaround you may downgrade to version 3.12:
yum downgrade "https://github.com/coder/code-server/releases/download/v3.12.0/code-server-3.12.0-amd64.rpm"
systemctl daemon-reload
systemctl enable code-server@vscode --now
Sorry a new error, i follow your steps (nothing wrong) for downgrade but when i try access to url i see this error on browser (502 proxy error):
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
i don’t now, i need change something on config proxy?
Thanks.
Maybe the port was reset to 8080 in the config.yaml file?
Please check server status again:
this is my config.yaml
File: /home/vscode/.config/code-server/config.yaml
bind-addr: 127.0.0.1:8088
auth: password
password: xxxxxxxxxxxxxxxxxxxxxxxxxxx
cert: false
This is the result of comand:
systemctl status code-server@vscode -l
● code-server@vscode.service - code-server
Loaded: loaded (/usr/lib/systemd/system/code-server@.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2022-02-16 03:59:51 -05; 8h ago
Main PID: 1454 (node)
CGroup: /system.slice/system-code\x2dserver.slice/code-server@vscode.service
├─1454 /usr/lib/code-server/lib/node /usr/lib/code-server
├─2501 /usr/lib/code-server/lib/node /usr/lib/code-server
└─4607 /usr/lib/code-server/lib/node /usr/lib/code-server/vendor/modules/code-oss-dev/out/bootstrap-fork --type=ptyHost
Feb 16 12:42:27 server.xxxxxxx.net code-server[1454]: }
Feb 16 12:49:08 server.xxxxxxx.net systemd[1]: [/usr/lib/systemd/system/code-server@.service:6] Failed to parse service type, ignoring: exec
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: rejected promise not handled within 1 second: Error: ENOENT: no such file or directory, open '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: stack trace: Error: ENOENT: no such file or directory, open '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: [Error: ENOENT: no such file or directory, open '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'] {
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: errno: -2,
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: code: 'ENOENT',
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: syscall: 'open',
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: path: '/usr/lib/code-server/vendor/modules/code-oss-dev/out/vs/code/browser/workbench/workbench.html'
Feb 16 12:49:15 server.xxxxxxx.net code-server[1454]: }
Thanks.
There are some errors in the status output, let’s reinstall:
Stop vscode:
systemctl stop code-server@vscode
Remove Code server:
yum remove code-server
Delete user and files:
userdel vscode -r
Download install script install.sh
wget https://code-server.dev/install.sh
Make executable:
chmod +x install.sh
Install version 3.12.0:
./install.sh --version=3.12.0
From now on follow the tutorial from creating user vscode
…
Thank you very much, the last instruction works OK.
There are some errors in the status output, let’s reinstall:
Stop vscode:
systemctl stop code-server@vscode
Remove Code server:
yum remove code-server
Delete user and files:
userdel vscode -r
Download install script install.sh
wget https://code-server.dev/install.sh
Make executable:
chmod +x install.sh
Install version 3.12.0:
./install.sh --version=3.12.0
From now on follow the tutorial from creating user vscode…