Bug 2230537

Summary: fdo-aio can't get started
Product: Red Hat Enterprise Linux 9 Reporter: Xiaofeng Wang <xiaofwan>
Component: fido-device-onboardAssignee: idiez
Status: POST --- QA Contact: Xiaofeng Wang <xiaofwan>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 9.3CC: idiez, mcattamo, miabbott, pwhalen, qzhang, yih
Target Milestone: rcKeywords: TestBlocker, Triaged
Target Release: 9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiaofeng Wang 2023-08-09 15:37:58 UTC
Description of problem:
Install fdo-aio service with dnf install fdo-admin-cli.
Start fdo-aio service with systemctl start fdo-aio
Got the following error:

$ sudo systemctl status fdo-aio
× fdo-aio.service - FDO service info API server
     Loaded: loaded (/usr/lib/systemd/system/fdo-aio.service; disabled; preset: disabled)
     Active: failed (Result: exit-code) since Wed 2023-08-09 10:10:16 EDT; 14s ago
   Duration: 8ms
    Process: 78766 ExecStart=/usr/bin/fdo-admin-tool aio --directory /etc/fdo/aio --binary-path /usr/libexec/fdo (code=exited, status=1/FAILURE)
   Main PID: 78766 (code=exited, status=1/FAILURE)
        CPU: 6ms

When install fdo-admin-tool, fdo-client and fdo-init are not installed as its dependency.

Version-Release number of selected component (if applicable):
fdo-admin-cli-0.4.12-1.el9_2.x86_64.rpm

How reproducible:

Steps to Reproduce:
1. Install fdo-aio service with dnf install fdo-admin-cli
2. Start fdo-aio service with systemctl start fdo-aio

Actual results:
service fdo-aio can't get started

Expected results:
service fdo-aio should start without error

Additional info:

Comment 2 Yi He 2023-08-10 02:19:13 UTC
I saw the same failure on fedora 38 when trying to start fdo-aio service. 

[fedora@yih-f38 osbuild-composer]$ systemctl status fdo-aio.service 
× fdo-aio.service - FDO service info API server
     Loaded: loaded (/usr/lib/systemd/system/fdo-aio.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Thu 2023-08-10 02:10:35 UTC; 1min 10s ago
   Duration: 7ms
    Process: 100717 ExecStart=/usr/bin/fdo-admin-tool aio --directory /etc/fdo/aio --binary-path /usr/libexec/fdo (code=exited, status=>
   Main PID: 100717 (code=exited, status=1/FAILURE)
        CPU: 6ms

Aug 10 02:10:35 yih-f38 systemd[1]: Started fdo-aio.service - FDO service info API server.
Aug 10 02:10:35 yih-f38 fdo-admin-tool[100717]: Error: Unable to find binaries for AIO
Aug 10 02:10:35 yih-f38 fdo-admin-tool[100717]: Caused by:
Aug 10 02:10:35 yih-f38 fdo-admin-tool[100717]:     Invalid binary path: "/usr/libexec/fdo"
Aug 10 02:10:35 yih-f38 systemd[1]: fdo-aio.service: Main process exited, code=exited, status=1/FAILURE
Aug 10 02:10:35 yih-f38 systemd[1]: fdo-aio.service: Failed with result 'exit-code'.


It seems the failure is caused by error "Invalid binary path: "/usr/libexec/fdo"", and I checked system and this path does exist. 

[fedora@yih-f38 fdo]$ ls /usr/libexec/fdo
fdo-admin-tool            fdo-owner-onboarding-server  fdo-rendezvous-server
fdo-manufacturing-server  fdo-owner-tool               fdo-serviceinfo-api-server

Comment 4 Yi He 2023-08-10 10:53:54 UTC
Verified fix https://github.com/fedora-iot/fido-device-onboard-rs/pull/541 on rhel9.3, fdo-aio-service can start.

Steps:
1. git clone -b spec-aio-fix https://github.com/7flying/fido-device-onboard-rs.git
2. run 'make rpm' to get rpm packages
3. install fdo-admin-cli and start fdo-aio-service
4. check fdo-aio-service status
[root@yih-rhel93 x86_64]# systemctl status fdo-aio.service
● fdo-aio.service - FDO service info API server
     Loaded: loaded (/usr/lib/systemd/system/fdo-aio.service; disabled; preset: disabled)
     Active: active (running) since Thu 2023-08-10 06:46:53 EDT; 5s ago
   Main PID: 300102 (fdo-admin-tool)
      Tasks: 26 (limit: 48616)
     Memory: 17.7M
        CPU: 81ms
     CGroup: /system.slice/fdo-aio.service
             ├─300102 /usr/bin/fdo-admin-tool aio --directory /etc/fdo/aio --binary-path /usr/libexec/fdo
             ├─300107 /usr/libexec/fdo/fdo-manufacturing-server
             ├─300108 /usr/libexec/fdo/fdo-owner-onboarding-server
             ├─300109 /usr/libexec/fdo/fdo-rendezvous-server
             └─300110 /usr/libexec/fdo/fdo-serviceinfo-api-server

Aug 10 06:46:53 yih-rhel93 systemd[1]: Started FDO service info API server.
Aug 10 06:46:53 yih-rhel93 fdo-admin-tool[300102]:  INFO  fdo_admin_tool::aio > AIO directory not configured, creating it with default >
Aug 10 06:46:53 yih-rhel93 fdo-admin-tool[300102]:  INFO  fdo_admin_tool::aio::execute > Starting AIO
Aug 10 06:46:53 yih-rhel93 fdo-admin-tool[300102]:  INFO  fdo_admin_tool::aio::execute > Waiting until services are ready
Aug 10 06:46:53 yih-rhel93 fdo-admin-tool[300102]:  INFO  fdo_admin_tool::aio::execute > All services are ready
Aug 10 06:46:53 yih-rhel93 fdo-admin-tool[300102]:  INFO  fdo_admin_tool::aio::execute > AIO running