ZFS receive error

trying to clone a zfs file system on the same system using

zfs send -r root/branch@snapshot |zfs receive root/newbranch

and get the following error

:parent does not exist.

How do I fix this?

It is telling you this object

root/branch@snapshot 

is from a filesystem with no parent e.g. / - the root directory. You cannot "fix" it AFAIK.

There are workarounds like clone.

zfs snapshot root/branch@snapshot  zfs clone root/branch@snapshot root/newbranch/

This copies the whole dataset from root/branch to root/newbranch # -> root/newbranch is the new dataset