Lxc snapshot --stateful

lxc snapshot u18-1 --stateful
Error: snapshot dump failed
(00.200409) Error (criu/sk-netlink.c:73): The socket has data to read
(00.200425) Error (criu/cr-dump.c:1352): Dump files (pid: 3315) failed with -1
(00.210423) Error (criu/cr-dump.c:1709): Dumping FAILED.

lxc snapshot u18-1

and than again:
lxc snapshot u18-1 --stateful

was succesfull. why? should I perform ordinary snapshot before --stateful?

It’s a race, the first snapshot failed because there was some data in some network socket, the second succeeded because there was no data at that time.

1 Like

ok, thanks. that is an explanation. how to resolve it?

Until there’s a kernel API that CRIU can use to read buffers with data, the only way around it is to just try the snapshot until it succeeds.