Skip to content

Print to stdout in .bashrc interferes with Coder metrics display #19116

@FloG309

Description

@FloG309

I run Coder deployed on Kubernetes and I open a workspace on VSCode via the coder extension

Steps to Reproduce

  1. Open a Coder workspace on VSCode
  2. Create a .bashrc File and write something to stdout (e.g. echo "hello")
  3. Look at the metrics in the Web UI and see that the stdout is visible there.

Expected

Normal display of metrics in the UI

Image

Actual

This:
Image

Leads to this:
Image

I guess this is not supposed to happen. It also makes it a tradeoff to print stuff in bashrc to display it when opening a new shell (either having metrics or shell output).

What worries me is that this happens dynamically. So if I change the echoed string, the UI gets updated within seconds. This makes me wonder if Coder executes the .bashrc file continually? This would be bad since I often have side effects in there (key vault queries etc.).

Notes

I am working in an enterprise environment, so I could not test this on the vanilla coder-ubuntu image (missing certificates and proxies). Below is the Dockerfile I used to build my container.


FROM (artifactory URI)/codercom/enterprise-base:ubuntu
ENV http_proxy=(zproxy URI)
ENV https_proxy=(zproxy URI)
ENV no_proxy=127.0.0.1,localhost,10.,185.,...

USER root

COPY ca-bundle.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates

USER coder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions