che icon indicating copy to clipboard operation
che copied to clipboard

HOME environment variable points to `/opt/app-root/src` in python sample

Open vitaliy-guliy opened this issue 1 year ago • 4 comments

Describe the bug

I noticed that on the developer sandbox and on the godfooding instance HOME environment variable is set to /opt/app-root/src.

It brings some problems. First, that /opt/app-root/.... is not persisted and all the stored data are lost on workspace restart. Seconds, it is not right ideologically, home directory should be located in /home, not in /opt.

Che version

7.88

Steps to reproduce

  • create a workspace
  • open a terminal, run
$ export | grep HOME

Expected behavior

HOME should be set to /home/user

Screenshots

Screenshot from 2024-08-01 11-49-42

Environment

Dev Sandbox (workspaces.openshift.com)

vitaliy-guliy avatar Aug 01 '24 08:08 vitaliy-guliy

@vitaliy-guliy can you please share the devfile you used that encountered this error? I'm under the impression this is affecting tooling images other than the UDI, as I didn't reproduce the issue in the following devfile (UDI sample):

schemaVersion: 2.2.0
metadata:
  name: udi
  namespace: aobuchow-che-1cac83
  displayName: Universal Developer Image
  description: Universal Developer Image provides various programming languages tools and runtimes for instant coding
  icon: https://raw.githubusercontent.com/devfile/devfile-web/main/apps/landing-page/public/pwa-192x192.png
  tags:
    - Java
    - Maven
    - Scala
    - PHP
    - .NET
    - Node.js
    - Go
    - Python
    - Pip
    - ubi8
  projectType: universal
  language: Polyglot
  version: 1.0.0
components:
  - name: tools
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-latest
      memoryLimit: 6G
      memoryRequest: 512Mi
      cpuRequest: 1000m
      cpuLimit: 4000m
      mountSources: true

AObuchow avatar Aug 01 '24 14:08 AObuchow

@vitaliy-guliy can you please share the devfile you used that encountered this error?

It is a python sample from Create Workspace page. I think it comes from this devfile https://github.com/devfile/registry/blob/main/stacks/python/2.2.0/devfile.yaml where tools container is registry.access.redhat.com/ubi9/python-39

Btw, on the developer sandbox persistence for /home/user directory is not configured.

vitaliy-guliy avatar Aug 01 '24 14:08 vitaliy-guliy

I don't believe we actually maintain that image https://catalog.redhat.com/software/containers/ubi9/python-39/61a61032bfd4a5234d59629e?container-tabs=overview

Maybe once the short term plan for https://issues.redhat.com/browse/CRW-6577?focusedId=25106725&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-25106725 is resolved, we can create a minimal python image based on our UBI that has home persistence & $HOME set correctly?

AObuchow avatar Aug 01 '24 17:08 AObuchow

It is reproducible as well for go, dotnet, angular, and I believe for some other samples.

vitaliy-guliy avatar Aug 05 '24 13:08 vitaliy-guliy

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

che-bot avatar Nov 12 '25 14:11 che-bot