bb-code-server crashing on start

I really wanted to get the vscode server working on my beagleplay. After some investigation, I found that the server was crashing on boot. It seems like this issue was reported previously by @silver2row : bb-code-server and starting to get errors on building and keeping it up while running!

The beagleplay intro doc also mentions the following: “You may get a warning about an invalid or self-signed certificate”. i didn’t know what this referring to until I saw these journalctl logs:

The fix for me was to remove “–cert” from /lib/systemd/system/bb-code-server.service. I would like to see this removed by default, with the premise that users should be aware to NOT port-forward or have the beagleplay be available from external/global networks.

I’d like to hear everyone’s thoughts on this. Should we remove certificates for a working “out-of-box” experience?

1 Like

Hello,

@Sabeeh_Khan , that was not for the BeaglePlay but it may be similar. I think…

sudo apt install bb-code-server may help. I see in some releases for armhf repos, it is not installed by default.

Seth

P.S. I do not have the BeaglePlay right now. I cannot test it on my end.

Hi,

I have the same issue on my BeaglePlay. I tried installing the bb-code-server, but this did not change anything. In the end I also followed @Sabeeh_Khan’s approach and removed the “–cert” from /lib/systemd/system/bb-code-server.service.

Renier

Same with mine. Had to remove --cert for it to start…

I think it might be a race condition… --cert is auto generated on first time, but on first startup all ssh key’s are wiped for a fresh install…

After a reboot, does it work on the 2nd try?

Background, --cert enable https, which makes the preview window and other more advanced functions actually work in modern browsers, within VScode…

Regards,

Hey @RobertCNelson ,
Yes, after a reboot the server comes up.
I didn’t realize feeding bb-code-server PEM keys generated from ssh-keygen would work. I’ll try that and report back.

Sorry to cause confusion, and I don’t think I did anything wrong, but when I checked ~/.local/share/code-server there were localhost.key and localhost.crt with populated values!! These files had 0 bytes file size before.

Does bb-code-server automatically generate certs once it comes up?

I then added back the “–cert” tag and https works now.

Update:

  1. I added --cert back into /lib/systemd/system/bb-code-server.service (to bring it back to default config)
  2. Rebooted. Still failed.
  3. Inspected /lib/systemd/system/bb-code-server.service/localhost.key and localhost.crt and noticed they were 0 size as @Sabeeh_Khan says.
  4. Deleted localhost.key / localhost.crt and restarted bb-code-server and now works as expected (and localhost.crt / key are now non-zero length)

Awesome @Sabeeh_Khan and @BarryBeagle a size of 0 is something we can check for and fix, thanks!

Thanks for this thread. Out of box experience on beagleplay today.
Did full upgrade, had to manually upgrade bb-code-server:

The following packages have been kept back:
  bb-code-server

Finally after many experiments found this info and removed “–cert” :slight_smile:

I am still a bit confused:
The ~/.local/share/code-server/localhost.key and localhost.crt files have zero size.
Rebooted, put back –cert, rebooted …
So for now the only solution I know is to eliminate –cert from /lib/systemd/system/bb-code-server.service

Am I missing anything? Are the files expected to be self-populated or is there any procedure I should follow creating rsa(?) keys? Thanks!