taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

taurusgui --tango-host=... does not work #79

Closed sf-migrator-bot closed 7 years ago

sf-migrator-bot commented 10 years ago

Hi,

I've just wanted to run taurusgui for macroserver on different box, so I run

wheezy-jk$ taurusgui macrogui --tango-host=haso228k.desy.de:10000 --taurus-log-level=debug --fail-proof

Taurusgui start but it cannot connect to the MacroServer, i.e.

in Taurus->Macro Server Configuration... I can see macroservers and doors from the haso228k.desy.de but they have brown-point status and I cannot select any of measurementgroup from haso228k.desy.de pools in Experiment Config.

The same command started on the haso228k.desy.de box works fine.

From the logger of taurusgui started on the wheezy-jk box I get (I attach the full log file):

MainThread WARNING 2014-06-25 11:31:47,824 TaurusRootLogger: Cannot load Measurement group "'mntgrp2'": TypeError('expect ed string or buffer',) MainThread WARNING 2014-06-25 11:31:47,824 TaurusRootLogger: Cannot load Measurement group "'nxsmntgrp'": TypeError('expe cted string or buffer',) MainThread WARNING 2014-06-25 11:31:47,825 TaurusRootLogger: Cannot load Measurement group "'mntgrp'": TypeError('expecte d string or buffer',) MainThread WARNING 2014-06-25 11:31:47,825 TaurusRootLogger: Cannot load Measurement group "'mg_haso228k'": TypeError('ex pected string or buffer',) MainThread WARNING 2014-06-25 11:31:47,825 TaurusRootLogger: Cannot load Measurement group "'mng'": TypeError('expected s tring or buffer',) MainThread WARNING 2014-06-25 11:31:47,826 TaurusRootLogger: Cannot load Measurement group "'mg_haso228k2'": TypeError('e xpected string or buffer',) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/taurus/qt/qtgui/taurusgui/macrolistener.py", line 343, in setModel DynamicPlotManager.setModel(self, doorname) File "/usr/lib/python2.7/dist-packages/taurus/qt/qtgui/taurusgui/macrolistener.py", line 96, in setModel self.onExpConfChanged(expconf) File "/usr/lib/python2.7/dist-packages/taurus/qt/qtgui/taurusgui/macrolistener.py", line 124, in onExpConfChanged mgconfig = expconf['MntGrpConfigs'][expconf['ActiveMntGrp']] File "/usr/lib/python2.7/dist-packages/taurus/core/util/containers.py", line 250, in getitem return dict.getitem(self, key.lower()) KeyError: 'nxsmntgrp'

If you suspect this is an IPython bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via: c.Application.verbose_crash=True

Dummy-5 INFO 2014-06-25 11:31:48,430 haso228k.desy.de:10000.Door_demo1_1.Debug: Activating polling. Reason: API_EventTimeout

Bests, Jan

