Skip to content

install / ensure-correct-permissions-profiles-dir.sh does not work as intended #3882

@rkaplers

Description

@rkaplers

Self-Hosted Version

25.8.0

CPU Architecture

x86_64

Docker Version

27.5.1

Docker Compose Version

2.32.4

Machine Specification

  • My system meets the minimum system requirements of Sentry

Steps to Reproduce

When running install.sh to upgrade sentry, it is supposed to change permissions by running once:
chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles

However, it does it every time now, it seems it might have an issue in the shell script: https://github.com/getsentry/self-hosted/blob/master/install/ensure-correct-permissions-profiles-dir.sh

Looking at line 8:

if [ "$(stat -c '%U:%G' /var/vroom)" = "vroom:vroom" ]; then

We can see it checks if stat -c '%U:%G' /var/vroom)" = "vroom:vroom", if so - it skips it, however, how does that work if it should check it in a container?

I am also getting error for it as it checks underlying filesystem for /var/vroom rather than container:
▶ Ensuring correct permissions on profiles directory ...
stat: cannot statx '/var/vroom': No such file or directory

Should it not check for the permissions within the container, for example like this?

#!/usr/bin/env bash

echo "${_group}Ensuring correct permissions on profiles directory ..."

if [ "$($dcr --no-deps --entrypoint /bin/bash --user root vroom -c "stat -c '%U:%G' /var/vroom" 2>/dev/null)" = "vroom:vroom" ]; then
  echo "Ownership of /var/vroom is already set to vroom:vroom. Skipping chown."
else
  $dcr --no-deps --entrypoint /bin/bash --user root vroom -c 'chown -R vroom:vroom /var/vroom/sentry-profiles && chmod -R o+rwx /var/vroom/sentry-profiles'
fi

echo "${_endgroup}"

Expected Result

chown vroom:vroom is ran once and skipped afterwards.

Actual Result

▶ Ensuring correct permissions on profiles directory ...
stat: cannot statx '/var/vroom': No such file or directory

Event ID

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions