Bug 1110259 - btrfsmaintenance update hangs waiting for job restarts
Summary: btrfsmaintenance update hangs waiting for job restarts
Status: RESOLVED DUPLICATE of bug 1084871
: 1094172 1130702 1136362 1137084 1175990 1190189 (view as bug list)
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Leap 15.1
Hardware: Other Other
: P2 - High : Normal with 8 votes (vote)
Target Milestone: ---
Assignee: David Sterba
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-30 18:03 UTC by Andrei Borzenkov
Modified: 2024-04-08 21:19 UTC (History)
24 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
"ps" and other output from hung process. (5.79 KB, text/plain)
2019-06-02 18:53 UTC, Neil Rickert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Borzenkov 2018-09-30 18:03:30 UTC
My best guess is that job state is lost during daemon reload. I will leave VM in this state in case something else is needed, but it tends to lockup across host suspend.

From zypper run:

The following product is going to be upgraded:
  openSUSE Tumbleweed  20180919-0 -> 20180926-0
...
hecking for file conflicts: .............................................[done]
(  1/142) Installing: btrfsmaintenance-0.4.2-1.1.noarch ---------------------[\]

It stays so for couple of hours already. Current time:

bor@10:~> date
Sun Sep 30 20:59:58 MSK 2018

From journalctl:

Sep 30 18:53:41 10.0.2.15 [RPM][2837]: Transaction ID 5bb0f185 started
Sep 30 18:53:43 10.0.2.15 [RPM][2837]: erase btrfsmaintenance-0.4.1-2.1.noarch: success
Sep 30 18:54:03 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:04 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:04 10.0.2.15 systemd[1]: Starting Update cron periods from /etc/sysconfig/btrfsmaintenance...
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh script btrfs-scrub.sh for uninstall
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh script btrfs-defrag.sh for uninstall
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh script btrfs-balance.sh for uninstall
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh script btrfs-trim.sh for uninstall
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh timer btrfs-scrub for none
Sep 30 18:54:08 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:08 10.0.2.15 [RPM][2837]: install btrfsmaintenance-0.4.2-1.1.noarch: success
Sep 30 18:54:08 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:08 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh timer btrfs-defrag for none
Sep 30 18:54:08 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:08 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:08 10.0.2.15 systemd[1]: Started CUPS Scheduler.
Sep 30 18:54:08 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:09 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2875]: Refresh timer btrfs-balance for weekly
Sep 30 18:54:09 10.0.2.15 systemd[1]: Stopped Balance block groups on a btrfs filesystem.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Stopping Balance block groups on a btrfs filesystem.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Started Balance block groups on a btrfs filesystem.
Sep 30 18:54:09 10.0.2.15 systemd[1]: btrfsmaintenance-refresh.service: Main process exited, code=killed, status=15/TERM
Sep 30 18:54:09 10.0.2.15 systemd[1]: btrfsmaintenance-refresh.service: Failed with result 'signal'.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Stopped Update cron periods from /etc/sysconfig/btrfsmaintenance.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Stopped Watch /etc/sysconfig/btrfsmaintenance.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Stopping Watch /etc/sysconfig/btrfsmaintenance.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
Sep 30 18:54:09 10.0.2.15 systemd[1]: Starting Update cron periods from /etc/sysconfig/btrfsmaintenance...
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-scrub.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-defrag.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-balance.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-trim.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-scrub for none
Sep 30 18:54:09 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:09 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-defrag for none
Sep 30 18:54:09 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:10 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:10 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-balance for weekly
Sep 30 18:54:10 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:10 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:10 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-trim for none
Sep 30 18:54:10 10.0.2.15 systemd[1]: Reloading.
Sep 30 18:54:10 10.0.2.15 systemd[1]: nss-lookup.target: Dependency Before=nss-lookup.target dropped
Sep 30 18:54:10 10.0.2.15 systemd[1]: Started Update cron periods from /etc/sysconfig/btrfsmaintenance.

Processes:

bor@10:~> pstree -lp 2326
zypper(2326)─┬─btrfs-defrag-pl(2356)
             ├─rpm(2837)───sh(2891)───sh(2929)───systemctl(2930)
             ├─snapper.py(2359)
             └─systemd-inhibit(2355)───cat(2357)
