Can not create an SFTP share on openSUSE

When trying to create an SFTP share on openSUSE I got the following error:

[Errno 2] No such file or directory: '/lib64/libpopt.so.0'

            Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py", line 41, in _handle_exception
    yield
  File "/opt/rockstor/src/rockstor/storageadmin/views/sftp.py", line 80, in post
    rsync_for_sftp(chroot_loc)
  File "/opt/rockstor/src/rockstor/system/ssh.py", line 127, in rsync_for_sftp
    ('%s/lib64' % chroot_loc))
  File "/usr/lib64/python2.7/shutil.py", line 133, in copy
    copyfile(src, dst)
  File "/usr/lib64/python2.7/shutil.py", line 96, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/lib64/libpopt.so.0'

zypper says libpopt0 is already installed. I can find it at /usr/lib64/libpopt.so.0, so the code is possibly looking for it in the wrong place?

2 Likes

@freaktechnik Nice find.

Let us know if you make an progress in tracking this down any further.

I’d look to this bit first:

I.e. chroot_loc may be set wrong. Haven’t been there for ages. If you take a look at a few recent [openSUSE] related commits you can see how we do stuff contextually using distro. That may be all we need here. But again, I haven’t looked into this yet but if you fancy doing so then great.

Thanks again for a nice report and do post here any progress. Once we have the root cause you could create a GitHub issue to get this one sorted if you fancy:

Developers subsection of Contributing to Rockstor:
http://rockstor.com/docs/contribute.html#developers

Thanks again for the report and if you do get to creating a GitHub issue for this, once it’s clarified a tad, remember to link back to this forum post.

1 Like

@freaktechnik, @phillxnet, I was waiting for a computation to run so I had a few minutes to kill.

I thus looked and indeed, we are looking in the wrong place, it seems as we have the libs location hardcoded (for centOS, I assume) here:

As per @freaktechnik findings, it seems like we should use /usr/lib64 instead of /lib64/ in line 126 (assuming all the other libs have the same location as well in openSUSE.

2 Likes

It appears only libpopt is in /usr/lib64 on openSUSE, the other ones are still native system libs.

Reported on GitHub as

2 Likes

@freaktechnik Hello again.

On a quick related developer note, how is @Flox’s fix for your reported:

working out in 3.9.2-58, I’m assuming it’s working for you as tested in pr:

Cheers.

SFTP shares work fine now, thanks.

2 Likes

@freaktechnik Thanks for the confirmation.

I can pop this in the beta release notes. Always good to have additional confirmation, just in case the developer and reviewer missed the same thing/things: @Flox and me respectively in this case.

Thanks for actively helping with Rockstor’s development by the way. I’m quite looking forward to having this whole CentOS to β€˜Built on openSUSE’ move over and done with and we are very nearly there now.

Cheers.

1 Like