Skip to content
This repository was archived by the owner on Oct 13, 2026. It is now read-only.
This repository was archived by the owner on Oct 13, 2026. It is now read-only.

Remove calls to sudo if already root #10

Open

Description

@p5

If you run rechunk as a root user already, rechunk tries to sudo again.
This can be problematic if you're running rechunk via a container image that doesn't have sudo installed.

Activity

  1. antheas commented on Jan 5, 2025

    @antheas
    Collaborator

    can you print the full stacktrace?

  2. p5 commented on Jan 5, 2025

    @p5
    ContributorAuthor

    Sure!

    Run hhd-dev/rechunk@602e6d62558ab23e15e8764ce06e26c0f328da71
      with:
        rechunk: ghcr.io/hhd-dev/rechunk:v1.0.1
        ref: localhost/rs-main-test:latest
        prev-ref: ghcr.io/centos-workstation/rs-main-test:latest
        skip_compression: true
        version: stream10
      env:
        IMAGE_NAME: rs-main-test
        IMAGE_DESC: CentOS Stream-based image for basing off of 
        IMAGE_REGISTRY: ghcr.io/centos-workstation
        DEFAULT_TAG: latest
        CENTOS_VERSION: stream10
        PLATFORMS: amd64 arm64
    Run CREF=$(sudo podman create localhost/rs-main-test:latest bash)
      CREF=$(sudo podman create localhost/rs-main-test:latest bash)
      MOUNT=$(sudo podman mount $CREF)
      echo "container=$CREF" >> $GITHUB_OUTPUT
      echo "mount=$MOUNT" >> $GITHUB_OUTPUT
      shell: bash --noprofile --norc -e -o pipefail {0}
      env:
        IMAGE_NAME: rs-main-test
        IMAGE_DESC: CentOS Stream-based image for basing off of 
        IMAGE_REGISTRY: ghcr.io/centos-workstation
        DEFAULT_TAG: latest
        CENTOS_VERSION: stream10
        PLATFORMS: amd64 arm64
    /__w/_temp/6[2](https://github.com/centos-workstation/main/actions/runs/12619103953/job/35163235979?pr=51#step:8:2)96f0ea-8046-4ac2-8719-9a7ec24edd60.sh: line 1: sudo: command not found
    Error: Process completed with exit code 127.
    

    For now, I've aliased sudo to a no-op, but it would be good not to.

    Not an urgent change though, since the alias works fine.

  3. antheas commented on Jan 5, 2025

    @antheas
    Collaborator

    There are two problematic sudos in rechunk, i just removed them:
    20a6e58

    The container we ship has them so its a noop though.

    As for the sudo you are running into, thats from the github action. Since you are running a github action, it is expected to run as a normal user with sudo as escalation

    So unsure what to do about that. Also, running the action nested from a container image is something that will probably cause a lot of other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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