Bug 1573016 - gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.
Summary: gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libblockdev
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Vojtech Trefny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:f4405ab405e849ce84566fe6362...
Depends On:
Blocks: 1634016 1635252 1635253 1654309
TreeView+ depends on / blocked
 
Reported: 2018-04-29 19:51 UTC by Koumb
Modified: 2019-03-07 15:49 UTC (History)
15 users (show)

Fixed In Version: libblockdev-2.20-2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1634016 1635252 (view as bug list)
Environment:
Last Closed: 2018-11-30 23:36:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: anaconda-tb (3.21 MB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: anaconda.log (181.59 KB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: environ (587 bytes, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: journalctl (1.47 MB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: lsblk_output (2.55 KB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: lvm.log (79.03 KB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: nmcli_dev_list (1.54 KB, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: os_info (596 bytes, text/plain)
2018-04-29 19:52 UTC, Koumb
no flags Details
File: program.log (214.90 KB, text/plain)
2018-04-29 19:53 UTC, Koumb
no flags Details
File: storage.log (1.18 MB, text/plain)
2018-04-29 19:53 UTC, Koumb
no flags Details
File: ifcfg.log (27.28 KB, text/plain)
2018-04-29 19:53 UTC, Koumb
no flags Details
script to activate swap device with libblockdev (341 bytes, text/plain)
2018-10-01 09:24 UTC, Vratislav Podzimek
no flags Details

Description Koumb 2018-04-29 19:51:34 UTC
Version-Release number of selected component:
anaconda-core-27.20.4-4.fc27.x86_64

The following was filed automatically by anaconda:
anaconda 27.20.4-1 exception report
Traceback (most recent call first):
  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 824, in wrapped
    raise transform[1](msg)
  File "/usr/lib/python3.6/site-packages/blivet/formats/swap.py", line 165, in _setup
    blockdev.swap.swapon(self.device, priority=self.priority)
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 45, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/formats/__init__.py", line 604, in setup
    self._setup(**kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 45, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/osinstall.py", line 574, in turn_on_swap
    device.format.setup()
  File "/usr/lib/python3.6/site-packages/blivet/blivet.py", line 1479, in turn_on_swap
    self.fsset.turn_on_swap(root_path=get_sysroot())
  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 45, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/blivet/osinstall.py", line 1119, in turn_on_filesystems
    storage.turn_on_swap()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 438, in run_task
    self._task(*self._task_args, **self._task_kwargs)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 472, in start
    self.run_task()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 366, in doInstall
    installation_queue.start()
  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 252, in run
    threading.Thread.run(self)
gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.

Additional info:
addons:         com_redhat_kdump
blivet-gui-utils.log: 
cmdline:        /usr/libexec/system-python  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-base
cmdline_file:   BOOT_IMAGE=vmlinuz initrd=initrd.img root=live:CDLABEL=Fedora-WS-Live-27-1-6 rd.live.image quiet
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         4.13.9-300.fc27.x86_64
other involved packages: python3-blockdev-2.12-1.fc27.x86_64, python3-blivet-2.1.11-3.fc27.noarch, python3-libs-3.6.2-13.fc27.x86_64
product:        Fedora
release:        Fedora release 27 (Twenty Seven)
type:           anaconda
version:        27

Comment 1 Koumb 2018-04-29 19:52:18 UTC
Created attachment 1428545 [details]
File: anaconda-tb

Comment 2 Koumb 2018-04-29 19:52:22 UTC
Created attachment 1428546 [details]
File: anaconda.log

Comment 3 Koumb 2018-04-29 19:52:24 UTC
Created attachment 1428547 [details]
File: environ

Comment 4 Koumb 2018-04-29 19:52:40 UTC
Created attachment 1428548 [details]
File: journalctl

Comment 5 Koumb 2018-04-29 19:52:42 UTC
Created attachment 1428549 [details]
File: lsblk_output

Comment 6 Koumb 2018-04-29 19:52:45 UTC
Created attachment 1428550 [details]
File: lvm.log

Comment 7 Koumb 2018-04-29 19:52:47 UTC
Created attachment 1428551 [details]
File: nmcli_dev_list

Comment 8 Koumb 2018-04-29 19:52:49 UTC
Created attachment 1428552 [details]
File: os_info

Comment 9 Koumb 2018-04-29 19:53:01 UTC
Created attachment 1428553 [details]
File: program.log

Comment 10 Koumb 2018-04-29 19:53:16 UTC
Created attachment 1428554 [details]
File: storage.log

Comment 11 Koumb 2018-04-29 19:53:18 UTC
Created attachment 1428555 [details]
File: ifcfg.log

Comment 12 Jiri Konecny 2018-05-02 08:45:53 UTC
Based on the traceback this looks like an issue in our storage library. Changing component.

Comment 13 Vratislav Podzimek 2018-09-28 13:34:55 UTC
Is this issue reproducible? It's really weird because it is failing to activate swap that was created with mkswap right before.

Comment 14 Robert Richter (Marvell) 2018-09-28 14:33:33 UTC
(In reply to Vratislav Podzimek from comment #13)
> Is this issue reproducible? It's really weird because it is failing to
> activate swap that was created with mkswap right before.

I think in my case there is another existing swap partition that fails being activated, RHEL-7.6 is working fine in the same setup.

Comment 15 Vratislav Podzimek 2018-09-28 14:45:26 UTC
(In reply to Robert Richter from comment #14)
> (In reply to Vratislav Podzimek from comment #13)
> > Is this issue reproducible? It's really weird because it is failing to
> > activate swap that was created with mkswap right before.
> 
> I think in my case there is another existing swap partition that fails being
> activated, RHEL-7.6 is working fine in the same setup.

Could you please attach the first 2048 bytes of that partition? Does 'blkid /dev/YOUR_PARTITION' recognize it as swap?

Comment 16 Robert Richter (Marvell) 2018-10-01 09:04:17 UTC
[anaconda root@localhost ~]# parted /dev/sda print free
Model: ATA INTEL SSDSC2BB24 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name                  Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  1075MB  1074MB  fat32           EFI System Partition  boot, esp
 2      1075MB  22.5GB  21.5GB  ext4            primary
 8      22.5GB  44.0GB  21.5GB  ext4
 9      44.0GB  45.1GB  1074MB  xfs                                   msftdata
10      45.1GB  47.2GB  2149MB  linux-swap(v1)                        swap
11      47.2GB  65.5GB  18.3GB  xfs                                   msftdata
12      65.5GB  87.0GB  21.5GB  ext4
13      87.0GB  88.0GB  1074MB  xfs
14      88.0GB  90.2GB  2149MB  linux-swap(v1)                        swap
15      90.2GB  108GB   18.3GB  xfs
 3      108GB   216GB   107GB                   primary               msftdata
 4      216GB   217GB   1074MB  ext4
 5      217GB   219GB   2382MB                                        swap
 6      219GB   235GB   16.1GB  xfs
 7      235GB   240GB   4672MB                  primare

[anaconda root@localhost ~]# blkid /dev/sda5
/dev/sda5: UUID="ba1ed1a7-b3e7-4ac3-9672-4e96a66bc247" TYPE="swap" PARTUUID="1b1a333b-8153-4478-a57b-953edf4c3cb8"

[anaconda root@localhost ~]# blkid /dev/sda10
/dev/sda10: UUID="86a58d82-f07f-4779-8036-db9feac0a030" TYPE="swap" PARTUUID="c6f3e6ed-b55d-4e2a-8f11-d067a0be00b9"

[anaconda root@localhost ~]# blkid /dev/sda14
/dev/sda14: UUID="0b72db53-713d-485c-9a42-49bf1fdcc6b8" TYPE="swap" PARTUUID="cbde0046-76e5-4c0f-a23b-e2e686c851d3"

Comment 17 Robert Richter (Marvell) 2018-10-01 09:12:19 UTC
From storage.log:

12:29:05,731 DBG blivet:                PartitionDevice.setup: sda10 ; orig: False ; status: True ; controllable: True ;
12:29:05,734 DBG blivet:                SwapSpace.setup: device: /dev/sda10 ; type: swap ; status: False ;
12:29:05,737 DBG blivet:                  SwapSpace._setup: device: /dev/sda10 ; type: swap ; status: False ;
12:29:05,749 DBG blivet:                PartitionDevice.setup: sda14 ; orig: False ; status: True ; controllable: True ;
12:29:05,751 DBG blivet:                SwapSpace.setup: device: /dev/sda14 ; type: swap ; status: False ;
12:29:05,754 DBG blivet:                  SwapSpace._setup: device: /dev/sda14 ; type: swap ; status: False ;
12:29:05,756 DBG blivet:                PartitionDevice.setup: sda5 ; orig: False ; status: True ; controllable: True ;
12:29:05,759 DBG blivet:                SwapSpace.setup: device: /dev/sda5 ; type: swap ; status: False ;
12:29:05,762 DBG blivet:                  SwapSpace._setup: device: /dev/sda5 ; type: swap ; status: False ;

From anaconda.log:

12:28:54,591 INF installation: Task started: Activate filesystems (5/18)
12:29:01,820 INF progress: Creating swap on /dev/sda14
12:29:02,850 INF progress: Creating xfs on /dev/sda15
12:29:04,889 INF progress: Creating xfs on /dev/sda13
12:29:05,527 INF storage: setting boot flag on sda1
12:29:05,531 INF storage: Setting label on existing 1024 MiB partition sda1 (602) with existing efi filesystem mounted at /boot/efi to 'EFI System Partition'
12:29:05,762 INF threading: Thread Failed: AnaInstallThread (281472810545632)
12:29:05,763 DBG exception: running handleException
12:29:05,764 CRT exception: Traceback (most recent call last):

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 967, in wrapped
    ret = orig_obj(*args, **kwargs)

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 712, in swap_swapon
    return _swap_swapon(device, priority)

GLib.GError: g-bd-swap-error-quark: Unknown swap space format, cannot activate. (1)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 286, in run
    threading.Thread.run(self)

  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 375, in doInstall
    installation_queue.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 472, in start
    self.run_task()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 438, in run_task
    self._task(*self._task_args, **self._task_kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 2190, in turn_on_filesystems
    storage.turn_on_swap()

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 2035, in turn_on_swap
    self.fsset.turn_on_swap(root_path=util.getSysroot())

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 683, in turn_on_swap
    device.format.setup()

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/formats/__init__.py", line 606, in setup
    self._setup(**kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/formats/swap.py", line 165, in _setup
    blockdev.swap.swapon(self.device, priority=self.priority)

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 993, in wrapped
    raise transform[1](msg)

gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.

12:29:06,343 DBG exception: Gtk cannot be initialized
12:29:06,344 DBG exception: In a non-main thread, sending a message with exception data
12:29:06,344 DBG simpleline: New signal ExceptionSignal enqueued with source ScreenScheduler
12:29:06,345 INF threading: Thread Done: AnaInstallThread (281472810545632)
12:29:06,890 DBG simpleline: Executing inner loop
12:29:06,891 DBG simpleline: New signal ExceptionSignal enqueued with source ScreenScheduler
12:29:06,891 ERR ui.tui: 
======= Screen stack =======
----------- TOP ------------
ScreenData(ProgressSpoke,None,False)
============================

12:29:06,892 DBG exception: running handleException
12:29:06,893 CRT exception: Traceback (most recent call last):

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 967, in wrapped
    ret = orig_obj(*args, **kwargs)

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 712, in swap_swapon
    return _swap_swapon(device, priority)

GLib.GError: g-bd-swap-error-quark: Unknown swap space format, cannot activate. (1)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 286, in run
    threading.Thread.run(self)

  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 375, in doInstall
    installation_queue.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 472, in start
    self.run_task()

  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 438, in run_task
    self._task(*self._task_args, **self._task_kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 2190, in turn_on_filesystems
    storage.turn_on_swap()

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 2035, in turn_on_swap
    self.fsset.turn_on_swap(root_path=util.getSysroot())

  File "/usr/lib64/python3.6/site-packages/pyanaconda/storage/osinstall.py", line 683, in turn_on_swap
    device.format.setup()

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/formats/__init__.py", line 606, in setup
    self._setup(**kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)

  File "/usr/lib/python3.6/site-packages/blivet/formats/swap.py", line 165, in _setup
    blockdev.swap.swapon(self.device, priority=self.priority)

  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 993, in wrapped
    raise transform[1](msg)

gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.

12:29:06,894 DBG exception: Gtk cannot be initialized
12:29:06,894 DBG exception: In the main thread, running exception handler
12:29:20,254 INF core.util: Running kickstart %%onerror script(s)
12:29:20,256 INF core.util: All kickstart %%onerror script(s) have been run
12:29:20,256 INF kickstart.script: Running kickstart %%traceback script(s)
12:29:20,257 INF kickstart.script: All kickstart %%traceback script(s) have been run

Comment 18 Robert Richter (Marvell) 2018-10-01 09:15:26 UTC
Package versions:

python3-blockdev-2.19-3.el8.aarch64
python3-blivet-3.1.0-3.el8.noarch

Comment 19 Vratislav Podzimek 2018-10-01 09:24:29 UTC
Created attachment 1488973 [details]
script to activate swap device with libblockdev

Thanks for the data Robert! Could you please try to deactivate the problematic swap device (the one that failed to activate for you) and then activate it with the script I just attached like:

  sudo python3 bd_swapon.py /dev/YOUR_DEVICE

Please note that you need to have the 'python3-blockdev' and 'libblockdev-swap' packages installed.

Thanks!

Comment 20 Robert Richter (Marvell) 2018-10-01 09:38:03 UTC
+ dd bs=2048 count=1 if=/dev/sda5
+ hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400 0001 0000 dfff 0008 0000 0000 1eba a7d1
0000410 e7b3 c34a 7296 964e 6ba6 47c2 0000 0000
0000420 0000 0000 0000 0000 0000 0000 0000 0000
*
0000800
+ dd bs=2048 count=1 if=/dev/sda10
+ hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400 0001 0000 800f 0000 0000 0000 a586 828d
0000410 7ff0 7947 3680 9fdb c0ea 30a0 0000 0000
0000420 0000 0000 0000 0000 0000 0000 0000 0000
*
0000800
+ dd bs=2048 count=1 if=/dev/sda14
+ hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400 0001 0000 800f 0000 0000 0000 720b 53db
0000410 3d71 5c48 429a bf49 dc1f b8c6 0000 0000
0000420 0000 0000 0000 0000 0000 0000 0000 0000
*
0000800

Comment 21 Vratislav Podzimek 2018-10-01 09:41:22 UTC
Oh, sorry, Robert, we actually need to see the first `getconf PAGESIZE` (probably 4096) bytes on those devices.

Comment 22 Vratislav Podzimek 2018-10-01 09:42:24 UTC
(In reply to Vratislav Podzimek from comment #21)
> Oh, sorry, Robert, we actually need to see the first `getconf PAGESIZE`
> (probably 4096) bytes on those devices.

And if you use 'od -c' instead of 'hexdump', you should see:

0007760  \0  \0  \0  \0  \0  \0   S   W   A   P   S   P   A   C   E   2

Comment 23 Robert Richter (Marvell) 2018-10-01 10:55:32 UTC
Right, swap on /dev/sda5 is failing:

[anaconda root@localhost ~]# cat /proc/swaps
Filename                                Type            Size    Used    Priority
[anaconda root@localhost ~]# python3 bd_swapon.py /dev/sda5
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 967, in wrapped

    ret = orig_obj(*args, **kwargs)
  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 712, in swap_swapon

    return _swap_swapon(device, priority)
GLib.Error: g-bd-swap-error-quark: Unknown swap space format, cannot activate. (1)


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "bd_swapon.py", line 14, in <module>
    BlockDev.swap.swapon(device)
  File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 993, in wrapped

    raise transform[1](msg)  
gi.overrides.BlockDev.SwapError: Unknown swap space format, cannot activate.
[anaconda root@localhost ~]# python3 bd_swapon.py /dev/sda10
Swap on /dev/sda10 activated successfully
[anaconda root@localhost ~]# python3 bd_swapon.py /dev/sda14
Swap on /dev/sda14 activated successfully
[anaconda root@localhost ~]# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/sda10                              partition       2098112 0       -2
/dev/sda14                              partition       2098112 0       -3

Comment 24 Robert Richter (Marvell) 2018-10-01 10:56:25 UTC
Here is the problem, the failing cache was initialized with a different page size:

[anaconda root@localhost ~]# swapon /dev/sda5 
swapon: /dev/sda5: swap format pagesize does not match. (Use --fixpgsz to reinitialize it.)

swapon: /dev/sda5: swapon failed: Invalid argument
[anaconda root@localhost ~]# swapon --fixpgsz /dev/sda5 
swapon: /dev/sda5: swap format pagesize does not match.
swapon: /dev/sda5: reinitializing the swap.
mkswap: /dev/sda5: warning: wiping old swap signature.
Setting up swapspace version 1, size = 2.2 GiB (2382299136 bytes)
no label, UUID=ba1ed1a7-b3e7-4ac3-9672-4e96a66bc247
[anaconda root@localhost ~]# cat /proc/swaps 
Filename                                Type            Size    Used    Priority
/dev/sda10                              partition       2098112 0       -2
/dev/sda14                              partition       2098112 0       -3
/dev/sda5                               partition       2326464 0       -4
[anaconda root@localhost ~]# swapoff /dev/sda5
[anaconda root@localhost ~]# python3 bd_swapon.py /dev/sda5
Swap on /dev/sda5 activated successfully

Comment 25 Vratislav Podzimek 2018-10-01 11:07:46 UTC
Great work, Robert! Thanks a lot for this debugging!

Comment 26 Vratislav Podzimek 2018-10-01 11:10:01 UTC
What I still don't understand, though, is how could the 'mkswap' command shortly before the 'swapon' attempt create a format with non-matching pagesize.

Comment 27 Robert Richter (Marvell) 2018-10-01 11:19:18 UTC
(In reply to Vratislav Podzimek from comment #26)
> What I still don't understand, though, is how could the 'mkswap' command
> shortly before the 'swapon' attempt create a format with non-matching
> pagesize.

The other swap was used/created by another installation with a 4k page size kernel. It was already existing when starting the installation (I chose to install in free space).

Comment 28 Robert Richter (Marvell) 2018-10-01 11:39:59 UTC
(In reply to Robert Richter from comment #24)
> [anaconda root@localhost ~]# swapon --fixpgsz /dev/sda5 
> swapon: /dev/sda5: swap format pagesize does not match.
> swapon: /dev/sda5: reinitializing the swap.
> mkswap: /dev/sda5: warning: wiping old swap signature.
> Setting up swapspace version 1, size = 2.2 GiB (2382299136 bytes)
> no label, UUID=ba1ed1a7-b3e7-4ac3-9672-4e96a66bc247

Fixing the swap's page size made anaconda work.

Comment 29 Robert Richter (Marvell) 2018-10-01 11:46:23 UTC
Btw, I also noticed anaconda failing, if a swap is already enabled:

---
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 304, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 375, in doInstall
    installation_queue.start()
  File "/usr/lib64/python3.6/threading.py", line 864, in run                   
    self._target(*self._args, **self._kwargs)                                  
  File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 286, in run
    threading.Thread.run(self)
gi.overrides.BlockDev.SwapError: Failed to activate swap on /dev/sda10: Device or resource busy

What do you want to do now?
1) Report Bug
2) Debug
3) Run shell
4) Quit

Please make your choice from above:
----

I noticed that when continuing the installation after I enabled the swap in the shell already.

Comment 30 Vratislav Podzimek 2018-10-02 08:52:12 UTC
(In reply to Robert Richter from comment #29)
> Btw, I also noticed anaconda failing, if a swap is already enabled:
> ...
> I noticed that when continuing the installation after I enabled the swap in
> the shell already.

This is expected or I should say "not supported". Whenever you modify the storage state you need to trigger a rescan in anaconda. Otherwise it assumes the storage is still in the same state as it was in when anaconda probed it.

Comment 31 Vratislav Podzimek 2018-10-02 08:56:34 UTC
vtrefny submitted a PR that should at least result in nicer/more precise error messages in the future:
https://github.com/storaged-project/libblockdev/pull/404

Other than that I don't think anything else should be done here. This falls down into the "anaconda/blivet tears down and fails to setup devices it doesn't fully understand" category. In this particular case, the old swap device (not formatted in the installation process) should have not been touched by anaconda/blivet at all.

Assigning this to vtrefny, I think this should be closed once the above PR is merged and the changes from it propagated to Fedora.

Comment 32 Robert Richter (Marvell) 2018-10-02 10:13:42 UTC
(In reply to Vratislav Podzimek from comment #31)
> Other than that I don't think anything else should be done here. This falls
> down into the "anaconda/blivet tears down and fails to setup devices it
> doesn't fully understand" category. In this particular case, the old swap
> device (not formatted in the installation process) should have not been
> touched by anaconda/blivet at all.

Vratislav, I did some research in why it did not fail in RHEL7:

Code in RHEL8:

https://github.com/rhinstaller/anaconda.git
b76e72bbdaf0 New version - 29.19.0.14
pyanaconda/storage/osinstall.py:turn_on_swap()
https://github.com/rhinstaller/anaconda/blob/b76e72bbdaf0a5b9b1d51195c01ae24920b36ec2/pyanaconda/storage/osinstall.py#L664

Code in RHEL7:

https://github.com/storaged-project/blivet.git
ba6b6ccb784d New version: 0.61.15.72
blivet/__init__.py:turnOnSwap()
https://github.com/storaged-project/blivet/blob/ba6b6ccb784df605a64f1fe8b5c9646be330ce89/blivet/__init__.py#L2640

The difference is in the exception handler. In RHEL7 the device is *skipped* on errors when enabling the swap:

 https://github.com/storaged-project/blivet/blob/ba6b6ccb784df605a64f1fe8b5c9646be330ce89/blivet/__init__.py#L2663

This is missing in RHEL8, instead an exception is thrown.

I think we need to restore the RHEL7 exception handling to be less strict when enabling swap devices. This needs to be changed in the anaconda package. It should be something like:

commit b5c02df8b86616f1c5e7aa51aa30a0e7ed39ecd7
Author: Brian C. Lane <bcl>
Date:   Thu May 12 09:09:38 2016 -0700

    Ignore errors activating unknown swap partitions (#1330763)

https://github.com/storaged-project/blivet/commit/b5c02df8b86616f1c5e7aa51aa30a0e7ed39ecd7

This fix never made it into the master branch.

Comment 33 Vratislav Podzimek 2018-10-02 12:48:08 UTC
Another piece of outstanding work, Robert! Could you please create a separate bug report for anaconda for the above issue? It must have been some error in backporting (policies) that caused that commit to never make it to master. Thanks!

Comment 34 Robert Richter (Marvell) 2018-10-02 13:11:55 UTC
(In reply to Vratislav Podzimek from comment #33)
> Another piece of outstanding work, Robert! Could you please create a
> separate bug report for anaconda for the above issue? It must have been some
> error in backporting (policies) that caused that commit to never make it to
> master. Thanks!

I have filed bug 1635252.

Thanks for your support.

Comment 35 Ben Cotton 2018-11-27 13:41:51 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 36 Ben Cotton 2018-11-30 23:36:52 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.