Hdb/tdb archiving with PyTangoArchiving

Hi all,

I’m currently exploring data archiving with Tango and able to archive the data successfully with HDB and TDB (MySQL).

I would like to start/stop archiving of choosen attributes with my TAURUS client, using PyTangoArchiving !

i also asked other question here :
http://www.tango-controls.org/community/forum/c/development/python/hdbtdb-archiving-with-pytango/

I succeed to install packages according the documentaion and i have following errors, in my virtualenv, when execute those 3 scripts:

ArchivingBrowser.py
"
Traceback (most recent call last):
File “./PyTangoArchiving-master/build/lib.linux-x86_64-2.7/PyTangoArchiving/widget/ArchivingBrowser.py”, line 34, in
from fandango.qt import Qt,Qwt5
ImportError: cannot import name Qwt5
"

archiving_service.py <argin=status>
"
Traceback (most recent call last):
File “./PyTangoArchiving-master/scripts/archiving_service.py”, line 12, in
hostname = os.getenv(‘HOST’).split(‘.’)[0]
AttributeError: ‘NoneType’ object has no attribute ‘split’
"
snaps.py
"
Creating SnapAPI object …
archiving/snap/snapmanager.1
('ERROR: Unable to set Snapshoting DB host: ', IndexError(‘Index out of range’,))
connecting signals …
connected signals …
Traceback (most recent call last):
File “./PyTangoArchiving-master/PyTangoArchiving/widget/snaps/snaps.py”, line 863, in
ui = SnapsTool(sys.argv[-1] if sys.argv[1:] else None)
File “./PyTangoArchiving-master/PyTangoArchiving/widget/snaps/snaps.py”, line 850, in SnapsTool
ui.setupUi(Form)
File “./PyTangoArchiving-master/PyTangoArchiving/widget/snaps/snaps.py”, line 285, in setupUi
if load: self.initContexts()
File “./PyTangoArchiving-master/PyTangoArchiving/widget/snaps/snaps.py”, line 312, in initContexts
ctxs=sorted(contexts.values(), key=lambda s:s.name.lower())
UnboundLocalError: local variable ‘contexts’ referenced before assignment
"

I precise that :

  • in a python console, acces with the reader and the API well ruuning, except the start/stop
  • SnapManager/SnapArchiver well running
  • taurusgui/taurusdesigner well running

Here is the the result of ‘pip list’
"
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
fandango (13.2.5)
MySQL-python (1.2.5)
numpy (1.14.1)
pip (9.0.1)
pytango (9.2.2)
PyTangoArchiving (7.8.0)
QtPy (1.3.1)
setuptools (38.5.1)
six (1.11.0)
taurus (4.1.1)
wheel (0.30.0)

Any idea, any help will be appreciated.
Thanks
JCM

Ok, I see there’s a problem with dependencies, I’ll try to reproduce it and come back to this post.

Hi Sergi,

fyi, following are some precisions about different tests i did with 2 virtualenv and the encountered problems ;-

  1. virtualenv venva
    cd venva
  • with pip, installed in order:
    PyTangoArchiving
    taurus

  • 2 symbolic links needed for taurus and my virtualenv:
    ln -s /usr/lib/python2.7/dist-packages/PyQt4 ./lib/python2.7/site-packages/
    ln -s /usr/lib/python2.7/dist-packages/sip.x86_64-linux-gnu.so ./lib/python2.7/site-packages/

  • with pip, installed QtPy (needed for ArchivinBrowser.py)

  • results:

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venva$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
fandango (13.2.5)
MySQL-python (1.2.5)
numpy (1.14.1)
pip (9.0.1)
pytango (9.2.2)
PyTangoArchiving (7.5.0)
QtPy (1.4.0)
setuptools (38.5.2)
six (1.11.0)
taurus (4.3.0)
wheel (0.30.0)
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
[/quote]

  • what is ok ?

ArchivingBrowser.py

  • what is nok ?

nok1-
no /scripts repertory in my virtualenv ?
so no archving_service.py file ?
is it normal ?

