Corba_Exception due to polling of attribute

Hello All

I have one attribute whose name is : x/y/z/c01_gab_bbfilter_ch2
This attribute I make dynamically.

I start the device server, device server runs fine.

Now, I define the polling period of attribute which I made dynamically which is c01_ab_bbfilter_ch2. I have set the polling period of the above attribute as 100 ms.

Now I kill(Ctrl+C) the device server and try to start it again.
[b]Here is the error found.

Tango exception
Severity = ERROR
Error reason = API_AttrNotFound
Desc : c01_gab_bbfilter_ch2 attribute not found
Origin : MultiAttribute::get_attr_by_name

Tango exception
Severity = ERROR
Error reason = API_BadConfigurationProperty
Desc : Error when configuring polling for device LMC/C01/GAB, attr = c01_gab_bbfilter_ch2
Origin : Util::polling_configure

Received a CORBA_Exception
Exiting
terminate called after throwing an instance of ‘CORBA::OBJECT_NOT_EXIST’
Aborted (core dumped).[/b]

I was able to make attribute dynamically but after defining polling period of the attribute, when i try to start the ds again, it is not able to find the attribute and gives the above error.

This was working fine till yesterday i.e. wen i define the polling period of attribute, and start the device server, it was runnnig perfect but now suddenly it started giving above error.

Any suggestions ?

Thanks and Regards
TCS-GMRT TEAM

Hi,

a dynamic attribute is exactly what is says it is i.e. dynamic as opposed to static. It has to be recreated every time you restart the device server. This should be part of the initialisation phase i.e. executed at startup. By defining a polling period on your attribute it has been memorised in the database and Tango will start polling again when you restart the device server. If the attribute does not exist it will give the error you mentioned. Check that you recreate the dynamic attribute during the initialisation phase.

Andy

Hello Andy

I recreate the attribute everytime I start the device server.

Here is the scenario:

The dynamic attribute is present in the database. Now I start the device server, it starts fine. I stop the device server and start it again, device server runs fine.

Now i define the polling period of attribute and set it as 100 ms.
I stop the device server and try to start it again, it throws the below error.

Tango exception
Severity = ERROR
Error reason = API_AttrNotFound
Desc : c01_gab_bbfilter_ch2 attribute not found
Origin : MultiAttribute::get_attr_by_name

Tango exception
Severity = ERROR
Error reason = API_BadConfigurationProperty
Desc : Error when configuring polling for device LMC/C01/GAB, attr = c01_gab_bbfilter_ch2
Origin : Util::polling_configure

Received a CORBA_Exception
Exiting
terminate called after throwing an instance of ‘CORBA::OBJECT_NOT_EXIST’
Aborted (core dumped).

I check the table tango.property_attribute_device and here the attributes present were changed to NULL.
Hence it is not able to find the attribute.

BUt this happened after defining polling period of the attribute. Before defining polling period of attribute , it worked fine.

Also previously, I used to define the polling period of the attribute and start the ds again, it wont throw any error.
Now suddenly since last 2 days, it is misbehaving.

I would be obliged by your positive response.

Thanks and Regards
TCS-GMRT TEAM

Sounds like your database is losing properties. Check the history of the property to see when it was deleted. Does it happen randomly or when you delete the device?

Andy

Hello Andy

It has happened to start randomly.

Thanks and Regards
TCS-GMRT TEAM

Hi,

I have tried with one test Tango class and I don’t have problem (C++ Tango class using Tango 9.1). I have defined the dynamic attribute polling using Jive.

Here are some questions:

  • In which language is your Tango class (C++, Java, Python)?
  • If it’s C++, how do you program your dynamic attribute? Did you follow the HowTo about dynamic attribute?
  • How do you set the attribute polling (Using Jive or in the Tango class code)?
  • Which release of Tango are you using?

Regards

Emmanuel

Hello Manu

C++

Yes followed the method specified.

Using Jive

[quote]Which release of Tango are you using?

[/quote]

tango-8.1.2-patched

Thanks and Regards
TCS-GMRT TEAM

Hello all

Any suggestions for the above problem ?

Thanks and Regards
TCS-GMRT TEAM

Hello Manu/Andy

The problem mentioned above is still there . Tango Class is in C++ and I have followed all the steps mentioned for how to make dynamic attribute. I am using tango-8.1.2 patched version and I define the attribute polling using jive.

Thanks and Regards
TCS-GMRT TEAM

Can you send the code? Can you start the device server with DEBUG logging switched on “-v5” on the command line and send us the output at startup when the exception is thrown.

Strange because we use polled dynamic attributes here. Maybe you can run your server on the TANGO9 virtual machine and see if it still happens.

Andy

Hello Andy

I have attached the code snippet of dynamic attribute creation.

[quote]Can you start the device server with DEBUG logging switched on “-v5” on the command line and send us the output at startup when the exception is thrown.
[/quote]

I don’t how to switch on “-v5” and DEBUG logging. Can you please explain, so that I can try here and send you the output.

Thanks and Regards
TCS-GMRT TEAM

