C
Coder.com7mo ago
JFK

Coder on Windows

I manage a coder instance for my work group, and love it so much I decided to install it on my Windows desktop to help organize different development environments. However I've ran up against some problems that perhaps someone else has seen before and can suggest some fixes. I followed the directions in the docs, using winget and after updating the path manually (the installer complains about a path length) I could bring up a console and coder server was up and running in no time. I logged into the instance and set my user account up, and selected one of the starter templates (Docker containers) as my default, and tried to create a workspace, but get the following error:
Error: failed to read downloaded context: failed to load cache key: invalid response status 403

on main.tf line 163, in resource "docker_image" "main":
163: resource "docker_image" "main" {
Error: failed to read downloaded context: failed to load cache key: invalid response status 403

on main.tf line 163, in resource "docker_image" "main":
163: resource "docker_image" "main" {
I also started to see a few errors in the console such as:
2024-05-11 15:35:00.001 [erro] coderd.dbrollup: failed to rollup data ...
error= execute transaction:
github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
/home/runner/actions-runner/_work/coder/coder/coderd/database/db.go:145
- pq: character with byte sequence 0xce 0xbc in encoding "UTF8" has no equivalent in encoding "WIN1252"
failed to sync sloghuman: sync /dev/stderr: The handle is invalid.
2024-05-11 15:35:00.001 [erro] coderd.dbrollup: failed to rollup data ...
error= execute transaction:
github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
/home/runner/actions-runner/_work/coder/coder/coderd/database/db.go:145
- pq: character with byte sequence 0xce 0xbc in encoding "UTF8" has no equivalent in encoding "WIN1252"
failed to sync sloghuman: sync /dev/stderr: The handle is invalid.
2024-05-11 15:32:00.328 [erro] provisionerd-desktop-87f4877-0.runner: workspace provisioner job logged job_id=eda18dd7-abee-46cd-82e9-2e7a49c98125 template_name=docker template_version=friendly_shockley0 workspace_build_id=0c436250-2513-4d81-adc9-95615bfe0c33 workspace_id=50068bd9-40c2-4dae-b7e8-bd1d43845faa workspace_name=test workspace_owner=John workspace_transition=start level=ERROR output="Error: failed to read downloaded context: failed to load cache key: invalid response status 403\n\n" workspace_build_id=0c436250-2513-4d81-adc9-95615bfe0c33
2024-05-11 15:32:00.328 [erro] provisionerd-desktop-87f4877-0.runner: workspace provisioner job logged job_id=eda18dd7-abee-46cd-82e9-2e7a49c98125 template_name=docker template_version=friendly_shockley0 workspace_build_id=0c436250-2513-4d81-adc9-95615bfe0c33 workspace_id=50068bd9-40c2-4dae-b7e8-bd1d43845faa workspace_name=test workspace_owner=John workspace_transition=start level=ERROR output="Error: failed to read downloaded context: failed to load cache key: invalid response status 403\n\n" workspace_build_id=0c436250-2513-4d81-adc9-95615bfe0c33
I don't think these are related, but it seemed odd to see so many errors after a fresh install. Any thoughts?
8 Replies
Codercord
Codercord7mo ago
<#1238882939752943757>
Category
Help needed
Product
Coder OSS (v2)
Platform
Windows
Logs
Please post any relevant logs/error messages.
Atif
Atif7mo ago
Hi there, How are you creating the template? If you are pushing the template from the windows machine. Make sure you set the encoding to UTF-8 and line endings to LF.
Phorcys
Phorcys7mo ago
quick question, I've had issues with this recently, could it perhaps be done automatically? maybe not all the files if it's explicitly required that some assets have a specific encoding but I'm thinking about automatically converting .tf files mainly otherwise we could convert everything and have a --disable-automatic-conversion flag or something similar lmk if you want me to open an issue, I think I might already have had one in the past
Atif
Atif7mo ago
IIRC there was an issue requesting this conversation but converting all files isn't feasible as there can be files that require windows line endings like PowerShell scripts. Also it wasn't a very wild spread issue and we didn't hear many complaints so it was kind of backlogged. First let us be sure if the OP has the same problem and then we can find and reopen the issue and add more context to it.
Phorcys
Phorcys7mo ago
yeah that's why maybe we should only do the terraform files or put a warning instead
JFK
JFKOP7mo ago
The template. I'm just using a starter template. The Docker one. Because I don't work on windows for my work stuff, I stood up a nuc with unbuntu and kind of abandoned the windows route. It was flawless. Which kind of brings me full circle, because it should be just as easy on Windows honestly.
Phorcys
Phorcys7mo ago
we try to bring feature parity so it should work as well on windows but Linux can be a bit easier to play with especially when testing specific commands for your Linux template make sure to change the encoding and line endings if you copied the template over as those will still be the same
JFK
JFKOP7mo ago
I'll try and reconstruct it, but I don't think I copied anything. I installed Coder on Windows. Started the server. Went to the UI, logged in. Went to Templates and selected the Starter Templates and clicked on the Docker Template. You don't copy anything manually. Used the Docker Template as is and got those errors. But also, some of those errors aren't due to a template copy and paste. Some of those are the server throwing errors after a clean install just sitting idle.
Want results from more Discord servers?
Add your server