-
Notifications
You must be signed in to change notification settings - Fork 138
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
Leap 15.6: SFTP share error - library paths changed #2856
Comments
I can confirm that the above file, Et voila, the sftp share could be created (non root-user owned). I just wanted to confirm that there aren't any follow-on errors during the sftp export creation, and it seem that there aren't. |
Currently working on this issue, and I have begun a minor modernisation of sorts. Way back we just grabbed these library dependencies from |
Move to dynamic discovery of bash & rsync libraries when populating ssh / sftp share chroot.
way more elegant, actually :). |
Osi get_libs() was developed on test data void of tab characters. Instantiation these surfaced a bug re line (pre strip()) vs line field (stripped) use.
Move to dynamic discovery of bash & rsync libraries when populating ssh / sftp share chroot. Incidental dropping of the redundant chroot `bin` dir, we now use only `/usr/bin` for both the `bash`, and `rsync` binaries.
Ldd reports /lib for ld-linux-aarch64.so.1, this needs to exist for our chroot copy to work. Previously we sourced a link from /lib64 which we do already create.
…or---library-paths-changed Leap 15.6: SFTP share error - library paths changed #2856
Closing as: |
Thanks to forum user mpidala, the following issue was reported during
sftp
share creation on a Leap 15.6 Rockstor instance (https://forum.rockstor.com/t/error-adding-sftp-share/9548/):the following error message is thrown when trying to create an sftp share:
As @FroggyFlox already identified, some of the shared libraries that are symbolically linked during the sftp process can't be found because their physical location has changed with the Leap 15.6 release. Within the Rockstor code base they are maintained here:
rockstor-core/src/rockstor/system/ssh.py
Lines 273 to 285 in 3f8d02b
the one that triggered the above error is assumed to be located in:
/lib64/libz.so.1
In Leap 15.6 the location has changed to:
/usr/lib64/libz.so.1
This likely has to be updated. The decision here is whether to remain backwards compatible to at least Leap 15.5 or not.
If no, then an update of the paths in the above code snippet should be sufficient.
If yes, we will need an additional way of identifying which
Leap
release is currently being used during the execution of the program.Unfortunately, in the copying process only the distribution ID (
OS_DISTRO_ID
) from thesettings file
is used to validate:rockstor-core/src/rockstor/system/ssh.py
Lines 302 to 304 in 3f8d02b
As one can see, in the settings file the values for
OS_DISTRO_ID
do not distinguish by distribution releaserockstor-core/src/rockstor/settings.py
Lines 466 to 473 in 3f8d02b
Unfortunately, just replacing the
OS_DISTRO_ID
with 'OS_DISTRO_VERSION' would likely break the "rolling" Tumbleweed version in this case. Since the version under Tumbleweed changes with every release which are very frequent (daily/weekly). Updating Rockstor that frequently is neither practical nor sustainable.One approach could be to add another condition that essentially checks whether the Rockstor instance runs on Leap, and if so, check whether it's version 15.6 or earlier. If earlier the current definition shown above would be used, and if 15.6 (and presumably later) select a newly created section that contains the altered paths to create symbolic links from. If 15.6 or higher, concatenate ID and Version and the section the copy process refers would also have the concatenated version (e.g.
opensuse-leap15.6+
and for other leap flavors it remains what it was,opensuse-leap
). That way, other Leap flavors are not impacted. Once support for 15.5 is dropped, that section can be dropped, and it can be similarly managed if a change comes with a15.7
(if ever released) version ...Or a completely different approach, of course.
Finally, I am surprised that the testing library would not have caught this, but I did not take a closer look at the unit tests. When fixing this, the unit test should probably be corrected, or if it doesn't exist should be created, since I suspect this will not be the last time that the location of these types of files will change. For reference:
https://github.com/rockstor/rockstor-core/blob/testing/src/rockstor/storageadmin/tests/test_sftp.py
happy path (which should be unhappy on 15.6 in my opinion):
rockstor-core/src/rockstor/storageadmin/tests/test_sftp.py
Lines 158 to 165 in 3f8d02b
The text was updated successfully, but these errors were encountered: