Installing Tango 9.3.4 on Ubuntu LTS 20.04

Profiting from the break from zoom meetings I tried out the latest version (V9.3.4) of the source code release of Tango controls on a virgin Ubuntu LTS 20.04. Here are my notes:

  1. Download source tarball from github:
   wget https://github.com/tango-controls/TangoSourceDistribution/releases/download/9.3.4/tango-9.3.4.tar.gz
  1. Unpack in a sub-directory called tango (so I can test multiple versions in the future):
   mkdir tango
   tar xzvf tango-9.3.4.tar.gz
  1. Install packages required to compile tango-controls:
   sudo apt-get install g++ openjdk-8-jdk mariadb-server libmariadb-dev zlib1g-dev libomniorb4-dev libcos4-dev omniidl libzmq-dev make
  1. Start mariadb :
   sudo service mariadb start
  1. Set password for mariabdb root user to ‘mypassword’:
   sudo mariadb -u root
   ALTER USER 'root'@'localhost' IDENTIFIED BY 'mypassword';
   UPDATE mysql.user SET authentication_string = '' WHERE user = 'root';
   UPDATE mysql.user SET plugin = '' WHERE user = 'root';
  1. Configure tango-controls to build and install in /usr/local/tango:
   ./configure --enable-java=yes --enable-mariadb=yes --enable-dbserver=yes --enable-dbcreate=yes --with-mysql-admin=root --with-mysql-admin-passwd='mypassword' --prefix=/usr/local/tango
  1. Compile tango-controls:
   make
  1. Install tango-controls:
   sudo make install
  1. Add following lines to start script /usr/local/tango/bin/tango:
   sudo gedit /usr/local/tango/bin/tango
   export MYSQL_USER=root
   export MYSQL_PASSWORD=mypassword
  1. Start tango-controls database server:
    sudo /usr/local/tango/bin/tango start
  1. Start test device server:
    /usr/local/tango/bin/TangoTest test &
  1. Test jive:
    export TANGO_HOST=localhost:10000
    /usr/local/tango/bin/jive
  1. You can now define your device servers and devices, start and test them - ENJOY!

Two issues that will need fixing in the next releases are:

1. Add the MYSQL_USER and MYSQL_PASSWORD to the tango startup script
2. Suppress the TANGO_HOST undefined message which is not relevant

Questions and feedback welcomed!

Cheers

Andy

Hi Andy,

I’ve given this a go and it seems to work - just two minor points:

  1. The libzmq-dev package does not seem to be available any more, at least on my freshly-downloaded Ubuntu 20.04.4 .iso. I used libzmq3-dev instead.

  2. In step 11 (actually there are two steps numbered 11!) the TANGO_HOST env. var. needs to be set before the TangoTest device server is started.

Other than that it works well!

Thanks,
Jack

Hi Nico,
looks like the package list in your PC is not updated. Try executing “sudo apt-get update” before…

Hello,
I try 5. Set password for mariabdb root user to ‘mypassword’:
I get an error ERROR 1356 (HY000) View ‘mysql.user’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them.
Where is mistake.? does anyone know?
:open_mouth:

Hi Dariusz,

Do you know what version of MariaDB you are using?
On recent MariaDB versions, mysql.user is a view rather than a table. Please have a look at this stackoverflow answer: https://stackoverflow.com/a/64841540/4215114
It looks like we’ll have to update our documentation for the recent MariaDB version. :wink:

Hello!

Relatively new to TANGO here and have decided to build and install from scratch on a RHEL7 machine.
I have followed the instructions in TANGO 9.3.4 README and was about to work through all of the build/install issue. The build configuration command line:

The Configuration resulted in:

[quote]Configuration (tango):

Source code location:       ..
Version:                    9.3.4
Compiler:                   gcc,g++

OMNIORB PATH:               /usr
OMNIORB VERSION:

ZMQ PATH:                   /usr/local
ZMQ VERSION:                4.3.2

JAVA PATH:                  /usr/bin/java
JAVA VERSION:               1.8.0_181

Database MARIADB
  CLIENT LIB:               -lmariadb
  CLIENT VERSION:
  VERSION:                  10.10.2-MariaDB
  CONNECTION:               OK

build:
libraries: yes
java application: yes
access control server: yes
database server: yes
database schema create: yes

Please check whether the configuration I detected matches what you
would like to have.

[/quote]

The problem occurs in the Runtime and is database related. I try:

[quote]-bash-4.2$ DataBaseds 2 -ORBendPoint giop:tcp::10000
main(): arrived
main(): export DataBase as named servant (name=database)
Received a CORBA::Exception
Tango exception
Severity = ERROR
Error reason = DB_DeviceNotDefined
Desc : device sys/database/2 not defined in the database !
Origin : DataBase::ExportDevice()

Exiting[/quote]

And can go no further (TantoTest test fails)

I know very little about databases but could do a basic query. It appears that a tango as well as test database were created

[quote]Your MariaDB connection id is 550
Server version: 10.10.2-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
| tango |
| test |
±-------------------+
6 rows in set (0.003 sec)

[/quote]

Not sure what to try next. Has anyone else run into this problem?

UPDATE: This problem was resolved. For reasons still not clear to me, I needed to run the update_db.sql as suggested by my build output. This solved the problem with my DataBaseds errors.

Do you have the TANGO_HOST environment variable defined?
Maybe it’s just a matter of doing

export TANGO_HOST=my_host:10000

before launching the Database server?

[quote=“Reynald”]Do you have the TANGO_HOST environment variable defined?
Maybe it’s just a matter of doing

export TANGO_HOST=my_host:10000

before launching the Database server?[/quote]

Thanks for your response ..

The problem was resolved today when I noticed my build output suggested I run “update_db.sql”. I did this and now I can start the TANGO database.

However, I ran into a problem with the next step:

TANGO_HOST is setup properly ( I hope ):

I tried using a “verbose” mode but its not too helpful:

I am not sure what to try next ..

Hi,

You can run

TangoTest -?

to see all the instances of Test device server defined in your Tango Database.
If none is defined, you need to add a new instance, following this documentation: https://tango-controls.readthedocs.io/en/latest/tutorials-and-howtos/how-tos/how-to-start-device-server.html

You can also use the tango_admin tool to define some device servers in the Tango database. For instance, to add a new TangoTest instance named my_test, managing 1 device of TangoTest class named my/tg_test/device, you can run:

tango_admin --add-server TangoTest/my_test TangoTest my/tg_test/device

Hoping this helps,
Reynald