nok2-
error when execution of snaps.py
popup message “could not talk with SnapManager DS. Please chek if DS is running.”

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venva$ python ./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py
Creating SnapAPI object …
archiving/snap/snapmanager.1
('ERROR: Unable to set Snapshoting DB host: ', IndexError(‘Index out of range’,))
connecting signals …
connected signals …
Traceback (most recent call last):
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 863, in
ui = SnapsTool(sys.argv[-1] if sys.argv[1:] else None)
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 850, in SnapsTool
ui.setupUi(Form)
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 285, in setupUi
if load: self.initContexts()
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 312, in initContexts
ctxs=sorted(contexts.values(), key=lambda s:s.name.lower())
UnboundLocalError: local variable ‘contexts’ referenced before assignment
[/quote]

I precise again that SnapManager/SnapArchiver are well intalled and running

nok3-
I already precised that :

  • in a python console, acces with the reader and the API well ruuning, except the start/stop
  1. virtualen venvi
    cd venvi
  • with pip, installed in order :
    PyTango
    MySQL-python
    ./PyTangoArchiving-master.zip (downloaded before)
    taurus
    QtPy

  • 2 symbolic links needed for taurus and my virtualenv:
    ln -s /usr/lib/python2.7/dist-packages/PyQt4 ./lib/python2.7/site-packages/
    ln -s /usr/lib/python2.7/dist-packages/sip.x86_64-linux-gnu.so ./lib/python2.7/site-packages/

what is nok ?

nok1-
no /scripts repertory in my virtualenv ?
so no archving_service.py file ?
is it normal ?
but present in the zip, so :

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venvi$ python ../PyTangoArchiving-master/scripts/archiving_service.py status
Traceback (most recent call last):
File “../PyTangoArchiving-master/scripts/archiving_service.py”, line 12, in
hostname = os.getenv(‘HOST’).split(‘.’)[0]
AttributeError: ‘NoneType’ object has no attribute ‘split’
[/quote]

i tried configuring HOST equals to TANGO_HOST… can you confirme the usage of HOST ?

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venvi$ export HOST=$TANGO_HOST
(venvi) ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venvi$ python ../PyTangoArchiving-master/scripts/archiving_service.py status
Checking the archiving system status …


Servers not registered to any server:

ArchivingManager/1 0
HdbArchiver/01 0
HdbExtractor/1 0
TdbArchiver/01 0
TdbExtractor/1 0
[/quote]

nok2-
error when execution of snaps.py
popup message “could not talk with SnapManager DS. Please chek if DS is running.”

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venvi$ python ./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py
Creating SnapAPI object …
archiving/snap/snapmanager.1
('ERROR: Unable to set Snapshoting DB host: ', IndexError(‘Index out of range’,))
connecting signals …
connected signals …
Traceback (most recent call last):
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 863, in
ui = SnapsTool(sys.argv[-1] if sys.argv[1:] else None)
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 850, in SnapsTool
ui.setupUi(Form)
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 285, in setupUi
if load: self.initContexts()
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/snaps/snaps.py”, line 312, in initContexts
ctxs=sorted(contexts.values(), key=lambda s:s.name.lower())
UnboundLocalError: local variable ‘contexts’ referenced before assignment
[/quote]

nok4-
error executing ArchivingBrowser.py

quote ccthomx@nb-ccthomx:~/test-PyTangoArchiving/venvi$ python ./lib/python2.7/site-packages/PyTangoArchiving/widget/ArchivingBrowser.py
Traceback (most recent call last):
File “./lib/python2.7/site-packages/PyTangoArchiving/widget/ArchivingBrowser.py”, line 34, in
from fandango.qt import Qt,Qwt5
ImportError: cannot import name Qwt5
[/quote]

nok3-
I already precised that :

  • in a python console, acces with the reader and the API well ruuning, except the start/stop

So in summary, here are the common encountered problems, independant of the installation :
nok1-
no /scripts repertory in the virtualenv ?
nok2-
error when execution of snaps.py
nok3-

  • in a python console, acces with the reader and the API well ruuning, except the start/stop

Thanks,
JCM

Hi JCM, sorry for the late answer, I’m currently on holidays but next week I’ll build new packages and I’ll review this issues gain.

Sorry for the delay

Hi Sergi,

do you prefer i create an issue on your GitHub repository ?

Thanks.

Hi JCM,

Sorry for the too-too-late answer, I was on leave for a period much longer than expected.

I’ve created the issue on github anyway, as these bugs affect all schemas

I’ll come back to here when solved,

Sergi