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?
mirzak
October 11, 2019, 1:21pm
2
Which version of the Mender client? What does ls -alh /var/lib
give you?
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
mirzak
October 11, 2019, 1:39pm
4
Why is the client version dirty? For this reason it is hard to comment.
Looking at the code,
if os.IsNotExist(err) {
// Create data directory if it does not exist.
err = os.MkdirAll(*opts.dataStore, 0700)
if err != nil {
return nil, err
}
} else if err != nil {
return nil, errors.Wrapf(err, "Could not stat data directory: %s", *opts.dataStore)
} else if !stat.IsDir() {
return nil, errors.Errorf("%s is not a directory", *opts.dataStore)
}
I can not determinate why it would fail here. Do you have the correct permissions? Multiple clients running?
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?
mirzak
October 11, 2019, 1:52pm
6
Does the /data/mender
directory exist?
1 Like
mirzak
October 11, 2019, 2:12pm
7
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?
1 Like
ajithpv
October 12, 2019, 10:11am
8
My bad, somehow, the /data/mender
directory didn’t populated on the build which I used. This is the reason for the mentioned error