Bug 2388201

Summary: pyanaconda.modules.common.errors.installation.StorageInstallationError: Process reported exit code 1: mdadm: Unable to initialize sysfs
Product: [Fedora] Fedora Reporter: lnie <lnie>
Component: mdadmAssignee: Jonathan Wright <jonathan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 43CC: agk, anaconda-maint, awilliam, jes.sorensen, jonathan, kkoukiou, lnie, w, xni
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:8b5c62c41046e2921c10861b95a9f5721b41f3fc224cc13e0cf231da24212a15;VARIANT_ID=server; AcceptedBlocker
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-08-27 06:43:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2324223    
Attachments:
Description Flags
File: anaconda-tb
none
File: backtrace
none
File: os_info
none
File: environ
none
File: syslog
none
File: description
none
File: storage.log
none
File: packaging.log
none
File: program.log
none
File: nmcli_dev_list
none
File: anaconda.log
none
File: lorax-packages.log
none
File: lsblk_output
none
File: dbus.log
none
File: packaging.log
none
screenshot
none
diff none

Description lnie 2025-08-13 10:45:32 UTC
Version-Release number of selected component:
anaconda-43.34


The following was filed automatically by anaconda:
anaconda 43.34 exception report
Traceback (most recent call first):
  File "/usr/lib/python3.14/site-packages/dasbus/client/handler.py", line 509, in _handle_method_error
    raise exception from None
  File "/usr/lib/python3.14/site-packages/dasbus/client/handler.py", line 483, in _get_method_reply
    return self._handle_method_error(error)
  File "/usr/lib/python3.14/site-packages/dasbus/client/handler.py", line 450, in _call_method
    return self._get_method_reply(
  File "/usr/lib64/python3.14/site-packages/pyanaconda/ui/gui/spokes/installation_progress.py", line 76, in _on_installation_done
    self._task_proxy.Finish()
  File "/usr/lib/python3.14/site-packages/dasbus/signal.py", line 53, in emit
    callback(*args, **kwargs)
  File "/usr/lib/python3.14/site-packages/dasbus/client/handler.py", line 365, in _signal_callback
    callback(*unwrap_variant(parameters))
  File "/usr/lib/python3.14/site-packages/dasbus/client/handler.py", line 133, in _signal_callback
    callback(parameters, *callback_args)
pyanaconda.modules.common.errors.installation.StorageInstallationError: Process reported exit code 1: mdadm: Unable to initialize sysfs

Additional info:
cmdline:        /usr/bin/python3  /usr/bin/anaconda
executable:     /usr/bin/anaconda
hashmarkername: anaconda
product:        Fedora
reason:         pyanaconda.modules.common.errors.installation.StorageInstallationError: Process reported exit code 1: mdadm: Unable to initialize sysfs
package:        anaconda-43.34
release_type:   pre-release
type:           anaconda
release:        Fedora release 43 (Forty Three)
cmdline_file:   BOOT_IMAGE=/images/pxeboot/vmlinuz inst.stage2=hd:LABEL=Fedora-S-dvd-x86_64-43 rd.live.check quiet
addons:         com_redhat_kdump
kernel:         6.17.0-0.rc1.17.fc43.x86_64
version:        43

Comment 1 lnie 2025-08-13 10:47:53 UTC
Created attachment 2103444 [details]
File: anaconda-tb

Comment 2 lnie 2025-08-13 10:50:13 UTC
Created attachment 2103445 [details]
File: backtrace

Comment 3 lnie 2025-08-13 10:52:34 UTC
Created attachment 2103446 [details]
File: os_info

Comment 4 lnie 2025-08-13 10:52:37 UTC
Created attachment 2103447 [details]
File: environ

Comment 5 lnie 2025-08-13 10:54:58 UTC
Created attachment 2103448 [details]
File: syslog

Comment 6 lnie 2025-08-13 10:55:01 UTC
Created attachment 2103449 [details]
File: description

Comment 7 lnie 2025-08-13 10:57:20 UTC
Created attachment 2103450 [details]
File: storage.log

Comment 8 lnie 2025-08-13 10:59:39 UTC
Created attachment 2103451 [details]
File: packaging.log

Comment 9 lnie 2025-08-13 11:00:48 UTC
Here is the patch, to fix this crash, generated by cursor, I'm not good at c, but it looks like a valid fix:

-       if (stat(fname, &stb))
-               goto out;
-       if (!S_ISDIR(stb.st_mode))
-               goto out;
-       strncpy(mdi->sys_name, devnm, sizeof(mdi->sys_name) - 1);
+       /* 
+        * In some cases (such as during device assembly), the kernel may need
+        * some time to create sysfs entries. We add a retry mechanism to handle
+        * this timing issue.
+        */
+       while (retry_count <= max_retries) {
+               if (stat(fname, &stb) == 0) {
+                       if (S_ISDIR(stb.st_mode)) {
+                               strncpy(mdi->sys_name, devnm, sizeof(mdi->sys_name) - 1);
+                               retval = 0;
+                               break;
+                       } else {
+                               /* Path exists but is not a directory, this is an error */
+                               goto out;
+                       }
+               }
+               
+               /* If first attempt fails, we record debug information */
+               if (retry_count == 0) {
+                       /* Don't print error here as this may be temporary during normal operation */
+               }
+               
+               /* If maximum retries reached, exit */
+               if (retry_count == max_retries)
+                       break;
+               
+               /* Wait for a while before retrying */
+               usleep(retry_delay_ms * 1000);
+               retry_count++;
+       }

-       retval = 0;
 out:
        return retval;
 }