Reported by: jkotan ( http://sf.net/u/jkotan )

sf-migrator-bot commented 10 years ago

Original comment by: cpascual (http://sourceforge.net/u/cpascual)

sf-migrator-bot commented 9 years ago

Original comment by: cpascual (http://sourceforge.net/u/cpascual)

sf-migrator-bot commented 9 years ago

Ticket moved from /p/sardana/tickets/187/

Can't be converted:

Original comment by: tiagocoutinho (http://sourceforge.net/u/tiagocoutinho)

cpascual commented 7 years ago

Hi, can someone confirm if this still applies to Taurus and Sardana?

cmft commented 7 years ago

In taurus3 the bug #73 (from SF) is not fixed, but the errors seem to be in sardana.

A simple taurusgui with MS elements defined shows this errors after run the GUI.

File "/home/cfalcon/tools/sardana-sardana.git/src/sardana/taurus/qt/qtgui/extra_sardana/expdescription.py", line 153, in setModel self._reloadConf(force=True) File "/home/cfalcon/tools/sardana-sardana.git/src/sardana/taurus/qt/qtgui/extra_sardana/expdescription.py", line 171, in _reloadConf conf = door.getExperimentConfiguration() File "/home/cfalcon/tools/sardana-sardana.git/src/sardana/taurus/core/tango/sardana/macroserver.py", line 699, in getExperimentConfiguration return self._experiment_configuration.get() File "/home/cfalcon/tools/sardana-sardana.git/src/sardana/taurus/core/tango/sardana/macroserver.py", line 191, in get replies = mnt_grp_grps.read_attribute("configuration") File "/usr/lib64/python2.7/site-packages/tango/group.py", line 129, in read_attribute idx = self.__group.read_attribute_asynch(attr_name, forward)

While with taurus4 the errors are different and seems to be signal problems (but also in sardana code):

File "/usr/local/lib/python2.7/dist-packages/sardana/taurus/qt/qtgui/extra_macroexecutor/macroexecutor.py", line 954, in setModel

 self.connect(newModelObj, Qt.SIGNAL("macrosUpdated"),self.macroComboBox.onMacrosUpdated)

TypeError: arguments did not match any overloaded call:

QObject.connect(QObject, SIGNAL(), QObject, SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 1 has unexpected type 'TangoDevice'

QObject.connect(QObject, SIGNAL(), callable, Qt.ConnectionType=Qt.AutoConnection): argument 1 has unexpected type 'TangoDevice'

QObject.connect(QObject, SIGNAL(), SLOT(), Qt.ConnectionType=Qt.AutoConnection): argument 1 has unexpected type 'TangoDevice'

Bug #73 seems to be fixed for GUI without sardana elements. But --tango-host= must be given in a valid way for taurus. I mean, the given name must be a valid taurus URI for an Authority. e.g. tango://HOST:PORT or //HOST:PORT

On 01/22/2017 09:20 PM, Carlos Pascual wrote:

Hi, can someone confirm if this still applies to Taurus and Sardana?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/taurus-org/taurus/issues/79#issuecomment-274356233, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4gkjsMIAbPETra0UUDFQfzFezwSBFaks5rU7orgaJpZM4LqfZP.

cpascual commented 7 years ago

Hi @jkotan can you please confirm what @cmft reports? (if so, we would close this issue in Taurus and open a new one in Sardana).

Please note the part of using the "URI-valid way of referring to the tango host" (i.e. the double slash prefix)

jkotan commented 7 years ago

Hi Carlos,

Today, I manged to perform only a few short tests i.e.:

1) with current DESY installation, i.e. Taurus 3.7.3 and Sardana 2.1.1. The tango-host works OK,e.g.

 taurusgui  macrogui --tango-host=haso107d1.desy.de:10000

where haso107d1 is external TANGO HOST. However, when I try to do the same in the MacroGUI menu, i.e. Taurus -> Change Tango Host -> ... it does not work. It shows only local macroservers (not 'external' one).

2) with freshly installed from the develop branchs Tango 4.0.4 and Sardana 2.2.4 and after setting new Pool and MacroServer running sar_demo I can run

taurusgui  macrogui 

which works however when I run

taurusgui  macrogui --tango-host=haso228k.desy.de:10000

where haso228k is TANGO_HOST on my local machine (i.e. it should be equivalent as above) I get the following error:

jkotan@haso228k:~$ taurusgui  macrogui --tango-host=haso228k.desy.de:10000
MainThread     INFO     2017-01-23 17:47:28,837 TaurusRootLogger: Using "PyQt4" for Qt
MainThread     INFO     2017-01-23 17:47:28,935 taurus.qt.qtgui.icon.icon: Setting Tango icon theme (from /home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/icon/)
MainThread     INFO     2017-01-23 17:47:28,978 TaurusRootLogger: Starting execution of TaurusGui
MainThread     INFO     2017-01-23 17:47:29,101 TaurusApplication: Logs will be saved in /home/jkotan/tmp/MacroGUI/MacroGUI.log
MainThread     INFO     2017-01-23 17:47:29,102 TaurusGui: Resetting unresponsive socket with key "__socket_jkotan-MacroGUI__"
MainThread     INFO     2017-01-23 17:47:29,102 TaurusGui: Registering as single instance with key "__socket_jkotan-MacroGUI__"
MainThread     WARNING  2017-01-23 17:47:29,104 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/macroexecutor.py:40: DeprecationWarning: taurus.qt.qtgui.resource is deprecated since 4.0. Use taurus.qt.qtgui.icon instead
  from taurus.qt.qtgui.resource import getIcon, getThemeIcon

MainThread     WARNING  2017-01-23 17:47:29,111 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py:131: DeprecationWarning: getThemeIcon is deprecated since 4.0. Use QIcon.fromTheme instead
  configureAction = Qt.QAction(getThemeIcon("folder-open"), "Change custom macro editors paths", self)

 MainThread     WARNING  2017-01-23 17:47:29,112 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py:180: DeprecationWarning: Database is deprecated since 4.0. Use Authority instead
  db = taurus.Database()

MainThread     ERROR    2017-01-23 17:47:29,113 LogExceptHook: Unhandled exception:
Traceback (most recent call last):
  File "/home/jkotan/testinst/bin/taurusgui", line 9, in <module>
    load_entry_point('taurus==4.0.4-alpha', 'gui_scripts', 'taurusgui')()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 1636, in main
configRecursionDepth=configRecursionDepth)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 321, in __init__
    self.loadConfiguration(confname)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 1097, in loadConfiguration
    self.__macroBroker = MacroBroker(self)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/macrolistener.py", line 333, in __init__
    self._createPermanentPanels()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/macrolistener.py", line 411, in _createPermanentPanels
    TaurusMacroConfigurationDialog(mainwindow)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 139, in __init__
    self.initComponents()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 145, in initComponents
    ms_stateIcons = self.__retriveMacroServersFromDB()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 180, in __retriveMacroServersFromDB
    db = taurus.Database()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/util/log.py", line 1047, in new_func
    return func(*args, **kwargs)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/taurushelper.py", line 585, in Database
    return Authority(name=name)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/taurushelper.py", line 605, in Authority
    return Factory(getSchemeFromName(name or '')).getAuthority(name)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/tango/tangofactory.py", line 239, in getAuthority
    "Invalid default Tango authority name %s" % name)
TaurusException: Invalid default Tango authority name haso228k.desy.de:10000

The same commands for older Taurus/Sardana version works fine.

So I don't know think everthing works OK.

Bests, Jan

cmft commented 7 years ago

Hola Jan, Your error with Taurus4 is normal, as we commented in the previous email, you need a valid Taurus4 URI to define the tango_host. This should be work for you test:

taurusgui macrogui --tango-host=//haso228k.desy.de:10000

We have in mind to include the old syntaxis as a valid one.

I aslo confirm that using "taurusgui macrogui" I don't see the reported error. I did the test creating an empty taurusgui from fresh with the option of include the MS elements in the wizard .

Best, Carlos

On 01/23/2017 05:54 PM, Jan Kotanski wrote:

Hi Carlos,

Today, I manged to perform only a few short tests i.e.:

1.

with current DESY installation, i.e. Taurus 3.7.3 and Sardana
2.1.1. The tango-host works OK,e.g.

taurusgui macrogui --tango-host=haso107d1.desy.de:10000

where haso107d1 is external TANGO HOST. However, when I try to do the same in the MacroGUI menu, i.e. Taurus -> Change Tango Host -> ... it does not work. It shows only local macroservers (not 'external' one).

2.

with freshly installed from the develop branchs Tango 4.0.4 and
Sardana 2.2.4 and after setting new Pool and MacroServer running
sar_demo I can run

taurusgui macrogui

which works however when I run

taurusgui macrogui --tango-host=haso228k.desy.de:10000

where haso228k is TANGO_HOST on my local machine (i.e. it should be equivalent as above) I get the following error:

|jkotan@haso228k:~$ taurusgui macrogui --tango-host=haso228k.desy.de:10000 MainThread INFO 2017-01-23 17:47:28,837 TaurusRootLogger: Using "PyQt4" for Qt MainThread INFO 2017-01-23 17:47:28,935 taurus.qt.qtgui.icon.icon: Setting Tango icon theme (from /home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/icon/) MainThread INFO 2017-01-23 17:47:28,978 TaurusRootLogger: Starting execution of TaurusGui MainThread INFO 2017-01-23 17:47:29,101 TaurusApplication: Logs will be saved in /home/jkotan/tmp/MacroGUI/MacroGUI.log MainThread INFO 2017-01-23 17:47:29,102 TaurusGui: Resetting unresponsive socket with key "socket_jkotan-MacroGUI" MainThread INFO 2017-01-23 17:47:29,102 TaurusGui: Registering as single instance with key "socket_jkotan-MacroGUI" MainThread WARNING 2017-01-23 17:47:29,104 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/macroexecutor.py:40: DeprecationWarning: taurus.qt.qtgui.resource is deprecated since 4.0. Use taurus.qt.qtgui.icon instead from taurus.qt.qtgui.resource import getIcon, getThemeIcon

MainThread WARNING 2017-01-23 17:47:29,111 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py:131: DeprecationWarning: getThemeIcon is deprecated since 4.0. Use QIcon.fromTheme instead configureAction = Qt.QAction(getThemeIcon("folder-open"), "Change custom macro editors paths", self)

MainThread WARNING 2017-01-23 17:47:29,112 TaurusRootLogger: /home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py:180: DeprecationWarning: Database is deprecated since 4.0. Use Authority instead db = taurus.Database()

MainThread ERROR 2017-01-23 17:47:29,113 LogExceptHook: Unhandled exception: Traceback (most recent call last): File "/home/jkotan/testinst/bin/taurusgui", line 9, in load_entry_point('taurus==4.0.4-alpha', 'gui_scripts', 'taurusgui')() File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 1636, in main configRecursionDepth=configRecursionDepth) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 321, in init self.loadConfiguration(confname) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/taurusgui.py", line 1097, in loadConfiguration self.macroBroker = MacroBroker(self) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/macrolistener.py", line 333, in init self._createPermanentPanels() File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/qt/qtgui/taurusgui/macrolistener.py", line 411, in _createPermanentPanels TaurusMacroConfigurationDialog(mainwindow) File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 139, in init__ self.initComponents() File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 145, in initComponents ms_stateIcons = self.retriveMacroServersFromDB() File "/home/jkotan/testinst/lib/python2.7/site-packages/sardana-2.2.4_alpha-py2.7.egg/sardana/taurus/qt/qtgui/extra_macroexecutor/common.py", line 180, in retriveMacroServersFromDB db = taurus.Database() File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/util/log.py", line 1047, in new_func return func(*args, **kwargs) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/taurushelper.py", line 585, in Database return Authority(name=name) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/taurushelper.py", line 605, in Authority return Factory(getSchemeFromName(name or '')).getAuthority(name) File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus-4.0.4_alpha-py2.7.egg/taurus/core/tango/tangofactory.py", line 239, in getAuthority "Invalid default Tango authority name %s" % name) TaurusException: Invalid default Tango authority name haso228k.desy.de:10000 |

