Notfound rbd image will induce rbd-target-api restart failed
- Dominant language
- Python
- Stars
- 68
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
Image not found like below:

Log when restart:
8月 03 03:38:33 kevin-focal-dev-1 systemd[1]: Started Ceph iscsi target configuration API.
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Started the configuration object watcher
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Checking for config object changes every 1s
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Processing osd blacklist entries for this node
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Reading the configuration object to update local LIO configuration
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Processing Gateway configuration
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Setting up iqn.1993-08.org.opendev:01:a9aa4032d2c1
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: No available network portal for target with iqn of 'iqn.1993-08.org.opendev:01:a9aa4032d2c1'
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: (Gateway.load_config) successfully loaded existing target definition
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Processing LUN configuration
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: Traceback (most recent call last):
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/bin/rbd-target-api", line 2952, in
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: main()
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/bin/rbd-target-api", line 2867, in main
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: ceph_gw.define()
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/lib/python3/dist-packages/ceph_iscsi_config/gateway.py", line 242, in define
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: self.define_targets()
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/lib/python3/dist-packages/ceph_iscsi_config/gateway.py", line 215, in define_targets
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: target = self.define_target(iqn, target.get('ip_list', {}))
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/lib/python3/dist-packages/ceph_iscsi_config/gateway.py", line 180, in define_target
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: LUN.define_luns(self.logger, self.config, target)
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "/usr/lib/python3/dist-packages/ceph_iscsi_config/lun.py", line 1234, in define_luns
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: with rbd.Image(ioctx, image_name) as rbd_image:
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: File "rbd.pyx", line 3376, in rbd.Image.__init__
8月 03 03:38:34 kevin-focal-dev-1 rbd-target-api[131120]: rbd.ImageNotFound: [errno 2] RBD image not found (error opening image b'volume-32cc58ee-c11d-4ea0-9e66-059538f2afa8' at snapshot None)
8月 03 03:38:34 kevin-focal-dev-1 systemd[1]: rbd-target-api.service: Main process exited, code=exited, status=1/FAILURE
8月 03 03:38:34 kevin-focal-dev-1 systemd[1]: rbd-target-api.service: Failed with result 'exit-code'.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in ceph_iscsi_config/lun.py at LUN.define_luns, where the traceback shows rbd.Image opening the missing image. Read the callers in gateway.py and the rbd-target-api define flow to determine the expected behavior for a missing RBD image, then reproduce the restart failure and verify that the service handles this case without exiting unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100