bor@10:~> ps -fwwp 2930
UID        PID  PPID  C STIME TTY          TIME CMD
root      2930  2929  0 18:54 pts/0    00:00:00 /usr/bin/systemctl try-restart btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
bor@10:~> systemctl list-jobs
 JOB UNIT                  TYPE STATE  
3285 btrfs-balance.service nop  waiting
3381 btrfs-defrag.service  nop  waiting

2 jobs listed.
bor@10:~> sudo systemctl status btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
● btrfsmaintenance-refresh.service - Update cron periods from /etc/sysconfig/btrfsmaintenance
   Loaded: loaded (/usr/lib/systemd/system/btrfsmaintenance-refresh.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sun 2018-09-30 18:54:10 MSK; 2h 4min ago
  Process: 2952 ExecStart=/usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh systemd-timer (code=exited, status=0/SUCCESS)
 Main PID: 2952 (code=exited, status=0/SUCCESS)

Sep 30 18:54:09 10.0.2.15 systemd[1]: Starting Update cron periods from /etc/sysconfig/btrfsmaintenance...
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-scrub.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-defrag.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-balance.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh script btrfs-trim.sh for uninstall
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-scrub for none
Sep 30 18:54:09 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-defrag for none
Sep 30 18:54:10 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-balance for weekly
Sep 30 18:54:10 10.0.2.15 btrfsmaintenance-refresh-cron.sh[2952]: Refresh timer btrfs-trim for none
Sep 30 18:54:10 10.0.2.15 systemd[1]: Started Update cron periods from /etc/sysconfig/btrfsmaintenance.

● btrfsmaintenance-refresh.path - Watch /etc/sysconfig/btrfsmaintenance
   Loaded: loaded (/usr/lib/systemd/system/btrfsmaintenance-refresh.path; enabled; vendor preset: disabled)
   Active: active (waiting) since Sun 2018-09-30 18:54:09 MSK; 2h 4min ago

Sep 30 18:54:09 10.0.2.15 systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.

● btrfs-balance.service - Balance block groups on a btrfs filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-balance.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:btrfs-balance

● btrfs-balance.timer - Balance block groups on a btrfs filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-balance.timer; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/btrfs-balance.timer.d
           └─schedule.conf
   Active: active (waiting) since Sun 2018-09-30 18:54:09 MSK; 2h 4min ago
  Trigger: Mon 2018-10-01 00:00:00 MSK; 3h 1min left
     Docs: man:btrfs-balance

Sep 30 18:54:09 10.0.2.15 systemd[1]: Started Balance block groups on a btrfs filesystem.

● btrfs-defrag.service - Defragment file data on a mounted filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-defrag.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:btrfs-filesystem

● btrfs-defrag.timer - Defragment file data and/or directory metadata
   Loaded: loaded (/usr/lib/systemd/system/btrfs-defrag.timer; disabled; vendor preset: enabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:btrfs-filesystem

● btrfs-scrub.service - Scrub btrfs filesystem, verify block checksums
   Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:fstrim

● btrfs-scrub.timer - Scrub btrfs filesystem, verify block checksums
   Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.timer; disabled; vendor preset: enabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:btrfs-scrub

● btrfs-trim.service - Discard unused blocks on a mounted filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-trim.service; static; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:fstrim

● btrfs-trim.timer - Discard unused blocks on a mounted filesystem
   Loaded: loaded (/usr/lib/systemd/system/btrfs-trim.timer; disabled; vendor preset: enabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:fstrim
bor@10:~>
Comment 1 Stefan Weiberg 2019-02-12 12:27:38 UTC
I have the same issue when migrating a Leap 15.0 to SLES 15 following the SUSE Documentation (https://www.suse.com/documentation/sles-15/book_sle_upgrade/data/sec_upgrade-online_opensuse_to_sle.html)
Comment 2 Adam Majer 2019-04-04 11:12:32 UTC
I have similar issue when updating my Leap 15.1 VM today. It's stuck. Not even btrfs filesystem on that VM.

zypper(2122)─┬─btrfs-defrag-pl(2153)
             ├─rpm(3957)───sh(4007)───sh(4042)───systemctl(4044)
             ├─snapper.py(2150)
             └─systemd-inhibit(2148)───cat(2149)


● btrfs-scrub.timer - Scrub btrfs filesystem, verify block checksums
   Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.timer; enabled; vendor p>
  Drop-In: /etc/systemd/system/btrfs-scrub.timer.d
           └─schedule.conf
   Active: active (waiting) since Thu 2019-04-04 12:30:24 CEST; 37min ago
  Trigger: Wed 2019-05-01 00:00:00 CEST; 3 weeks 5 days left
     Docs: man:btrfs-scrub

Apr 04 12:30:24 g112 systemd[1]: Stopping Scrub btrfs filesystem, verify block >
Apr 04 12:30:24 g112 systemd[1]: Started Scrub btrfs filesystem, verify block c>

● btrfs-scrub.service - Scrub btrfs filesystem, verify block checksums
   Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.service; static; vendor >
   Active: inactive (dead) since Thu 2019-04-04 12:25:25 CEST; 44min ago
     Docs: man:fstrim
 Main PID: 783 (code=exited, status=0/SUCCESS)

Apr 04 12:25:25 localhost systemd[1]: Started Scrub btrfs filesystem, verify bl>
Apr 04 12:25:25 localhost btrfs-scrub.sh[783]: Running scrub on /
Apr 04 12:25:25 localhost btrfs-scrub.sh[783]: Path / is not btrfs, skipping


 JOB UNIT             TYPE STATE  
1836 btrfs-trim.timer nop  waiting

1 jobs listed.

So, this is a bug here or systemd?
Comment 3 Ludwig Nussel 2019-04-04 11:23:13 UTC
If this happens in 15.1 it's likely a bug that hits SLE too. Moving over to SP1
Comment 4 Adam Majer 2019-05-13 13:52:50 UTC
Moved back to openSUSE so it's not closed to community.
Comment 5 Till Dörges 2019-05-13 14:19:04 UTC
It appears I stumbled across another instance of this problem.

Bug occurred during 'zypper dup' (openSUSE Leap 15.0 -> 15.1).

The machine in question, however, does not use BTRFS at all:

--- snip ---
box:~ # grep btr /etc/fstab
box:~ # mount | grep btr
box:~ #
--- snap ---


Some additional information:

--- snip ---
(761/898) Installing: btrfsmaintenance-0.4.2-lp151.1.1.noarch
.............................................<100%>[\]

box:~ # ps auxwww
[...]
root      8446  0.0  0.1  57256  9332 pts/1    S+   13:44   0:00 rpm --root /
--dbpath /var/lib/rpm -U --percent --noglob --force --nodeps --
/var/cache/zypp/packages/deflektor_oss/noarch/btrfsmaintenance-0.4.2-lp151.1.1.noarch.rpm
root      8496  0.0  0.0  11980  2816 pts/1    S+   13:44   0:00 /bin/sh
/var/tmp/rpm-tmp.WnJcBQ 1
root      8531  0.0  0.0  11980  1904 pts/1    S+   13:44   0:00 /bin/sh
/var/tmp/rpm-tmp.WnJcBQ 1
root      8532  0.0  0.0  60224  6164 pts/1    S+   13:44   0:00 /usr/bin/systemctl
try-restart btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path
btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer
btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer


box:~ # lsof -p 8532
COMMAND    PID USER   FD   TYPE             DEVICE SIZE/OFF    NODE NAME
systemctl 8532 root  cwd    DIR              254,2     4096       2 /
systemctl 8532 root  rtd    DIR              254,2     4096       2 /
systemctl 8532 root  txt    REG              254,2   182416  531004 /usr/bin/systemctl
systemctl 8532 root  mem    REG              254,2  1356080 3932198 /lib64/libm-2.26.so
systemctl 8532 root  mem    REG              254,2   141560  533143
/usr/lib64/libudev.so.1.6.6
systemctl 8532 root  mem    REG              254,2    64208  530729
/usr/lib64/libjson-c.so.3.0.1
systemctl 8532 root  mem    REG              254,2    30896  525373
/usr/lib64/libargon2.so.1
systemctl 8532 root  mem    REG              254,2   354144  528070
/usr/lib64/libdevmapper.so.1.03
systemctl 8532 root  mem    REG              254,2    30840  524568
/usr/lib64/libuuid.so.1.3.0
systemctl 8532 root  mem    REG              254,2    18824 3932195
/lib64/libattr.so.1.1.0
systemctl 8532 root  mem    REG              254,2   575808  524531
/usr/lib64/libpcre.so.1.2.9
systemctl 8532 root  mem    REG              254,2   337224  530647
/usr/lib64/libcryptsetup.so.12.3.0
systemctl 8532 root  mem    REG              254,2   338976  525529
/usr/lib64/libblkid.so.1.1.0
systemctl 8532 root  mem    REG              254,2   268576  524634
/usr/lib64/libseccomp.so.2.3.2
systemctl 8532 root  mem    REG              254,2    35424 3932224
/lib64/libacl.so.1.1.2253
systemctl 8532 root  mem    REG              254,2   130208  530939
/usr/lib64/libgpg-error.so.0.24.0
systemctl 8532 root  mem    REG              254,2    18616 3932192 /lib64/libdl-2.26.so
systemctl 8532 root  mem    REG              254,2  1164832  529454
/usr/lib64/libgcrypt.so.20.2.2
systemctl 8532 root  mem    REG              254,2    84352  525302
/usr/lib64/liblz4.so.1.8.0
systemctl 8532 root  mem    REG              254,2   235576  525270
/usr/lib64/liblzma.so.5.2.3
systemctl 8532 root  mem    REG              254,2    97200 3932312
/lib64/libresolv-2.26.so
systemctl 8532 root  mem    REG              254,2    42120 3934078 /lib64/librt-2.26.so
systemctl 8532 root  mem    REG              254,2    18984  526567
/usr/lib64/libcap.so.2.25
systemctl 8532 root  mem    REG              254,2   159456 3934083
/lib64/libselinux.so.1
systemctl 8532 root  mem    REG              254,2  2034848 3932178 /lib64/libc-2.26.so
systemctl 8532 root  mem    REG              254,2   140688 3932289
/lib64/libpthread-2.26.so
systemctl 8532 root  mem    REG              254,2  2302168  531028
/usr/lib/systemd/libsystemd-shared-234.so
systemctl 8532 root  mem    REG              254,2   180056 3934066 /lib64/ld-2.26.so
systemctl 8532 root    0r  FIFO               0,12      0t0   50830 pipe
systemctl 8532 root    1w  FIFO               0,12      0t0   52546 pipe
systemctl 8532 root    2w  FIFO               0,12      0t0   52546 pipe
systemctl 8532 root    3u  unix 0xffff8801f5e10400      0t0   50858 type=STREAM


box:~ # strace -p 8532
strace: Process 8532 attached
ppoll([{fd=3, events=POLLIN}], 1, NULL, NULL, 8



box:~ # ps -elf | head -1; ps -elf | egrep 'bt[r]|853[1]'
F S UID        PID  PPID  C PRI  NI ADDR SZ WCHAN  STIME TTY          TIME CMD
0 S root      3255  3225  0  80   0 -  8210 -      13:25 pts/1    00:00:00
/usr/bin/python3 /usr/lib/zypp/plugins/commit/btrfs-defrag-plugin.py
4 S root      8446  3225  0  80   0 - 14314 -      13:44 pts/1    00:00:00 rpm --root
/ --dbpath /var/lib/rpm -U --percent --noglob --force --nodeps --
/var/cache/zypp/packages/deflektor_oss/noarch/btrfsmaintenance-0.4.2-lp151.1.1.noarch.rpm
1 S root      8531  8496  0  80   0 -  2995 -      13:44 pts/1    00:00:00 /bin/sh
/var/tmp/rpm-tmp.WnJcBQ 1
0 S root      8532  8531  0  80   0 - 15056 SyS_pp 13:44 pts/1    00:00:00
/usr/bin/systemctl try-restart btrfsmaintenance-refresh.service
btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer
btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer
btrfs-trim.service btrfs-trim.timer


box:~ # systemctl | head -1; systemctl | grep btr
  UNIT                           LOAD      ACTIVE SUB       DESCRIPTION
  btrfsmaintenance-refresh.path  loaded    active waiting   Watch
/etc/sysconfig/btrfsmaintenance
  btrfs-balance.timer            loaded    active waiting   Balance block groups on a
btrfs filesystem
  btrfs-scrub.timer              loaded    active waiting   Scrub btrfs filesystem,
verify block checksums
  btrfs-trim.timer               loaded    active waiting   Discard unused blocks on
a mounted filesystem


box:~ # cat /var/tmp/rpm-tmp.WnJcBQ

test -n "$FIRST_ARG" || FIRST_ARG="$1"
if [ "$FIRST_ARG" -ge 1 ]; then
        # Package upgrade, not uninstall
        if [ -x /usr/bin/systemctl ]; then
                /usr/bin/systemctl daemon-reload || :
                (
                        test "$YAST_IS_RUNNING" = instsys && exit 0
                        test -f /etc/sysconfig/services -a \
                             -z "$DISABLE_RESTART_ON_UPDATE" && . /etc/sysconfig/services
                        test "$DISABLE_RESTART_ON_UPDATE" = yes -o \
                             "$DISABLE_RESTART_ON_UPDATE" = 1 && exit 0
                        /usr/bin/systemctl try-restart
btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service
btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service
btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
                ) || :
        fi
else # package uninstall
        for service in btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path
btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer
btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer ; do
                sysv_service="${service%.*}"
                rm -f "/var/lib/systemd/migrated/$sysv_service" || :
        done
        if [ -x /usr/bin/systemctl ]; then
                /usr/bin/systemctl daemon-reload || :
        fi
fi


# did not terminate process
box:~ # kill 8532

# did work
box:~ # kill -9 8532
--- snap ---
Comment 6 Stefan Seyfried 2019-05-28 11:56:18 UTC
I'm seeing this on a SLES15-SP1-RC1 to SLES15-SP1-GMC update via "zypper -v dup --no-r".


(300/350) Installing: firewalld-0.5.5-4.24.9.noarch ..............[done]
Additional rpm output:
Updating /etc/sysconfig/firewalld ...


(301/350) Installing: btrfsmaintenance-0.4.2-1.11.noarch ......<100%>[\]

linux:~ # ps uwwwf
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       49971  0.0  0.0  19508  9308 pts/1    Ss   11:44   0:00 -bash
root       50221  0.0  0.0  35484  1808 pts/1    R+   11:53   0:00  \_ ps uwwwf
root       35913  0.0  0.0  19584  9344 pts/0    Ss   11:34   0:00 -bash
root       36153  0.8  0.1 168600 49928 pts/0    S+   11:39   0:06  \_ zypper -v dup --no-recommends
root       36206  0.0  0.0  59132  2980 pts/0    S    11:39   0:00      \_ /usr/bin/systemd-inhibit --what=sleep:shutdown:idle --who=zypp --mode=block --why=Zypp commit running. /usr/bin/cat
root       36208  0.0  0.0   4796   792 pts/0    S    11:39   0:00      |   \_ /usr/bin/cat
root       36207  0.0  0.0  32536 10124 pts/0    S+   11:39   0:00      \_ /usr/bin/python3 /usr/lib/zypp/plugins/commit/btrfs-defrag-plugin.py
root       36210  0.0  0.0  39336 12220 pts/0    S+   11:39   0:00      \_ /usr/bin/python3 /usr/lib/zypp/plugins/commit/zyppnotify
root       36211  0.0  0.0  61996 13344 pts/0    S+   11:39   0:00      \_ /usr/bin/python3 /usr/lib/zypp/plugins/commit/snapper.py
root       49754  0.0  0.0  57264  9572 pts/0    S+   11:42   0:00      \_ rpm --root / --dbpath /var/lib/rpm -U --percent --noglob --force --nodeps -- /var/cache/zypp/packages/SLE-SERVER15-Installer/noarch/btrfsmaintenance-0.4.2-1.11.noarch.rpm
root       49804  0.0  0.0  11980  2768 pts/0    S+   11:42   0:00          \_ /bin/sh /var/tmp/rpm-tmp.NvYmIe 1
root       49839  0.0  0.0  11980  1964 pts/0    S+   11:42   0:00              \_ /bin/sh /var/tmp/rpm-tmp.NvYmIe 1
root       49840  0.0  0.0  60224  6204 pts/0    S+   11:42   0:00                  \_ /usr/bin/systemctl try-restart btrfsmaintenance-refresh.service btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer

linux:~ # systemctl list-jobs
  JOB UNIT               TYPE STATE  
39987 btrfs-trim.service nop  waiting

1 jobs listed.
linux:~ # systemctl show 39987
Id=39987
Unit=btrfs-trim.service
JobType=nop
State=waiting
linux:~ # systemctl cancel 39987

... update proceeds
Comment 7 Michael Voronov 2019-06-02 17:48:30 UTC
I can confirm it on OpenSUSE Tumbleweed. It hangs when zypper tries to delete the old version. The workaround is to delete it with:
sudo zypper rm btrfsmaintenance-0.4.2-2.1
And then restart zypper dup
Comment 8 Neil Rickert 2019-06-02 18:53:11 UTC
Created attachment 806607 [details]
"ps" and other output from hung process.

I had the same problem in the update to 20190529.

The attached file contains a segment from screenlog.0 (terminal log of "zypper dup" to which I have appended a "typescript" log looking at hung processes from another terminal.

I killed process 5027 after it appeared hung for 15 minutes.  The update resumed without problem.

I do not have any "btrfs" file systems on that computer, so any scripts using "btrfsmaintenance" should have finished quickly.
Comment 9 Neil Rickert 2019-06-03 12:45:57 UTC
*** Bug 1130702 has been marked as a duplicate of this bug. ***
Comment 10 Frank Krüger 2019-06-03 14:45:47 UTC
(In reply to Neil Rickert from comment #8)
> Created attachment 806607 [details]
> "ps" and other output from hung process.
>  
> I do not have any "btrfs" file systems on that computer, so any scripts
> using "btrfsmaintenance" should have finished quickly.

FYI: https://bugzilla.suse.com/show_bug.cgi?id=1124823#c3
Comment 11 Stefan Seyfried 2019-06-05 09:51:09 UTC
(In reply to Stefan Seyfried from comment #6)

         
> \_ /usr/bin/systemctl try-restart btrfsmaintenance-refresh.service
> btrfsmaintenance-refresh.path btrfs-balance.service btrfs-balance.timer
> btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service
> btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer

BTW: WTH do we restart the "services" on update?
They are usually only triggered by timers anyway, so restarting the timers should be more than enough?
Comment 12 Jean Delvare 2019-07-03 06:36:48 UTC
*** Bug 1137084 has been marked as a duplicate of this bug. ***
Comment 13 Tristan Miller 2019-07-07 20:06:57 UTC
(In reply to Michael Voronov from comment #7)
> I can confirm it on OpenSUSE Tumbleweed. It hangs when zypper tries to
> delete the old version. The workaround is to delete it with:
> sudo zypper rm btrfsmaintenance-0.4.2-2.1
> And then restart zypper dup

I think that's a pretty poor workaround as you will end up skipping all the post-installation scripts of the packages that were successfully installed.

A better workaround is to kill the command that is causing the installation of btrfsmaintenance to hang, as in Comment 8.  I did this by running "ps -ft pts/0", making note of the PPID of the "/usr/bin/systemctl try-restart btrfsmaintenance-refresh.service" process, and killing it.
Comment 14 Miko G 2019-09-08 15:47:50 UTC
Installing Tumbleweed I got btrfsmaintenance going through a cron loop after install. I've verified the iso and it was ok. Reinstalling also did not help.
Comment 15 Diego Assencio 2019-10-07 08:21:54 UTC
This problem seems the same as bsc#1152092. Can someone please confirm?

Thank you very much!
Comment 16 Adam Majer 2019-10-07 08:38:15 UTC
(In reply to Diego Assencio from comment #15)
> This problem seems the same as bsc#1152092. Can someone please confirm?
> 
> Thank you very much!

Looks very much like it. It looks like systemctl was getting stuck restarting those btrfs timers for some reason.
Comment 17 Stefan Seyfried 2019-10-07 09:03:28 UTC
(In reply to Diego Assencio from comment #15)
> This problem seems the same as bsc#1152092. Can someone please confirm?
> 
> Thank you very much!

"You are not authorized to access bug #1152092."

(In reply to Adam Majer from comment #16)
> Looks very much like it. It looks like systemctl was getting stuck
> restarting those btrfs timers for some reason.

see comment#6, i'd say it is the useless restart of the *service*, not the timers, that is hanging.
Comment 18 Diego Assencio 2019-10-07 09:16:56 UTC
@Stefan: This is an internal bug report from SUSE (only employees have access to it).
Comment 19 David Sterba 2024-04-08 19:40:01 UTC
*** Bug 1094172 has been marked as a duplicate of this bug. ***
Comment 20 David Sterba 2024-04-08 19:55:49 UTC
*** Bug 1136362 has been marked as a duplicate of this bug. ***
Comment 22 David Sterba 2024-04-08 20:02:13 UTC
*** Bug 1175990 has been marked as a duplicate of this bug. ***
Comment 23 David Sterba 2024-04-08 21:19:51 UTC
*** Bug 1190189 has been marked as a duplicate of this bug. ***