Repository: borgbackup/borg

Issue:
freebsd64 vagrant machine suddenly broken
```
$ vagrant up freebsd64
[...]
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

pkg install -y rsync

Stdout from the command:

Updating FreeBSD repository catalogue...
Fetching meta.txz: . done
Fetching packagesite.txz: .......... done
Processing entries: 
Processing entries...           <---------- ~1000 times
FreeBSD repository update completed. 25854 packages processed.
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
	pkg: 1.5.6 -> 1.9.4_1

The process will require 269 KiB more space.
2 MiB to be downloaded.
Fetching pkg-1.9.4_1.txz: .......... done
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.5.6 to 1.9.4_1...
[1/1] Extracting pkg-1.9.4_1: .......... done
Updating FreeBSD repository catalogue...
Repo "FreeBSD" upgrade schema 2011 to 2012: Add depends formula field
Repo "FreeBSD" upgrade schema 2012 to 2013: Add vital field
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	rsync: 3.1.2_6
	libiconv: 1.14_10

Number of packages to be installed: 2

The process will require 3 MiB more space.
896 KiB to be downloaded.
Fetching rsync-3.1.2_6.txz: .......... done
Fetching libiconv-1.14_10.txz: .......... done
Checking integrity... done (0 conflicting)
[1/2] Installing libiconv-1.14_10...
[1/2] Extracting libiconv-1.14_10: 

Stderr from the command:
pkg: Skipping unknown key 'messages'        <--- ~100 times!
/usr/local/lib/libpkg.so.3: Undefined symbol "utimensat"
```


Discussion:
As 10.2 is out of support anyway, I also tried freebsd/10.3-STABLE (instead of geoffgarside/freebsd-10.2), but that one has no MAC address set in the box configuration. :-(
```
$ vagrant up freebsd64
Bringing machine 'freebsd64' up with 'virtualbox' provider...
==> freebsd64: Importing base box 'freebsd/FreeBSD-10.3-RELEASE'...
No base MAC address was specified. This is required for the NAT networking
to work properly (and hence port forwarding, SSH, etc.). Specifying this
MAC address is typically up to the box and box maintainer. Please contact
the relevant person to solve this issue.
```
Note: as this machine is also used to build the single-file borg-freebsd64 binary, there won't be such until this is fixed.
/usr/local/lib/libpkg.so.3: Undefined symbol "utimensat"

this seems to be due to broken backwards compatibility of the binary that gets installed (which is built for 10.3, but does not work on 10.2).
What OS are you running vagrant on?

Use vagrant from here as the project provides vagrant images themselves:
https://atlas.hashicorp.com/freebsd/boxes/FreeBSD-11.0-RELEASE-p1

After it's running, apply patches:
`sudo freebsd-update fetch`
`sudo freebsd-update install`
`sudo reboot`

I don't know what utimensat is.


@jungle-boogie on ubuntu linux 16.04.

I tried 2 of the freebsd boxes, both were broken due to missing MAC address in the box definition.
@ThomasWaldmann,

Ah, sorry, I didn't see you used the official box. I think I've seen that MAC address thing. Are you sure you can't ssh into it? Does virtualbox show the image up and running?
@jungle-boogie no, the VM does not start, see https://github.com/borgbackup/borg/issues/2037#issuecomment-272596356.
Hi @ThomasWaldmann,

FWIW, I get that same message with 10.3-stable from link you and I used, but running `vagrant up` again starts the VM in virtualbox. I would recommend deleting the vagrant file and the VM from virtualbox and running again.

Resolving patch:
diff --git a/src/borg/testsuite/xattr.py b/src/borg/testsuite/xattr.py
--- a/src/borg/testsuite/xattr.py
+++ b/src/borg/testsuite/xattr.py
@@ -11,7 +11,7 @@ class XattrTestCase(BaseTestCase):
 
     def setUp(self):
         self.tmpfile = tempfile.NamedTemporaryFile()
-        self.symlink = os.path.join(os.path.dirname(self.tmpfile.name), 'symlink')
+        self.symlink = self.tmpfile.name + '.symlink'
         os.symlink(self.tmpfile.name, self.symlink)
 
     def tearDown(self):


Test patch: