The existence of the function magic_setparam in the /lib64/libmagic.so.1 ?

Latest response

Why there is no the function magic_setparam in the following /lib64/libmagic.so.1 ?

Error loading some components of s3cmd (Import Error)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Invoked as: /bin/s3cmd
Problem: AttributeError: /lib64/libmagic.so.1: undefined symbol: magic_setparam
S3cmd: 1.6.1
python: 2.7.5 (default, Sep 12 2018, 05:31:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
environment LANG=en_US

Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/s3cmd-1.6.1-py2.7.egg/EGG-INFO/scripts/s3cmd", line 2900, in
File "build/bdist.linux-x86_64/egg/S3/S3.py", line 39, in
File "build/bdist.linux-x86_64/egg/magic.py", line 293, in
File "/usr/lib64/python2.7/ctypes/init.py", line 373, in getattr
func = self.getitem(name)
File "/usr/lib64/python2.7/ctypes/init.py", line 378, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib64/libmagic.so.1: undefined symbol: magic_setparam

[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]# rpm -qf /lib64/libmagic.so.1
file-libs-5.11-35.el7.x86_64
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]# nm -D /lib64/libmagic.so.1|grep -Ei "setpar"
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]# readelf -s /lib64/libmagic.so.1|grep -Ei "setpar"
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]# objdump -Dslx /lib64/libmagic.so.1|grep -Ei "setpar"
[root@cspt3db5 install]#
[root@cspt3db5 install]#
[root@cspt3db5 install]#

Responses

It doesn't look like your version of s3cmd is compatible with the build of libmagic.so.1 in RHEL 7. You might do better with the one from EPEL

For our demand of some contrast tests, we need the special edition of S3cmd that only with source code (not RPM format)!

Notes: there is only lower 1.0.x or higher 2.0.2 edition for RPMs on the S3tools official site(also plus centos.pkgs.org)!

This problem has made some much progress!

Now at least I can confirm that it should have nothing to do with the s3cmd program itself !

Becuase it also failed with the same result when I executed the python-magic's built-in script!

But I still cannot image that the python-magic would have any other potential problem .... !

# 
# 
# rpm -qa|grep -i pytho|grep -i magic
python-magic-5.11-35.el7.noarch
# 
# 
# 
# rpm -V python-magic-5.11-35.el7.noarch
# 
# 
# 
# rpm -ql python-magic-5.11-35.el7.noarch
/usr/lib/python2.7/site-packages/Magic_file_extensions-0.2-py2.7.egg-info
/usr/lib/python2.7/site-packages/magic.py
/usr/lib/python2.7/site-packages/magic.pyc
/usr/lib/python2.7/site-packages/magic.pyo
/usr/share/doc/python-magic-5.11
/usr/share/doc/python-magic-5.11/COPYING
/usr/share/doc/python-magic-5.11/README
/usr/share/doc/python-magic-5.11/example.py
# 
# 
# 
# chmod 744  /usr/share/doc/python-magic-5.11/example.py
# 
# 
# /usr/share/doc/python-magic-5.11/example.py
Traceback (most recent call last):
  File "/usr/share/doc/python-magic-5.11/example.py", line 3, in <module>
    import magic
  File "build/bdist.linux-x86_64/egg/magic.py", line 293, in <module>

  File "/usr/lib64/python2.7/ctypes/__init__.py", line 373, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib64/python2.7/ctypes/__init__.py", line 378, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib64/libmagic.so.1: undefined symbol: magic_setparam
# 
#