All commands cause bash: /timer.####: Permission denied

Bug #2051995 reported by Mario Limonciello
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
Fix Released
High
Mitchell Dzurick

Bug Description

Since upgrading to noble, I've found that any command I run in the terminal will show an error like this:

bash: /timer.6217: Permission denied

The number changes, and I'm guessing matches the process ID. I finally narrowed down that it's cause by byobu.

Running `apt purge byobu` fixes it.

Specifically it's coming from /usr/share/byobu/profiles/bashrc, these are the problematic lines from that file:

# Requires Bash 4.x
export PS0='$(printf "%s" ${EPOCHREALTIME/./} >"$BYOBU_RUN_DIR/timer.$$")'

AFAICT $BYOBU_RUN_DIR isn't initialized which leads to this issue.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: byobu 6.10-0ubuntu1
Uname: Linux 6.8.0-rc2-00015-g4df2496d5549 x86_64
ApportVersion: 2.27.0-0ubuntu6
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu Feb 1 16:48:24 2024
InstallationDate: Installed on 2023-07-07 (209 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: byobu
UpgradeStatus: Upgraded to noble on 2023-12-20 (43 days ago)

Revision history for this message
Mario Limonciello (superm1) wrote :
Revision history for this message
Mario Limonciello (superm1) wrote :

This all happens from a logged in shell running in gnome-terminal. I also noticed that my color scheme changed, maybe the issue is that the byobu configuration shouldn't be sourced when byobu isn't running?

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Hi Mario,

Thank you for making this bug report!

I'm trying to reproduce this issue, but in the meantime could you please share the upgrade path you took?

So far I've attempted the following to reproduce:
* a fresh noble desktop install on a physical laptop
* a mantic lxd container where I upgrade just the noble version of byobu
* a jammy lxd container where I upgrade just the noble version of byobu
* a mantic lxd container where I install byobu and then run `do-release-upgrade -d -f DistUpgradeViewNonInteractive`

I haven't been able to reproduce this issue with the above setups.

Revision history for this message
Mario Limonciello (superm1) wrote :

It's a physical laptop: I started with Jammy on it and upgraded from Jammy to Mantic to Noble (iirc using do-release-upgrade followed by do-release-upgrade -d).

I *believe* it's a snippet in the bottom of my bashrc from my home directory that is tripping the issue. Maybe I ran byobu-prompt some time in the past and it added this?

[ -r /home/supermario/.byobu/prompt ] && . /home/supermario/.byobu/prompt #byobu-prompt#

Revision history for this message
Mario Limonciello (superm1) wrote :

This is from ~/.byobu/prompt:

# cat .byobu/prompt
[ -r /usr/share/byobu/profiles/bashrc ] && . /usr/share/byobu/profiles/bashrc #byobu-prompt#

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks for the additional information Mario! I tried running `byobu-prompt` and then upgrading and still couldn't reproduce it.

Could you try installing byobu again just with `sudo apt install byobu` and see if the problem still persists?

Revision history for this message
Mario Limonciello (superm1) wrote :

Yup, I just reinstalled it and it came back. I literally installed in one tab, opened a new one and the new one had the different color scheme (byobu scheme) and the problem.

Revision history for this message
Mario Limonciello (superm1) wrote :

Here's my full bashrc

Revision history for this message
Mario Limonciello (superm1) wrote :

Since you did a lot of container testing - I wonder if this only reproduces in a DE terminal app (like gnome-terminal)

Revision history for this message
Mitchell Dzurick (mitchdz) wrote (last edit ):

That was it! I simply did byobu-prompt on my fresh install of noble on my physical laptop and can see it now. Not sure at the moment why it's not seen in an lxd container.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Quick update: also tried an lxd VM and could not reproduce.

Changed in byobu (Ubuntu):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Mitchell Dzurick (mitchdz)
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

I was also able to reproduce this in the linuxcontainers mantic desktop VM image, just by getting the updated noble verson of byobu and installing that manually like so:

$ sudo apt update -y && sudo apt upgrade -y
$ sudo apt install byobu -y
$ wget https://launchpad.net/ubuntu/+archive/primary/+files/byobu_6.10-0ubuntu1_all.deb
$ sudo dpkg -i sudo dpkg -i byobu_6.10-0ubuntu1_all.deb

And then to reproduce:

$ byobu-prompt

tags: added: server-todo
Changed in byobu (Ubuntu):
status: Triaged → Incomplete
status: Incomplete → New
status: New → Triaged
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Taking more of a look into this today.

In the meantime, you can disable byobu-prompt by either:
1. Running `byobu-prompt` and replying `N`
or
2. Running `byobu-disable-prompt`

Which remedies the issue.

Revision history for this message
Peter John Allebone (allebone) wrote :

Hello. It appears I also have the same issue with byobu. I also did an in place upgrade.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Opened a PR[0] against upstream to fix this, will wait a day to hear back.

[0] - https://github.com/dustinkirkland/byobu/pull/62

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

FYI - the reason this can't be reproduced in an LXD container the way I was testing it, is because you login to the container as root, so when byobu's new bashrc changes tries to write to / then we are happily allowed to.

This can be easily reproduced in an LXD container by creating a new user and changing to that user.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package byobu - 6.11-0ubuntu1

---------------
byobu (6.11-0ubuntu1) noble; urgency=medium

  * usr/share/byobu/profiles/bashrc:
    - fix BYOBU_RUN_DIR and BYOBU_PREFIX issue
    - https://github.com/dustinkirkland/byobu/pull/62
    - https://launchpad.net/bugs/2051995 LP: #2051995
  * usr/bin/byobu-launcher-install.in:
    - Fix for VSCode, fish and byobu installations
    - https://github.com/dustinkirkland/byobu/commit/f917d2169afdec623f5b32723d93bfd91d34b92f#commitcomment-137955113
  * usr/lib/byobu/updates_available:
    - added support for dnf package manager
    - https://code.launchpad.net/~sanjay-ankur/byobu/byobu/+merge/415959

 -- Dustin Kirkland <email address hidden> Sat, 10 Feb 2024 11:03:36 -0600

Changed in byobu (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks Dustin! I confirmed 6.11-0ubuntu1 works.

The only caveat is that you have to source your bashrc again after upgrading.

I'm removing server-todo from this bug and marking it as finished.

tags: removed: server-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.