<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brlin</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Brlin"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Brlin"/>
	<updated>2026-04-09T13:46:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=When_C/R_fails&amp;diff=5075</id>
		<title>When C/R fails</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=When_C/R_fails&amp;diff=5075"/>
		<updated>2020-08-03T09:25:56Z</updated>

		<summary type="html">&lt;p&gt;Brlin: /* Restore &amp;quot;by hand&amp;quot; */ Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is the collection of typical situations when checkpoint or restore fails.&lt;br /&gt;
&lt;br /&gt;
== PID mismatch on restore ==&lt;br /&gt;
&lt;br /&gt;
If you see one of these lines in the failed restore logs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Pid $number do not match expected $another_number&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Thread pid mismatch $number1/$number2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this means that while restoring a process tree, CRIU has failed to recreate a process (or a thread) with the PID (TID) value the proceess (thread) used to have on dump. Most likely, this is because the desired PID/TID is used by other task or thread. There are several possible solutions to this.&lt;br /&gt;
&lt;br /&gt;
=== Restore &amp;quot;by hand&amp;quot; ===&lt;br /&gt;
One way is to restore the images into a separate pid namespace. This can be done by using the &amp;lt;code&amp;gt;unshare -p -m --fork --mount-proc&amp;lt;/code&amp;gt; command and then doing the restore. In this case, you might also want to unshare the mount namespace and re-mount the /proc, so that the restored tasks can use it. This method effectively means restoring tasks in a container.&lt;br /&gt;
&lt;br /&gt;
Note, however, that the most correct way is to run the tasks you plan to checkpoint in the pid namespace (with /proc tune-up if required) from the very beginning.&lt;br /&gt;
&lt;br /&gt;
=== Kill the obstacle ===&lt;br /&gt;
Another solution to PID mismatch, which is not correct, but still efficient, is to kill the offending task :)&lt;br /&gt;
&lt;br /&gt;
=== With CRIU help ===&lt;br /&gt;
&lt;br /&gt;
There's a helper script called &amp;lt;code&amp;gt;criu-ns&amp;lt;/code&amp;gt; that does restore in pseudo-container and also can dump again the restored tree. For more details see the &amp;quot;[[CR in namespace]]&amp;quot; article.&lt;br /&gt;
&lt;br /&gt;
== Mount namespace with external dependences ==&lt;br /&gt;
&lt;br /&gt;
The dump-time error in logs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$nr:$path doesn't have a proper root mount&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
indicates that the container (or just mount namespace) being dumped has some external dependences. CRIU knows how to work with it, you just need to tell CRIU about [[external bind mounts]] you have.&lt;br /&gt;
&lt;br /&gt;
== External unix socket connection ==&lt;br /&gt;
&lt;br /&gt;
If an application has an open unix connection to the external world, the dump will fail with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Cannot dump half of a stream unix connection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case the socket should be explained as &amp;quot;OK to break&amp;quot; and reconnected back on restore. How to do it is described in [[external UNIX socket|here]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Using]]&lt;/div&gt;</summary>
		<author><name>Brlin</name></author>
	</entry>
</feed>