Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JupyterLab Notebook: Byobu unusable due to ownership conflict #1951

Open
Souheil-Yazji opened this issue Feb 1, 2024 · 4 comments · May be fixed by StatCan/aaw-kubeflow-containers#686
Open
Assignees
Labels
good-first-issue Good for newcomers kind/bug Something isn't working triage/support

Comments

@Souheil-Yazji
Copy link
Contributor

Describe the bug

Byobu cannot be used on notebooks due to permissions isolation:

image

Environment info

Namespace: Any

Notebook/server: Any

Steps to reproduce

Steps to reproduce the behavior:

  1. Launch a JLab notebook
  2. type byobu
  3. see error

Expected behaviour

Byobu starts

Screenshots

See top

Additional context

I believe there's no ability to su -c byobu $NB_USER or anything similar due to escalation as jovyan

@jacek-dudek
Copy link

Reproduced the issue on a dev notebook.
Trying to confirm if it is a filesystem operation that's being blocked as suggested by the error message.
Also will take a look at how it's being installed on the image, maybe there's an alternative way to install it.

@jacek-dudek
Copy link

Noticed that the executable byobu is actually a shell script that implements a configuration layer on top of tmux or screen, which are the actual screen managers. So I didn't need to debug with strace, I could just inspect the script. Here's a section relevant to this issue:

# All sorts of things go wrong if you don't own your $HOME dir.
# This happens under sudo, if you don't use the -H option; Byobu will
# create a bunch of files in your $HOME which will be owned by root.
if [ ! -O "$HOME" ]; then
	echo "Cannot run $PKG because [$USER] does not own [$HOME]" 1>&2
	if [ -n "$SUDO_USER" ]; then
		echo "To run $PKG under sudo, you MUST use 'sudo -H'" 1>&2
	fi
	exit 1
fi

@jacek-dudek
Copy link

I created a branch and added a directive in the ∞_CMD.Dockerfile docker-bits file to change the ownership from root to user.
I will create a notebook based on the branch image and verify if byobu startup error gets resolved.

@jacek-dudek
Copy link

I created the notebook and verified that changing ownership of user's home directory from root to user makes byobu work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers kind/bug Something isn't working triage/support
Projects
None yet
4 participants