The same commands for older Taurus/Sardana version works fine.

So I don't know think everthing works OK.

Bests, Jan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/taurus-org/taurus/issues/79#issuecomment-274545832, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4gkk8qMKMhZ-PEXGckuZjx3S_SuCOZks5rVNs8gaJpZM4LqfZP.

jkotan commented 7 years ago

Hi Carlos,

Indeed. But then if you require this non-trivial syntax it should be mention at least under the taurusgui --help option.

Now, when I try

taurusgui macrogui --tango-host=//haso107d1.desy.de:10000

with Taurus4.0.4/Sardana2.2.4 I don't get this error. However, I cannot set the Door server under

Taurus -> Macro execusion Configuration ... 

with the error

MainThread     WARNING  2017-01-24 08:42:50,357 haso228k:10000.p09/macroserver/haso107d1.01: Could not create HW object: device p09/macroserver/haso107d1.01 not defined in the database !
MainThread     WARNING  2017-01-24 08:42:50,359 haso228k:10000.p09/macroserver/haso107d1.01: Could not create HW object: device p09/macroserver/haso107d1.01 not defined in the database !

It is possible in the older version. Is it above mentioned problem with the signals?

Also

 Taurus -> Change Tango Host -> ...

does not work. If it is not intendent to work at all it is better to remove "Change Tango Host" from the window menu.

