Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyinstaller ssh/openssh library loading issue / OpenSSL version mismatch #5897

Closed
ThomasWaldmann opened this issue Jul 4, 2021 · 2 comments
Labels
Milestone

Comments

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jul 4, 2021

From the mailing list, reported by cherio:

Remote: OpenSSL version mismatch. Built against 1010106f, you have 101000cf

It seems issue #514 is there again.
This was observed using borg-linux64 and borg-linux64.tgz 1.1.15 and 1.1.16, but not with 1.1.14.

1.1.14 was last borg built with pyinstaller 3.2.1.
1.1.15 was built with 4.0, 1.1.16 was built with 4.2.

The user uses borg binaries on Ubuntu 20.04.

> openssl version
OpenSSL 1.1.1f  31 Mar 2020

> ssh -V
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020

> python
Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.1.1f  31 Mar 2020'

So, system openssl is 1.1.1f, system ssh wants 1.1.1f.
Very likely the pyi bundle has 1.1.0 (for bundled python).

Related borg code:

@ThomasWaldmann ThomasWaldmann added this to the 1.1.17 milestone Jul 4, 2021
@ThomasWaldmann
Copy link
Member Author

ThomasWaldmann commented Jul 4, 2021

I think the bug is slightly different than described above (update: cherio confirmed it is only in single-dir mode):

The problem is that LD_LIBRARY_PATH_ORIG is only provided by pyinstaller, if there was a LD_LIBRARY_PATH in the original env. If not, things get complicated:

https://github.com/borgbackup/borg/blob/1.1.16/src/borg/helpers.py#L2426

We check there if the LDLP contains _MEI, but that is only the case for the single-file pyi bundle.
For the single-dir bundle, it is just the absolute path of the unpacked bundle (not _MEI temp path).

Workaround for using the single-dir bundle, avoiding the problematic part of the code:

LD_LIBRARY_PATH=/invalid borg ... ssh://user@host/repo ...

@ThomasWaldmann
Copy link
Member Author

see also there: pyinstaller/pyinstaller#2892

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Jul 10, 2021
"running under pyinstaller" detection is now as recommended by the pyinstaller docs.
ThomasWaldmann added a commit that referenced this issue Jul 10, 2021
…-1.1

fix pyinstaller detection for dir-mode, fixes #5897
ThomasWaldmann added a commit that referenced this issue Jul 11, 2021
…-master

fix pyinstaller detection for dir-mode, fixes #5897
@ghost ghost mentioned this issue Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant