about summary refs log tree commit diff
path: root/doc/manual/troubleshooting.xml
blob: 3787ddcd93f5c31f203dcaaf1f85a650cd9aa04e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<appendix xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink">

<title>Troubleshooting</title>


<para>This section provides solutions for some common problems.</para>


<sect1><title>Berkeley DB: <quote>Cannot allocate memory</quote></title>

<para>Symptom: Nix operations (in particular the
<command>nix-store</command> operations <option>--gc</option>,
<option>--verify</option>, and <option>--clear-substitutes</option> —
the latter being called by <command>nix-channel --update</command>)
failing:

<screen>
$ nix-store --verify
error: Db::del: Cannot allocate memory</screen>

</para>

<para>Possible solution: make sure that no Nix processes are running,
then do:

<screen>
$ cd /nix/var/nix/db
$ rm __db.00*</screen>

</para>

</sect1>


<sect1><title>Collisions in <command>nix-env</command></title>

<para>Symptom: when installing or upgrading, you get an error message such as

<screen>
$ nix-env -i docbook-xml
...
adding /nix/store/s5hyxgm62gk2...-docbook-xml-4.2
collission between `/nix/store/s5hyxgm62gk2...-docbook-xml-4.2/xml/dtd/docbook/calstblx.dtd'
  and `/nix/store/06h377hr4b33...-docbook-xml-4.3/xml/dtd/docbook/calstblx.dtd'
  at /nix/store/...-builder.pl line 62.</screen>

</para>

<para>The cause is that two installed packages in the user environment
have overlapping filenames (e.g.,
<filename>xml/dtd/docbook/calstblx.dtd</filename>.  This usually
happens when you accidentally try to install two versions of the same
package.  For instance, in the example above, the Nix Packages
collection contains two versions of <literal>docbook-xml</literal>, so
<command>nix-env -i</command> will try to install both.  The default
user environment builder has no way to way to resolve such conflicts,
so it just gives up.</para>

<para>Solution: remove one of the offending packages from the user
environment (if already installed) using <command>nix-env
-e</command>, or specify exactly which version should be installed
(e.g., <literal>nix-env -i docbook-xml-4.2</literal>).</para>

<para>Alternatively, you can modify the user environment builder
script (in
<filename><replaceable>prefix</replaceable>/share/nix/corepkgs/buildenv/builder.pl</filename>)
to implement some conflict resolution policy.  E.g., the script could
be modified to rename conflicting file names, or to pick one over the
other.</para>

</sect1>


</appendix>