View Issue Details

IDProjectCategoryView StatusLast Update
0001332bareos-core[All Projects] Generalpublic2021-03-23 18:18
Reporterloli10KAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version20.0.1 
Fixed in Version 
Summary0001332: BareosDirPluginBaseclass.py still importing removed "bareos_dir_consts" module
DescriptionI've been using python2 dir plugins to monitor bareos since 2018 (see issue 0000821)

Recently i had to reinstall bareos on a different distro providing python3 binaries: unfortunately when i tried to install my plugin i found that "bareos_dir_consts.py" has been removed (https://github.com/bareos/bareos/commit/b961063ef95ffe64b47318c512251764ce73add6 "python-dir: move constants into python-dir module") but is still being used by the plugin base class (https://github.com/bareos/bareos/blob/Release/20.0.1/core/src/plugins/dird/python/pyfiles/BareosDirPluginBaseclass.py#L28): this seems to break every python dir plugin.
Steps To Reproduce1. Clean bareos-20.0.1-3 install on Ubuntu-20.04 (with bareos-director-python* packages)
2. Enable python3 support in "/etc/bareos/bareos-dir.d/director/bareos-dir.conf"
3. Enable custom Dir Plugin in Job definition (DIR Plugin Options = "python3:module_path=/usr/lib/bareos/plugins:module_name=bareos-dir-my-plugin-name")
4. Run Job
5. Job results in error, logs show:

bareos-dir JobId 5: Fatal error: bareosdir: Traceback (most recent call last):
File "/usr/lib/bareos/plugins/bareos-dir-my-plugin-name.py", line 39, in
import BareosDirPluginMyPluginName
File "/usr/lib/bareos/plugins/BareosDirPluginMyPluginName.py", line 34, in
import BareosDirPluginBaseclass
File "/usr/lib/bareos/plugins/BareosDirPluginBaseclass.py", line 28, in
from bareos_dir_consts import bDirEventType, brDirVariable, bRCs
ModuleNotFoundError: No module named 'bareos_dir_consts'
Additional Informationroot@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
root@ubuntu:~# dpkg -l | grep bareos
ii bareos 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - metapackage
ii bareos-bconsole 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - text console
ii bareos-client 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - client metapackage
ii bareos-common 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - common files
ii bareos-database-common 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - common catalog files
ii bareos-database-postgresql 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - PostgreSQL backend
ii bareos-database-tools 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - database tools
ii bareos-director 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - director daemon
ii bareos-director-python-plugins-common 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - director Python plugin common files
ii bareos-director-python3-plugin 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - director Python plugin
ii bareos-filedaemon 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - file daemon
ii bareos-storage 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - storage daemon
ii bareos-tools 20.0.1-3 amd64 Backup Archiving Recovery Open Sourced - common tools
ii bareos-webui 20.0.1-3 all Backup Archiving Recovery Open Sourced - webui
root@ubuntu:~# dpkg -L bareos-director-python3-plugin
/.
/usr
/usr/lib
/usr/lib/bareos
/usr/lib/bareos/plugins
/usr/lib/bareos/plugins/python3-dir.so
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/bareosdir.cpython-38-x86_64-linux-gnu.so
/usr/share
/usr/share/doc
/usr/share/doc/bareos-director-python3-plugin
/usr/share/doc/bareos-director-python3-plugin/changelog.Debian.gz
/usr/share/doc/bareos-director-python3-plugin/copyright
root@ubuntu:~# dpkg -L bareos-director-python-plugins-common
/.
/usr
/usr/lib
/usr/lib/bareos
/usr/lib/bareos/plugins
/usr/lib/bareos/plugins/BareosDirPluginBaseclass.py
/usr/lib/bareos/plugins/BareosDirWrapper.py
/usr/lib/bareos/plugins/bareos-dir-class-plugin.py
/usr/share
/usr/share/doc
/usr/share/doc/bareos-director-python-plugins-common
/usr/share/doc/bareos-director-python-plugins-common/changelog.Debian.gz
/usr/share/doc/bareos-director-python-plugins-common/copyright
root@ubuntu:~# grep -r bareos_dir_consts /usr/lib/bareos/plugins
/usr/lib/bareos/plugins/BareosDirPluginBaseclass.py:from bareos_dir_consts import bDirEventType, brDirVariable, bRCs
/usr/lib/bareos/plugins/bareos-dir-class-plugin.py:import bareos_dir_consts
/usr/lib/bareos/plugins/bareos-dir-class-plugin.py: return bareos_dir_consts.bRCs["bRC_OK"]
root@ubuntu:~# python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bareosdir
>>> from bareos_dir_consts import bDirEventType, brDirVariable, bRCs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'bareos_dir_consts'
>>>
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-03-23 18:18 loli10K New Issue