summaryrefslogtreecommitdiff
path: root/doc/TROUBLESHOOTING.md
blob: dc9d1127d17b3aba0d3258bcf42a7a373c4abb10 (plain)
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
# Troubleshooting

## You cannot build from source

You run 

```console
glide install
go build 
```
And you get:

```console
Package libvirt was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvirt.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libvirt' found
pkg-config: exit status 1
```

You probably need libvirt-dev(el) package installed.

```console 
apt install libvirt-dev
```

## Bug in libvirt

There is a [bug in libvirt](https://bugzilla.redhat.com/show_bug.cgi?id=1293804) that seems to be causing
problems to unlink volumes. Tracked [here](https://github.com/dmacvicar/terraform-provider-libvirt/issues/6).

If you see something like:

```console
cannot unlink file '/var/lib/libvirt/images/XXXXXXXXXXXX': Permission denied
```

It is probably related and fixed in libvirt 1.3.3 (already available in openSUSE Tumbleweed).

## Selinux on Debian distros

On Debian distros SELinux is enforced by qemu even if it is disabled globally, this might cause unexpected `Could not open '/var/lib/libvirt/images/<FILE_NAME>': Permission denied` errors. 

Double check that `security_driver = "none"` is uncommented in `/etc/libvirt/qemu.conf` and issue `sudo systemctl restart libvirt-bin` to restart the daemon.


## cannot find the "context" package (when building from src)

When trying to build the pkg from source, you get cannot find package "context"

```console
go build
../../go/src/github.com/dmacvicar/terraform-provider-libvirt/vendor/github.com/hashicorp/terraform/terraform/context.go:4:2: cannot find package "context" in any of:
```

Install the latest golang version. 

https://github.com/hashicorp/terraform/issues/12470