Bests, Jan

jkotan commented 7 years ago

Hi,

In the above error (I sent a few minutes ago) why p09/macroserver/haso107d1.01 is searched on the local server (haso228k) instead of the extranal one (haso107d1)?

Bests, Jan

cpascual commented 7 years ago

On Monday, January 23, 2017 11:47:41 PM CET Jan Kotanski wrote:

Hi Carlos,

Indeed. But then if you require this non-trivial syntax it should be mention at least under the taurusgui --help option.

Done (in #378). Already merged to develop (4.0.4-alpha).

Now, when I try

taurusgui macrogui --tango-host=//haso107d1.desy.de:10000

with Taurus4.0.4/Sardana2.2.4 I don't get this error. However, I cannot set the Door server under

Taurus -> Macro execusion Configuration ...

with the error

MainThread     WARNING  2017-01-24 08:42:50,357

haso228k:10000.p09/macroserver/haso107d1.01: Could not create HW object: device p09/macroserver/haso107d1.01 not defined in the database ! MainThread WARNING 2017-01-24 08:42:50,359 haso228k:10000.p09/macroserver/haso107d1.01: Could not create HW object: device p09/macroserver/haso107d1.01 not defined in the database !

It is possible in the older version. Is it above mentioned problem with the signals?

Confirmed. We just reproduced it. We will try to debug it

Note that, as a workaround, you can substitute : taurusgui macrogui --tango-host=//haso107d1.desy.de:10000 by: TANGO_HOST=haso107d1.desy.de:10000 taurusgui macrogui

(which works well)

Also

 Taurus -> Change Tango Host -> ...

does not work. If it is not intendent to work at all it is better to remove "Change Tango Host" from the window menu.

Confirmed... well, strictly speaking, "it does work" but the only effect that this has by default is to set a "tangoHost" property of the MainWindow...

I just created this Issue: https://github.com/taurus-org/taurus/issues/379

Let's follow this specific discussion there.

Cheers,

Carlos

-- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpascual@cells.es Phone: +34 93 592 4428 +----------------------------------------------------+

cmft commented 7 years ago

Hi @jkotan, The problem seems to be fixed using the latest Sardana (develop). Could you confirm it?

jkotan commented 7 years ago

Hi,

Sorry for late replay but since we are not using now the latest Sardana (develop) I cannot fully test it. But to do it I create some VMs with different tango-hosts.

For taurus support-3.x:

taurusgui macrogui --tango-host=//haso228k.desy.de:10000

throws TaurusException: Invalid default Tango database name //haso228k.desy.de:10000

while with taurusgui macrogui --tango-host=haso228k.desy.de:10000

application loads but I cannot choose the door from remote host, i.e.

MainThread     INFO     2017-06-30 14:16:11,669 TaurusGui: MainWindow settings restored
MainThread     WARNING  2017-06-30 14:16:21,988 TaurusRootLogger: Cannot load Measurement group "'mg_test03'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-06-30 14:16:21,989 TaurusRootLogger: Cannot load Measurement group "'mg_test02'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-06-30 14:16:21,989 TaurusRootLogger: Cannot load Measurement group "'newmg'": TypeError('expected string or buffer',)
MainThread     ERROR    2017-06-30 14:16:22,316 LogExceptHook: Unhandled exception:
Traceback (most recent call last):
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/qt/qtgui/model/qbasemodel.py", line 553, in setModel
model.setDataSource(modelObj)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/qt/qtcore/model/taurusmodel.py", line 222, in setDataSource
self.refresh()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/qt/qtcore/model/taurusdatabasemodel.py", line 372, in refresh
TaurusBaseModel.refresh(self, refresh_source=refresh_source)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/qt/qtcore/model/taurusmodel.py", line 201, in refresh
self.setupModelData(self.dataSource())
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/qt/qtcore/model/taurusdatabasemodel.py", line 527, in setupModelData
data = data.deviceTree()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/taurusdatabase.py", line 543, in deviceTree
return self.cache().deviceTree()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangodatabase.py", line 381, in cache
self._dbCache = TangoDatabaseCache(self)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/taurusdatabase.py", line 311, in __init__
self.refresh()
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangodatabase.py", line 167, in refresh
name, ior, level, server, host, started, stopped = _info
ValueError: too many values to unpack

and the measurement groups: neither they are visible nor it is posible to create them. A similar error I get for

 TANGO_HOST=haso228k.desy.de:10000 taurusgui macrogui

but in the latter case but I cannot perform the scan (ascan hangs).

For Taurus4: taurusgui macrogui --tango-host=//haso228k.desy.de:10000 or taurusgui macrogui --tango-host=haso228k.desy.de:10000

I get MainThread WARNING 2017-06-30 14:23:10,701 TaurusRootLogger: /home/jkotan/testsar/lib/python2.7/site-packages/sardana-2.2.5_alpha-py2.7.egg/sardana/taurus/core/tango/sardana/macroserver.py:572: DeprecationWarning: getSWState is deprecated since 4.0. Use state instead self._old_sw_door_state = self.getSWState()

MainThread     WARNING  2017-06-30 14:23:11,147 TaurusRootLogger: Cannot load Measurement group "'newmg'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-06-30 14:23:11,564 TaurusRootLogger: Cannot load Measurement group "'newmg'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-06-30 14:23:11,564 MacroBroker.p09/door/haso228k.01: ActiveMntGrp 'newmg' is not defined
MainThread     INFO     2017-06-30 14:23:30,137 TaurusGui: MainWindow settings saved in "/home/jkotan/.config/Taurus/MacroGUI.ini"
MainThread     INFO     2017-06-30 14:23:30,153 TaurusRootLogger:

and measurement groups does not as well.

For Taurus4 and TANGO_HOST, i.e.

TANGO_HOST=haso228k.desy.de:10000 taurusgui macrogu

hangs as well.

Bests, Jan

cpascual commented 7 years ago

Hi @jkotan , thanks for the tests... we will have a look at the problem again the next week (focusing on taurus4).

We'll keep you updated

reszelaz commented 7 years ago

I have also tested it, and all the following cases worked for me (I was using Taurus4):

taurusgui macrogui --tango-host=controls04:10000 # apparently this works as well!
taurusgui macrogui --tango-host=//controls04:10000
TANGO_HOST=controls04:10000 taurusgui macrogui

With this I was able to go the menu Taurus->Macro Server Configuration... and select a Door from the controls04 Tango database and run a ct macro on it.

@jkotan in your tests ensure that the Sardana server side (Pool & MacroServer) also runs the latest code from the Sardana develop branch. I experienced problems when they were using Sardana code before commit 6b5b58e. This commit removed units from the MeasurementGroup configuration. So if the Pool runs the old code, it exports MeasurementGroup's configuration containing units. Then the expconf does not know how to interpret them.

cpascual commented 7 years ago

Hi @jkotan : The exception that you report when using taurus 3 is due to an unrelated bug (#426) which appears when using Tango9.2 tango hosts. It was already fixed in develop, but we did not backport it to support-3.x.

I've proposed a backport now. See #486

cpascual commented 7 years ago

@reszelaz said:

taurusgui macrogui --tango-host=controls04:10000 # apparently this works as well!

Yes, we supported it in commit fb65f6c

jkotan commented 7 years ago

Hi,

I've just checked the patched version of taurus (3.7.3) with sardana from develop (newest). Running macrogui in debug mode

taurusgui macrogui --tango-host=haso228k.desy.de:10000 --taurus-log-level=debug

I get the following error:

MainThread     DEBUG    2017-07-04 17:12:40,920 haso228k.desy.de:10000.p09/macroserver/haso228k.01: SW Device State changed Uninitialized -> Running
MainThread     DEBUG    2017-07-04 17:12:40,941 MacroComboBox: Parent model changed to 'p09/macroserver/haso228k.01'
MainThread     DEBUG    2017-07-04 17:12:40,953 HistoryMacrosViewer: Parent model changed to 'p09/macroserver/haso228k.01'
MainThread     DEBUG    2017-07-04 17:12:40,955 TaurusMacroExecutorWidget.p09/macroserver/haso228k.01.Spock: Parent model changed to 'p09/macroserver/haso228k.01'
MainThread     DEBUG    2017-07-04 17:12:40,959 TaurusWidget: Parent model changed to 'p09/macroserver/haso228k.01'
MainThread     DEBUG    2017-07-04 17:12:40,960 MacroComboBox: Parent model changed to ''
MainThread     WARNING  2017-07-04 17:12:41,429 TaurusRootLogger: Cannot load Measurement group "'newmg2'": TypeError('expected string or buffer',)
MainThread     DEBUG    2017-07-04 17:12:41,433 TangoFactory: Could not create Database haso228k:10000
Traceback (most recent call last):
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangofactory.py", line 287, in getDatabase
ret = _Database(host,port)
  File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangodatabase.py", line 316, in __init__
self.dbObj = PyTango.Database(*pars)
ConnectionFailed: DevFailed[
DevError[
desc = TRANSIENT CORBA system exception: TRANSIENT_ConnectFailed
  origin = Connection::connect
  reason = API_CorbaException
severity = ERR]

DevError[
desc = Failed to connect to database on host haso228k with port 10000
  origin = Connection::connect
  reason = API_CantConnectToDatabase
severity = ERR]
]
MainThread     DEBUG    2017-07-04 17:12:41,439 taurus.qt.qtgui.resource.taurus_resource_utils: Theme icon "network-error" not supported. Trying to provide a fallback...
MainThread     DEBUG    2017-07-04 17:12:41,458 TaurusDbTreeWidget: Parent model changed to 'haso228k.desy.de:10000'
MainThread     DEBUG    2017-07-04 17:12:41,459 TaurusDbTreeWidget: Parent model changed to 'haso228k.desy.de:10000'
MainThread     WARNING  2017-07-04 17:12:41,740 TaurusRootLogger: Cannot load Measurement group "'newmg2'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-07-04 17:12:41,740 MacroBroker.p09/door/haso228k.02: ActiveMntGrp 'newmg2' is not defined

So it looks like something cut off 'haso228k.desy.de' to 'haso228k' and taurus/sardana fetches the name of MG from the remote host but it cannot load it.

jkotan commented 7 years ago

with taurus-4.0.4 from pull/479/head for

taurusgui macrogui --tango-host=haso228k.desy.de:10000

I get the same error with loading MG from the host (without alias, i.e. with a long name) as for 3.7.3 while

TANGO_HOST=haso228k.desy.de:10000 taurusgui macrogui

works fine, ascan and ct do not hang anymore.

reszelaz commented 7 years ago

@jkotan I finally managed to reproduce your problem. Now I also see this WARNING messages:

MainThread     WARNING  2017-07-05 16:27:06,817 TaurusRootLogger: Cannot load Measurement group "'mntgrp02'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-07-05 16:27:06,818 TaurusRootLogger: Cannot load Measurement group "'mntgrp03'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-07-05 16:27:06,902 TaurusRootLogger: Cannot load Measurement group "'mntgrp02'": TypeError('expected string or buffer',)
MainThread     WARNING  2017-07-05 16:27:06,903 TaurusRootLogger: Cannot load Measurement group "'mntgrp03'": TypeError('expected string or buffer',)

and the expconf is not able to load any of the measurement groups.

I'm almost sure that today I repeated exactly the same test as I was doing before posting https://github.com/taurus-org/taurus/issues/79#issuecomment-312879766 but this time it clearly failed. There must be something that I miss... Now we will focus on fixing it. We will keep ou informed.

cpascual commented 7 years ago

Hi @jkotan , could you confirm if the fix proposed by @reszelaz in sardana ( https://github.com/sardana-org/sardana/pull/492) works for you?

jkotan commented 7 years ago

Hi, Unfortunately, for me the problem remains. Actually, I found that the main reason of the problem is that on my master host (remote one) TANGO_HOST is defined as haso228k:10000 while the macrogui on client host knows it as haso228k.desy.de (client host does not know what is haso228k). So it would be good to have something on client host which fetch all the host aliases from the master host, i.e. we neither can require from the user to fetch/redefine all possible host aliases by him/herself nor to redefine all the tango host to long one. Thus, I found at least to problems: 1)

     MainThread     DEBUG    2017-07-06 10:08:21,515 TangoFactory: Could not create Database haso228k:10000
    Traceback (most recent call last):
      File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangofactory.py", line 287, in getDatabase
    ret = _Database(host,port)
      File "/home/jkotan/testinst/lib/python2.7/site-packages/taurus/core/tango/tangodatabase.py", line 316, in __init__
    self.dbObj = PyTango.Database(*pars)
    ConnectionFailed: DevFailed[
    DevError[
    desc = TRANSIENT CORBA system exception: TRANSIENT_ConnectFailed
      origin = Connection::connect
      reason = API_CorbaException
    severity = ERR]

    DevError[
    desc = Failed to connect to database on host haso228k with port 10000
      origin = Connection::connect
      reason = API_CantConnectToDatabase
    severity = ERR]
    ]

is caused by PreScanSnapshot on my master host which had a value:

[('tango://haso228k:10000/p09/nxsconfigserver/haso228k/Version',  'nexdatas_configuration')]

and

[('tango://haso228k.desy.de:10000/p09/nxsconfigserver/haso228k/Version',  'nexdatas_configuration')]

fixes this issue but we cannot require to use in all places the long names (the error disappear but MG is not loaded).

2) the second problem is that

mnt_grps = macro_server.getElementsOfType("MeasurementGroup")

returns

{'haso228k:10000/mntgrp/pool_haso228k/newmg3': MeasurementGroup(haso228k:10000/mntgrp/pool_haso228k/newmg3)}

which also contains a short host name and therefore

replies = mnt_grp_grps.read_attribute("configuration")

return None and loading of MGs fails.

But boths problems have the same origin but I don't see any fast fix for the issue.

cpascual commented 7 years ago

Hi @jkotan:

If I understand it correctly the problem is when using Partially Qualfied Domain Names instead of Fully Qualified Domain Names in the TANGO_HOST configuration of the machines involved in the acquisition.

but we cannot require to use in all places the long names

I should think about this more, but as a first thought I think I disagree with that. I think that it is reasonable to require FQDM in the Tango configuration if one intends to work with various Tango hosts that live in networks where partially qualified domain names are not properly resolved by all the involved machines.

But as I said, I would need to think more (and read other opinions).

Still, if we want to try to support PQDMs in taurus, I think that the approach is to try to somehow automatically convert whatever the user sets in its TANGO_HOST to FQDN when creating the full name of a TangoAuthority. In this way, all dict keys that make use of the TangoAuthority full name would be unambiguous.

jkotan commented 7 years ago

Hi Carlos, yes it is related with PQDM and FQDM. Our users like to use PQDM so in principle it is possible to allows them to use PQDM and FQDM simultaneously and use inside Sardana dictionaries only FQDM. This of course requires an additionally layer which maps PQDM <->FQDM , e. g. with use of /etc/hosts of the --tango-host. But I agree it may not be easy to implement it. For me the current implementation causes unambiguous so from my point of view it is even better to comment the --tango-host option.

cpascual commented 7 years ago

from my point of view it is even better to comment the --tango-host option

But... even if we removed the --tango-host option, wouldn't we have still the same problems if we mixed FQDN and PQDN via exports of TANGO_HOST in the different machines? (I would expect so)

jkotan commented 7 years ago

Yes, you are right. Therefore, I would prefer for fix it somehow in taurus/sardana. However, hosts with the same TANGO_HOST have usually a self-consistent host naming so without the --tango-host option macrogui it should be less error prompt. On the other hand you usually use the --tango-host option from the foreign computer which may not know anything about the 'TANGO_HOST' naming convention the client is going to connect. Usually, hosts with the same TANGO_HOST know all PQDM of each others while external client do not.

jkotan commented 7 years ago

With the proposed patch I have the same error when I exporting TANGO_HOST, i.e.

TANGO_HOST=haso228k.desy.de:10000 taurusgui macrogui
cpascual commented 7 years ago

Ok, so we agree on trying to fix it in taurus.

@cmft is working on a PR that makes use of socket.getfqdn(hostname) in the taurus.core.tango.tangovalidator to force the conversion of PQDN to FQDN as early as possible in Taurus

cpascual commented 7 years ago

See #488 . I would not be surprised if it does not will fix all PQDN vs FQDN issues (specially in sardana, which may have other parts that handle host names without using the Taurus Tango*NameValidator classes). But at least it may provide the foundation for fixing those issues

cpascual commented 7 years ago

IMHO the original issue ("taurusgui --tango-host=... does not work ") can be considered solved. The problem with mixing PQDN and FQDN can be considered an enhancement and treated independently (in #488 and other if necessary).