Skip to content

Commit

Permalink
Fix: Guest API would crash due to FileNotFound
Browse files Browse the repository at this point in the history
The parent directory on which the Guest APi listens did not exist in some context (probably Firecracker based instances), which crashed the process.

This ensures that the directories exist and that the Unix socket can therefore be created.
  • Loading branch information
hoh committed Mar 21, 2024
1 parent 4ba5c4f commit 79f8d0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aleph/vm/controllers/firecracker/executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,12 @@ async def load_configuration(self):
return

async def start_guest_api(self):
logger.debug(f"starting guest API for {self.vm_id}")
vsock_path = f"{self.fvm.vsock_path}_53"
vsock_path = Path(f"{self.fvm.vsock_path}_53")

# Ensure that the directory where the VSOCK socket will be created exists
vsock_path.parent.mkdir(parents=True, exist_ok=True)
logger.debug(f"starting guest API for {self.vm_id} on {vsock_path}")

vm_hash = self.vm_hash
self.guest_api_process = Process(
target=run_guest_api,
Expand Down

0 comments on commit 79f8d0e

Please sign in to comment.