# What does "ERRO\[0000\] mkdir /var/lib/mender: file exists module=main" means?

**URL:** <https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145>\
**Category:** General Discussions\
**Tags:** yocto, sumo, nxp, standalone\
**Created:** [October 11, 2019, 1:04pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145 "2019-10-11T13:04:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [October 11, 2019, 1:04pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/1 "2019-10-11T13:04:28Z")

</div>

Hi,  
I’m trying to perform standalone mender update from a USB Pendrive.

I have put the \* .mender artifact inside the Pendrive and run the below command:  
`mender -debug -install /run/media/sda1/*.mender`

But, I’m getting the below error:  
`ERRO[0000] mkdir /var/lib/mender: file exists module=main`

Could you please let me know what this error means?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 11, 2019, 1:21pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/2 "2019-10-11T13:21:11Z")

</div>

Which version of the Mender client? What does `ls -alh /var/lib` give you?

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [October 11, 2019, 1:30pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/3 "2019-10-11T13:30:12Z")

</div>

The **client version** :  
$ mender -version  
**2.0.0-dirty**  
runtime: go1.9.7

```
ls -alh /var/lib 
drwxr-xr-x 10 root root 220 Oct 11 12:41 .
drwxr-xr-x 8 root root 1.0K Jan 1 1970 ..
drwxr-xr-x 2 messageb messageb 60 Oct 11 12:41 dbus
drwxr-xr-x 2 root root 40 Oct 11 12:36 dnf
drwx------ 2 root root 40 Oct 11 12:41 machines
lrwxrwxrwx 1 root root 12 Oct 11 12:41 mender -> /data/mender
drwxr-xr-x 2 root root 40 Sep 18 10:14 misc
drwx------ 3 root root 60 Oct 11 12:41 private
drwxr-xr-x 2 root root 440 Jan 1 1970 rpm
drwx--x--x 3 root root 60 Jan 1 1970 sudo
drwxr-xr-x 3 root root 100 Oct 11 12:41 systemd
```

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 11, 2019, 1:39pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/4 "2019-10-11T13:39:04Z")

</div>

Why is the client version dirty? For this reason it is hard to comment.

Looking at the code,

> <https://github.com/mendersoftware/mender/blob/94c3e21c829ba3033017c99d69bb0bd5a5574070/main.go#L360-L370>

I can not determinate why it would fail here. Do you have the correct permissions? Multiple clients running?

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [October 11, 2019, 1:50pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/5 "2019-10-11T13:50:42Z")

</div>

Thank you @mirzak for your reply.  
I’m using `sources/meta-mender/meta-mender-core/recipes-mender/mender/mender_2.0.0.bb` with `SRC_URI = "git://github.com/mendersoftware/mender;protocol=https;branch=2.0.x"`. Even I don’t know why the `dirty` is coming at the end of the 2.0.0 version! Is there any reason for it?

Regarding the permission, I’m using a read-only file system and only one client is running on the target platform. Whether it will work on a read-only file system? 🤔

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 11, 2019, 1:52pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/6 "2019-10-11T13:52:56Z")

</div>

Does the `/data/mender` directory exist?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 11, 2019, 2:12pm UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/7 "2019-10-11T14:12:02Z")

</div>

> [@ajithpv](#):
>
> Regarding the permission, I’m using a read-only file system

I do not think that this should matter, because `/data` should be a mount point to a separate partition that should not be `read-only`. Or this not the case?

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [October 12, 2019, 10:11am UTC](https://hub.mender.io/t/what-does-erro-0000-mkdir-var-lib-mender-file-exists-module-main-means/1145/8 "2019-10-12T10:11:04Z")

</div>

My bad, somehow, the `/data/mender` directory didn’t populated on the build which I used. This is the reason for the mentioned error 🤐