Hi,

when you start a device server without arguments it tells you the following e.g. TangoTest

usage : TangoTest instance_name [-v[trace level]] [-file=<file_name> | -nodb [-dlist ] ]

The -v sets the level of tracing, 5 is the highest. The output is then sent to stdout/stderr (I forgot which one). This is explained in appendix A12 on page 220 in the Tango manual (V9.1.0)

Andy

Hi Andy

I want to add one more thing, along with specifying polling of dynamic attribute, I am also setting the archive periodic event property of dynamic attribute as well.

So maybe not because of polling of attribute, but may be due to specifying of archive periodic event, the above error may be coming.

Thanks and Regards
TCS-GMRT TEAM

Hello,

As Andy said, the output of your device server when started with the option “-v5” and the source code will be very helpful to find out your problem.
But could you also :

  • If the name of the attribute to be created is defined via property, send us the property content (Jive window dump)
  • Do the following select once logged in your MySQL database after a “use tango” command:
select device,name,count,value from property_device where device='<your device name>'

Thank’s in advance

Manu

Hello Manu/Andy

I tried as said above, but i dont have ‘nodb’ command installed. I also tried without no db option, still file is not getting generated.

Regards
tgmrt

PLEASE READ THE DOCUMENTATION! Once you done so you will see the options -file and -nodb have nothing to do with setting the logging level. If you start your device server with the instance name and -v5 as follows you should get a lot of output on the command line (see below). Redirect this output to a file and send us the file.

Andy

goetz@pcandy:~$ TangoTest test -v5
Entering Logging::init
TANGO_LOG_PATH is /tmp/tango-goetz
cmd line logging level is 5
Logging::create_log_dir(/tmp/tango-goetz/TangoTest/test) returned 0
added console target (logging level set from cmd line)
Leaving Logging::init
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Connected to database
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering Util::server_already_running method
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Leaving Util::server_already_running method
1456416010 [140708167915328] DEBUG dserver/TangoTest/test calling Tango::NotifdEventSupplier::create()

1456416010 [140708167915328] DEBUG dserver/TangoTest/test Failed to import EventChannelFactory notifd/factory/pcandy from the Tango database
1456416010 [140708167915328] DEBUG dserver/TangoTest/test calling Tango::ZmqEventSupplier::create()
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Heartbeat thread Id = 5
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Tango object singleton constructed
1456416010 [140708167915328] DEBUG dserver/TangoTest/test doc_url property for class DServer is not defined in database
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering MultiClassAttribute constructor
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering MultiClassPipe constructor
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Device name : dserver/TangoTest/test
1456416010 [140708167915328] DEBUG dserver/TangoTest/test SubDevDiag::set_associated_device() entering …
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering MultiAttribute class constructor for device dserver/TangoTest/test
1456416010 [140708167915328] DEBUG dserver/TangoTest/test 0 attribute(s)
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Leaving MultiAttribute class constructor
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering DeviceImpl::init_logger
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Entering DeviceImpl::get_logger_i
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Leaving DeviceImpl::get_logger_i
1456416010 [140708167915328] DEBUG dserver/TangoTest/test Leaving DeviceImpl::init_logger

Hello Andy/Manu

Please find the attached Property_attribute.jpg

Please find the attached test2.txt after specifying polling and archive periodic event of the attribute.

Thanks and Regards
TCS-GMRT TEAM

Hello,

Still not able to conclude! When looking at your device server outputs, it looks like the list of attribute to be polled still
contains the dynamic attributes like gab_bbfilter_ch2 and other. But the output of the select I asked you to do does not show
these attributes in the value of the polled_attr property!!! Really strange.
We need another info from you.
In Jive in the device panel, select your database device (should be sys/database/2), then right click and start “Test Device”
In the command list, select “DbGetDataForServerCache”. In the Argin value box, type your full device server name and the host name
on which it is running (SubSystem_DS/Gab,). This should return a long list of strings.
Could you send us this list?

Regards

Emmanuel

Hello Manu

I tried the above step, but there is some problem in querying the tango database.
Please find the attached screen-shot.

Thanks and Regards
TCS-GMRT TEAM

Hello,

From the error message you got I have the feeling that your database is in a very strange state. In a Tango database, you should
have several stored procedures. The MySQL command “show procedure status” displays these stored procedure.
According to your error message, you even do not have the Tango main stored procedure named “ds_start”.
These stored procedures are used during a DS startup sequence. If they are not installed in the database, the DS will do a lot of
small requests to the database and this takes much more time.
We have first to solve this point before fixing the problem with your SubSystem_ds DS.
When you have downloaded, compiled and installed Tango, you should have in your install directory a file stored_proc.sql in the
folder <install_dir>/share/tango/db. With this file run the command (and type your root database password)

mysql -u root -p < stored_proc.sql

Then restart your Tango database server. On the “Test device” panel on your database device (see my previous post), go to the
attribute panel and try to read the attribute “StoredProcedureRelease”. The answer should be 1.8

Then redo the command as explained in my previous post.

Good luck

Emmanuel