redhat-developer / redhat-developer/devspaces-remote-connector

Devspaces drops connections randomly

Open
#12 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
1d 4h
Merged PRs (30d)
3

Description

Hi Redhat,

First I want to say your new VSCode plugin here is amazing compared to the SSH version, the experience is much smoother.

Unfortunately, I experience some connection drops at different times.
First I couldn't always connect to my newly created Devspaces, created from within the plugin or the web. The workaround is to start the workspace from web with the VSCode SSH editor where everything works as usual - or delete the ~/.vscode-server folder after creation without the SSH editor and connect using your plugin with success.

At Bankdata we do have support from OpenShift, but I hope it's okay that I'm creating this issue here anyway.
My team works on Backstage and both my team and our innersourcing teams like using Devspaces compared to other alternate options.

I have also experienced connection drops when starting Backstage (yarn start) and some weird times after running a script to restore our Postgres database (seperate container) it will drop connection shortly after. This is the debug logs from my Devspace when connection drops.

Debug logs

[2026-08-31T12:53:44.638Z] [DEBUG] DevWorkspace portal-devspace: main container = portal-dev
[2026-08-31T12:53:49.333Z] [INFO] Resolving 'devspaces+portal-devspace@c02u' (attempt #2)
[2026-08-31T12:53:49.334Z] [DEBUG] Resolver getKubeConfig: clusterUrl=https://devspaces.apps.c02u.paastools.bdunet.dk, extraKeys=[c02u]
[2026-08-31T12:53:49.334Z] [DEBUG] Token resolved (key=https://devspaces.apps.c02u.paastools.bdunet.dk)
[2026-08-31T12:53:49.334Z] [INFO] Discovering cluster endpoints from: https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.334Z] [DEBUG] Apps domain: apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.334Z] [DEBUG] API URL: https://api.c02u.paastools.bdunet.dk:6443
[2026-08-31T12:53:49.334Z] [DEBUG] DevSpaces URL: https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.334Z] [DEBUG] Fetching OAuth metadata from https://api.c02u.paastools.bdunet.dk:6443/.well-known/oauth-authorization-server
[2026-08-31T12:53:49.415Z] [INFO] Cluster discovery complete: API=https://api.c02u.paastools.bdunet.dk:6443, DevSpaces=https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.415Z] [DEBUG] KubeConfig created for https://api.c02u.paastools.bdunet.dk:6443
[2026-08-31T12:53:49.415Z] [DEBUG] Token resolved (key=https://devspaces.apps.c02u.paastools.bdunet.dk)
[2026-08-31T12:53:49.415Z] [INFO] Discovering cluster endpoints from: https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.415Z] [DEBUG] Apps domain: apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.415Z] [DEBUG] API URL: https://api.c02u.paastools.bdunet.dk:6443
[2026-08-31T12:53:49.415Z] [DEBUG] DevSpaces URL: https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.415Z] [DEBUG] Fetching OAuth metadata from https://api.c02u.paastools.bdunet.dk:6443/.well-known/oauth-authorization-server
[2026-08-31T12:53:49.492Z] [INFO] Cluster discovery complete: API=https://api.c02u.paastools.bdunet.dk:6443, DevSpaces=https://devspaces.apps.c02u.paastools.bdunet.dk
[2026-08-31T12:53:49.492Z] [DEBUG] KubeConfig created for https://api.c02u.paastools.bdunet.dk:6443
[2026-08-31T12:53:49.569Z] [INFO] Workspace portal-devspace phase: Running
[2026-08-31T12:53:49.569Z] [INFO] Finding pod for portal-devspace
[2026-08-31T12:53:49.628Z] [DEBUG] DevWorkspace portal-devspace: main container = portal-dev
[2026-08-31T12:53:49.810Z] [DEBUG] DevWorkspace portal-devspace: main container = portal-dev
[2026-08-31T12:53:49.810Z] [INFO] Installing REH on workspace69ff86e1338946a2-7b79654db-fblgh/portal-dev
[2026-08-31T12:53:49.810Z] [INFO] Installing REH server on workspace69ff86e1338946a2-7b79654db-fblgh/portal-dev via K8s exec
[2026-08-31T12:53:50.507Z] [DEBUG] Server install output:
Server already installed at /home/user/.vscode-server/bin/08d4889f9ec4a1685d257b9b95de036c8e1ce1e5/bin/code-server
5aec0614c0696d556fa5558c: start
exitCode==0==
serverScript==/home/user/.vscode-server/bin/08d4889f9ec4a1685d257b9b95de036c8e1ce1e5/bin/code-server==
listeningOn==44029==
connectionToken==<redacted>==
osReleaseId==rhel==
arch==x86_64==
platform==linux==
tmpDir==/tmp==
5aec0614c0696d556fa5558c: end

[2026-08-31T12:53:50.507Z] [INFO] REH server ready: script=/home/user/.vscode-server/bin/08d4889f9ec4a1685d257b9b95de036c8e1ce1e5/bin/code-server, port=44029, platform=linux, arch=x86_64
[2026-08-31T12:53:50.507Z] [INFO] REH listening on port 44029
[2026-08-31T12:53:50.509Z] [INFO] Port-forward: localhost:55333 → workspace69ff86e1338946a2-7b79654db-fblgh:44029
[2026-08-31T12:53:55.785Z] [DEBUG] DevWorkspace portal-devspace: main container = portal-dev

Our Devfile

schemaVersion: 2.2.0
metadata:
  name: portal-devspace
  architectures: [ 'amd64' ]
