Beats 7

Miroslav Lachman 000.fbsd at quip.cz
Tue Mar 17 18:11:32 UTC 2020


Peter Ankerstål wrote on 2020/03/17 15:01:

>>> Oh, there it is.
>>> I tested it and there seems to be some problem with the post install:
>>> Installing beats7-7.6.1...
>>> pkg-static: Fail to create hardlink: /var/db/beats/filebeat/kibana/7/dashboard/.pkgtemp.Filebeat-Kafka-overview.json.67sFQiaemu2r:Cross-device link
>>> cp: /usr/local/etc/heartbeat.yml.sample: No such file or directory
>>> cp: /usr/local/etc/metricbeat.yml.sample: No such file or directory
>>> pkg-static: POST-INSTALL script failed
>>> *** Error code 70
>>
>> It's a strange error. What is your filesystem layout (partitions)? It seems the install is trying to hardlink file to a different partitions.
>>
> store/usr/ports                          13.9G  1.13T  7.45G  /usr/ports
> store/usr/ports/distfiles                1.57G  1.13T  1.57G  /usr/ports/distfiles
> store/usr/ports/packages                 28.8M  1.13T  28.5M  /usr/ports/packages

Those are not important, the important are /var and /usr partitions and 
their subpartitions. See below.

[...]

> I also tried to build a package and that seemed to work without any errors, but when I try to install that package it fails with:
> # pkg install beats7-7.6.1.txz
> Updating FreeBSD repository catalogue...
> FreeBSD repository is up to date.
> All repositories are up to date.
> Checking integrity... done (0 conflicting)
> The following 1 package(s) will be affected (of 0 checked):
> 
> New packages to be INSTALLED:
> 	beats7: 7.6.1
> 
> Number of packages to be installed: 1
> 
> The process will require 123 MiB more space.
> 
> Proceed with this action? [y/N]: y
> [1/1] Installing beats7-7.6.1...
> Extracting beats7-7.6.1:  93%
> pkg: Fail to create hardlink: /var/db/beats/filebeat/kibana/7/dashboard/.pkgtemp.Filebeat-Kafka-overview.json.iYNtuaUyNBLf:Cross-device link
> Extracting beats7-7.6.1: 100%

The problem here with "Fail to create hardlink" / "Cross-device link" is 
that you have /var and /usr as separate partitions while my testing jail 
is all on one filesystem. This (7.6.1) version of beats are installing 
Filebeat-Kafka-overview.json in to /usr/local and then trying to hard 
link it to /var/db/beats. And it failed for obvious reason.


(root at testjail) beats7/# make install
===>  Installing for beats7-7.6.1
===>  Checking if beats7 is already installed
===>   Registering installation for beats7-7.6.1
[testjail.codelab.cz] Installing beats7-7.6.1...


(root at testjail) beats7/# pkg info -l beats7-7.6.1 | grep Filebeat-Kafka
 
/usr/local/share/beats/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json
 
/var/db/beats/filebeat/kibana/7/dashboard/Filebeat-Kafka-overview.json


(root at testjail) beats7/# ls -lio 
/usr/local/share/beats/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json 
/var/db/beats/filebeat/kibana/7/dashboard/Filebeat-Kafka-overview.json
325792 -rw-r--r--  2 root  wheel  uarch 18378 Feb 28 18:43 
/usr/local/share/beats/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json
325792 -rw-r--r--  2 root  wheel  uarch 18378 Feb 28 18:43 
/var/db/beats/filebeat/kibana/7/dashboard/Filebeat-Kafka-overview.json


Both files have the same inode number - are hardlinked.

I don't know why the install process is trying to use hardlink instead 
of copy / two independent files.
This file existed only in /var/db/beats in 6.8 version but 7.6 have it 
twice in two locations. Also I don't know if it is upstream bug in beats 
or local in FreeBSD port.

It seems it is the staging problem. Built file has inode number 18378

(root at testjail) beats7/# ll -iol 
/var/ports/usr/ports/headtest/sysutils/beats7/work/beats-7.6.1/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json
295412 -rw-r--r--  3 root  wheel  uarch 18378 Feb 28 18:43 
/var/ports/usr/ports/headtest/sysutils/beats7/work/beats-7.6.1/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json


And two target files in a stage dir have the same inode number 18378 too

(root at testjail) beats7/# ll -li `find 
/var/ports/usr/ports/headtest/sysutils/beats7/work/stage/ -name 
"Filebeat-Kafka-overview.json"`
295412 -rw-r--r--  3 root  wheel  18378 Feb 28 18:43 
/var/ports/usr/ports/headtest/sysutils/beats7/work/stage/usr/local/share/beats/filebeat/module/kafka/_meta/kibana/7/dashboard/Filebeat-Kafka-overview.json
295412 -rw-r--r--  3 root  wheel  18378 Feb 28 18:43 
/var/ports/usr/ports/headtest/sysutils/beats7/work/stage/var/db/beats/filebeat/kibana/7/dashboard/Filebeat-Kafka-overview.json

I don't know how to workaround this.

Miroslav Lachman


More information about the freebsd-elastic mailing list