ERROR: Storage error: cp failed: cp: cannot stat '/root/.chvm/vms/a2f897b3f599/rootfs.img/.': Not a directory #30

Closed
opened 2026-03-16 01:00:25 +00:00 by mahmoud · 1 comment
Owner

Bug

When a VM is stopped and then started again, chvm start-vm fails with:

   ERROR: Storage error: cp failed: cp: cannot stat '/root/.chvm/vms/<vm_id>/rootfs.img/.': Not a directory

Steps to reproduce

  1. Create a VM: chvm create-vm --id test --image ubuntu:latest --cpu 1 --mem 4096MB
  2. Start the VM: chvm start-vm --id test — works
  3. Stop the VM: chvm stop-vm --id test — works
  4. Start again: chvm start-vm --id testfails

Expected behavior

start-vm should start the existing VM without re-copying the rootfs image.

Actual behavior

The start-vm code path runs a cp command that appends /. to the rootfs.img file path, treating it as a directory:

   cp: cannot stat '/root/.chvm/vms/<vm_id>/rootfs.img/.': Not a directory

Environment

  • hero_compute_server calling chvm via chvm create-vm / chvm start-vm
  • VM was deployed with deploy_vm(slice_count=1), started, stopped, then start fails on retry

Workaround

Delete and redeploy the VM instead of stop+start cycling.

## Bug When a VM is stopped and then started again, `chvm start-vm` fails with: ``` ERROR: Storage error: cp failed: cp: cannot stat '/root/.chvm/vms/<vm_id>/rootfs.img/.': Not a directory ``` ## Steps to reproduce 1. Create a VM: `chvm create-vm --id test --image ubuntu:latest --cpu 1 --mem 4096MB` 2. Start the VM: `chvm start-vm --id test` — works 3. Stop the VM: `chvm stop-vm --id test` — works 4. Start again: `chvm start-vm --id test` — **fails** ## Expected behavior `start-vm` should start the existing VM without re-copying the rootfs image. ## Actual behavior The `start-vm` code path runs a `cp` command that appends `/.` to the `rootfs.img` file path, treating it as a directory: ``` cp: cannot stat '/root/.chvm/vms/<vm_id>/rootfs.img/.': Not a directory ``` ## Environment - hero_compute_server calling chvm via `chvm create-vm` / `chvm start-vm` - VM was deployed with `deploy_vm(slice_count=1)`, started, stopped, then start fails on retry ## Workaround Delete and redeploy the VM instead of stop+start cycling.
rawan self-assigned this 2026-03-16 08:06:49 +00:00
Member

Changes made:
1- skip re-creating the block image if it already exists
2- Remove stale API socket so a subsequent start doesn't get EADDRINUSE
3- added integration test to cover this part

Changes made: 1- skip re-creating the block image if it already exists 2- Remove stale API socket so a subsequent start doesn't get EADDRINUSE 3- added integration test to cover this part
rawan added this to the ACTIVE project 2026-03-16 10:05:39 +00:00
rawan closed this issue 2026-03-17 23:14:20 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_hypervisor#30
No description provided.