components:
  - name: portal-dev
    container:
      image: registry.bankdata.dev/all-docker-release/bac/portal-dev:1.75
      cpuRequest: 500m
      cpuLimit: '6'
      memoryLimit: 6Gi
      memoryRequest: 2Gi
      mountSources: true
      endpoints:
        - exposure: public
          name: frontend
          protocol: https
          targetPort: 3000
        - exposure: public
          name: backend
          protocol: https
          targetPort: 7007
      env:
        - name: NODE_ENV
          value: development
      volumeMounts:
        - name: home
          path: /home/user
        - name: tmp
          path: /var/tmp/user
  - name: portal-postgres
    container:
      image: registry.bankdata.dev/all-docker-release/bitnami/postgresql:16.5.0
      cpuRequest: 200m
      cpuLimit: '1'
      memoryLimit: 1Gi
      memoryRequest: 512Mi
      endpoints:
        - exposure: none
          name: postgresql
          targetPort: 5432
      env:
        - name: POSTGRES_DB
          value: backstage
        - name: POSTGRES_USER
          value: backstage
        - name: POSTGRES_PASSWORD
          value: backstage
      volumeMounts:
        - name: portal-postgres-data
          path: /var/lib/pgsql/data
  - name: portal-postgres-data
    volume:
      size: 5Gi
  - name: home
    volume:
      size: 5Gi
  - name: tmp
    volume:
      size: 5Gi

Our Dockerfile

FROM registry.bankdata.dev/all-docker-centrals/devspaces/udi-rhel9:3.26.1

# RUN dnf -y update && dnf clean all
USER root

# Configure microdnf to use Bankdata Artifactory RPM repos only
RUN --mount=type=secret,id=netrc,target=/run/secrets/netrc \
    ln -sf /run/secrets/netrc /opt/app-root/.netrc \
    && login="$(awk '/^[[:space:]]*login[[:space:]]+/{print $2; exit}' /run/secrets/netrc)" \
    && password="$(awk '/^[[:space:]]*password[[:space:]]+/{print $2; exit}' /run/secrets/netrc)" \
    && sed -i -e 's#cdn-ubi.redhat.com#registry.bankdata.dev/artifactory/ubi-rpm-remote#' \
    -e "/registry.bankdata.dev\/artifactory\/ubi-rpm-remote/a username=${login}" \
    -e "/registry.bankdata.dev\/artifactory\/ubi-rpm-remote/a password=${password}" \
    -e 's/^gpgcheck\s*=.*/gpgcheck=0/' /etc/yum.repos.d/ubi.repo \
    && microdnf update -y \
    && microdnf install -y sudo wget iputils tar postgresql python3 python3-pip git g++ make libxcrypt-compat libxml2

# Install Techdocs Python packages from Bankdata Registry
RUN sudo -H pip3 config set global.index-url https://registry.bankdata.dev/artifactory/api/pypi/devopsjava-pypi-remote/simple && \
    pip3 install mkdocs-techdocs-core cookiecutter mkdocs-awesome-pages-plugin mkdocs-kroki-plugin 

# # Install Openshift OC CLI
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/openshift4/ose-cli:v4.13 /usr/bin/oc /usr/local/bin/oc

# # Install MinIO Client from official slim image
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/minio/mc:RELEASE.2025-08-13T08-35-41Z-cpuv1 /usr/bin/mc /usr/local/bin/mc

# # 1Password CLI installation
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/1password/op:2 /usr/local/bin/op /usr/local/bin/op

# # Remove Node.js bundled in base image to avoid version conflicts
RUN rpm -e --nodeps nodejs nodejs-full-i18n npm 2>/dev/null; \
    rm -f /usr/bin/node /usr/bin/npm /usr/bin/npx /usr/bin/corepack; \
    true

# Install Node.js from official slim image - fix https://elementor.com/blog/permission-denied-error-in-docker/
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/node:24.14.0-trixie /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/node:24.14.0-trixie /usr/local/bin /usr/local/bin
COPY --chown=1002050000:1002050000 --from=registry.bankdata.dev/all-docker-centrals/node:24.14.0-trixie /opt/yarn-v1.22.22 /opt/yarn-v1.22.22

ENV COREPACK_HOME=/opt/corepack
ENV npm_config_tarball=/tmp/node-headers.tar.gz
COPY --chown=1002050000:1002050000 node-headers.tar.gz /tmp/node-headers.tar.gz

RUN --mount=type=secret,id=netrc,target=/run/secrets/netrc \
    ln -sf /run/secrets/netrc "$HOME/.netrc" && \
    export COREPACK_NPM_TOKEN=$(awk '/password/{ print $2; exit }' /run/secrets/netrc) && \
    export COREPACK_NPM_USERNAME=$(awk '/login/{ print $2; exit }' /run/secrets/netrc) && \
    export COREPACK_NPM_REGISTRY=https://registry.bankdata.dev/artifactory/api/npm/npm && \
    mkdir -p "$COREPACK_HOME" && \
    corepack enable && corepack prepare yarn@4.14.1 --activate && yarn -v && \
    chown -R user:1002050000 "$COREPACK_HOME" && \
    chown -R user:1002050000 /usr/local/bin

ENV COREPACK_ENABLE_NETWORK=0
USER user:1002050000

EXPOSE 3000 7007

I see great potential in this plugin and would like to help make it better than the SSH version.
Let me know if you need anything from me.

//Fuglen

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start with the VSCode plugin's workspace resolution, REH installation, and Kubernetes port-forward sequence shown in the debug log; reproduce using the supplied Devfile and Dockerfile, including yarn start and the PostgreSQL restore. Done means the cause is reproducible and connection stability is verified in those scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, postgresql, typescript, vscode
Domain
databases, devops, devtools, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.