--

Comment 10 lnie 2025-08-13 11:02:02 UTC
Created attachment 2103452 [details]
File: program.log

Comment 11 lnie 2025-08-13 11:04:20 UTC
Created attachment 2103453 [details]
File: nmcli_dev_list

Comment 12 lnie 2025-08-13 11:04:25 UTC
Created attachment 2103454 [details]
File: anaconda.log

Comment 13 lnie 2025-08-13 11:06:44 UTC
Created attachment 2103455 [details]
File: lorax-packages.log

Comment 14 lnie 2025-08-13 11:09:04 UTC
Created attachment 2103456 [details]
File: lsblk_output

Comment 15 lnie 2025-08-13 11:11:27 UTC
Created attachment 2103458 [details]
File: dbus.log

Comment 16 lnie 2025-08-13 11:11:38 UTC
Created attachment 2103459 [details]
File: packaging.log

Comment 17 lnie 2025-08-15 15:14:08 UTC
Created attachment 2103732 [details]
screenshot

Comment 18 lnie 2025-08-15 15:24:47 UTC
Forgot to mention the reproducor:

1)boot  Fedora-Server-dvd-x86_64-43-20250812.n.1.iso on a system with an existing raid, 
2)choose "blivet-gui" on installation destination page,  delete that raid device and create a new one ,
3)the error will happen immediately after storage configure progress starts.

As shown in the screenshot I just attached, this same error message will pop up when I tried to start a mdraid device on anaconda-webui

Comment 19 Fedora Blocker Bugs Application 2025-08-18 08:17:53 UTC
Proposed as a Blocker for 43-beta by Fedora user lnie using the blocker tracking app because:

 seems violates:
https://fedoraproject.org/wiki/Fedora_43_Beta_Release_Criteria#Custom_partitioning

Comment 20 Adam Williamson 2025-08-25 15:18:15 UTC
+6 in https://pagure.io/fedora-qa/blocker-review/issue/1872 , marking accepted (though it'd be nice if anyone else can confirm this; I'll see if I have time to try in a bit).

Comment 21 XiaoNi 2025-08-26 07:53:32 UTC
Hi Inie

Which file is it that the patch you mentioned in comment9? (what's the diff output)

Thanks
Xiao

Comment 22 lnie 2025-08-26 08:27:47 UTC
Created attachment 2104852 [details]
diff

Comment 23 lnie 2025-08-26 08:29:46 UTC
hi,

I uploaded the diff file just now.

Regards,
Lili

Comment 24 XiaoNi 2025-08-26 09:06:12 UTC
Hi Inie

This problem is same with https://bugzilla.redhat.com/show_bug.cgi?id=2388480. f43 already has a update to fix this.

Comment 25 XiaoNi 2025-08-26 09:08:02 UTC
The original bug is https://bugzilla.redhat.com/show_bug.cgi?id=2385871 which is aginst f44

Comment 26 Adam Williamson 2025-08-26 17:51:00 UTC
So this should be fixed in recent composes? lnie, can you re-test with the most recent F43 compose? Thanks.

Comment 27 lnie 2025-08-27 03:01:59 UTC
> lnie, can you re-test with the most recent F43 compose? Thanks.

Sure:)

check with Fedora-Server-dvd-x86_64-43-20250826.n.1.iso which contains mdadm-4.3-9.fc43, the issue is gone.

Comment 28 Adam Williamson 2025-08-27 06:43:57 UTC
Thanks for confirming.