borgbackup / borg

Deduplicating archiver with compression and authenticated encryption.
https://www.borgbackup.org/
Other
11.15k stars 742 forks source link

borg-freebsd64 binary: Cannot open self #336

Closed breyer closed 8 years ago

breyer commented 9 years ago

Hi,

i switched from the pip installation to the borg-freebsd64 binary. After installation i receive following error:

root@muenchen:/home/mono # borg Cannot open self /usr/home/mono/borg or archive /usr/home/mono/borg.pkg

it does't occurs if i start borg like that:

root@muenchen:/home/mono # /usr/local/bin/borg usage: borg [-h] {serve,init,check,change->passphrase,create,extract,rename,delete,list,mount,info,prune,upgrade,help} ... Borg 0.27.0 - Deduplicated Backups

optional arguments: -h, --help show this help message and exit

Available commands: {serve,init,check,change->passphrase,create,extract,rename,delete,list,mount,info,prune,upgrade,help}

Not sure what the problem is, but found a similar issue with docker-compose here: https://github.com/docker/compose/issues/1135 May this helps to solve this issue.

FreeBSD version:

root@muenchen:/home/mono # uname -a FreeBSD muenchen 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64

Thanks Mark

ThomasWaldmann commented 9 years ago

please add this information:

echo $PATH
ls -ld /home /home/mono
which borg
cd /usr/local/bin
ls -l borg
gpg --verify borg.asc  # put the signature right besides the binary first
breyer commented 9 years ago

Importing your public key:

gpg --recv-keys FAF7B393

here the result:

root@muenchen:/usr/local/bin # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/root/bin
root@muenchen:/usr/local/bin # ls -ld /home /home/mono
lrwxr-xr-x  1 root  wheel     8 Oct 22 15:40 /home -> usr/home
drwxr-xr-x  3 mono  mono   1024 Oct 23 14:20 /home/mono
root@muenchen:/usr/local/bin # which borg
/usr/local/bin/borg
root@muenchen:/usr/local/bin # cd /usr/local/bin
root@muenchen:/usr/local/bin # ls -l borg
-rwxr-xr-x  1 root  wheel  9642975 Oct  7 14:42 borg
root@muenchen:/usr/local/bin # gpg --verify borg.asc
gpg: assuming signed data in 'borg'
gpg: Signature made Wed Oct  7 14:41:54 2015 CEST using RSA key ID 51F78E01
gpg: Good signature from "Thomas Waldmann <tw@waldmann-edv.de>" [unknown]
gpg:                 aka "Thomas Waldmann <tw-public@gmx.de>" [unknown]
gpg:                 aka "Thomas Waldmann <twaldmann@thinkmo.de>" [unknown]
gpg:                 aka "Thomas Waldmann <thomas.j.waldmann@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 6D5B EF9A DD20 7580 5747  B70F 9F88 FB52 FAF7 B393
     Subkey fingerprint: 2F81 AFFB AB04 E11F E8EE  65D4 243A CFA9 51F7 8E01
ThomasWaldmann commented 9 years ago

This has nothing to do with pip / running from source.

I suspect that the pyinstaller binary's "bootloader" has trouble to find the path to the binary file (to uncompress it to a temp location).

what does ls -l /proc/curproc/file output for you?

breyer commented 9 years ago

nothing:

root@muenchen:/ # ls -l /proc/curproc/file
ls: /proc/curproc/file: No such file or directory
breyer commented 9 years ago

after mounting:

root@muenchen:/ # mount -t procfs proc /proc
root@muenchen:/ # ls -l /proc/curproc/file
lr--r--r--  1 root  wheel  0 Oct 26 16:43 /proc/curproc/file -> /bin/ls

testing bork:

root@muenchen:/ # cd /
root@muenchen:/ # borg
Cannot open self /usr/local/bin/borg▒▒ or archive /usr/local/bin/borg▒▒.pkg
ThomasWaldmann commented 9 years ago

ah, progress. not fixed yet (see that funny char after "borg", \0 missing maybe?), but almost.

I added some comments there: https://github.com/pyinstaller/pyinstaller/commit/d2e749f0d1fede80828c29837940a9269f596ebb

Looks like we have to wait until pyinstaller is fixed. Just use an abs. path until then.

Alternatively, do a long running borg operation and make a copy of the /tmp/_ME* directory to a safe (non-tmp) place. Start the borg binary in there somehow from PATH.

htgoebel commented 9 years ago

Looks like we have to wait until pyinstaller is fixed

This can happen quick. Now that you already found all these issues, please submit a pull-request :-)

ThomasWaldmann commented 9 years ago

Seems like I become a freebsd user just to fix pyinstaller. :-)

breyer commented 9 years ago

You will not regret it ;)

htgoebel commented 9 years ago

Seems like I become a freebsd user just to fix pyinstaller. :-)

Why not. Maybe I'll become a borgbackup user ...

ThomasWaldmann commented 9 years ago

Opened some pyinstaller issues: https://github.com/pyinstaller/pyinstaller/issues/1634 https://github.com/pyinstaller/pyinstaller/issues/1635

I fixed the stuff, PRs pending.

ThomasWaldmann commented 8 years ago

To fix the freebsd exe build for borg, we either need the stuff fixed in master branch in the pyinstaller repo (== when they release 3.1) or switch to the develop branch in our vagrantfile: https://github.com/borgbackup/borg/blob/master/Vagrantfile#L221 in case we want to release before they have a new release in master.

breyer commented 8 years ago

IMHO take your time. It seems i'm the only one using FreeBSD. Will try to build a binary on my own this weekend. Thanks for your support!

Seems like i become a developer just to fix my issue ;)

ThomasWaldmann commented 8 years ago

Both issues should be fixed in pyinstaller develop branch now.

ThomasWaldmann commented 8 years ago

Crap, it's still broken.

ThomasWaldmann commented 8 years ago

https://github.com/pyinstaller/pyinstaller/pull/1661

Now merged, so we can close this.