JFK
JFK
CCoder.com
Created by JFK on 5/11/2024 in #help
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?
18 replies
CCoder.com
Created by JFK on 5/6/2024 in #help
What is the CLI command to edit a file using code-server?
Normally I would use code <filename> in VSCode, is there an equivalent with code-server?
13 replies
CCoder.com
Created by JFK on 4/9/2024 in #help
Local User w/Enterprise Container
When using a starter Docker template, the buildfile shown here, creates a local user that is the person who is logging into the workspace.
FROM ubuntu

RUN apt-get update \
&& apt-get install -y \
curl \
git \
golang \
sudo \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
FROM ubuntu

RUN apt-get update \
&& apt-get install -y \
curl \
git \
golang \
sudo \
vim \
wget \
&& rm -rf /var/lib/apt/lists/*

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
However when using the enterprise container creates a "coder" user, so that a user named "Fred" is now logged in as coder. I've tried updating the build file as such, but the build breaks with issues on the useradd command. Not really sure why.
FROM codercom/enterprise-base

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
FROM codercom/enterprise-base

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
9 replies
CCoder.com
Created by JFK on 4/8/2024 in #help
Set a Default URI w/Dotfiles Module
Is it possible to set a default URI for the repository when using this module?
7 replies
CCoder.com
Created by JFK on 4/2/2024 in #help
Setting up a Privileged Sidecar
No description
9 replies