JeffersonLab/rcdb

Problems accessing RCDB

Closed this issue · 12 comments

I can't seem to access RCDB from the ifarm or counting house.

I updated to the latest rcdb master, and get the following errors:

gluon108:
Traceback (most recent call last):
File "update_epics_adesh.py", line 242, in
db = rcdb.RCDBProvider("mysql://rcdb:@hallddb/rcdb")
File "/u/group/halld/Users/sdobbs/rcdb/python/rcdb/provider.py", line 58, in init
self.connect(connection_string, check_version)
File "/u/group/halld/Users/sdobbs/rcdb/python/rcdb/provider.py", line 113, in connect
raise rcdb.errors.SqlSchemaVersionError(message)
rcdb.errors.SqlSchemaVersionError: SQL schema version doesn't match. Probably RCDB is connecting with wrong, empty or older/newer DB

ifarm:
Traceback (most recent call last):
File "update_epics_adesh.py", line 242, in
db = rcdb.RCDBProvider("mysql://rcdb:@gluondb1/rcdb")
File "/group/halld/Users/sdobbs/rcdb/python/rcdb/provider.py", line 58, in init
self.connect(connection_string, check_version)
File "/group/halld/Users/sdobbs/rcdb/python/rcdb/provider.py", line 110, in connect
if not self.is_acceptable_sql_version():
File "/group/halld/Users/sdobbs/rcdb/python/rcdb/provider.py", line 68, in is_acceptable_sql_version
.filter(SchemaVersion.version == rcdb.SQL_SCHEMA_VERSION)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/query.py", line 2559, in scalar
ret = self.one()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/query.py", line 2528, in one
ret = list(self)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/query.py", line 2571, in iter
return self._execute_and_instances(context)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/query.py", line 2584, in _execute_and_instances
close_with_result=True)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/query.py", line 2575, in _connection_from_session
**kw)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/session.py", line 893, in connection
execution_options=execution_options)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/session.py", line 898, in _connection_for_bind
engine, execution_options)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/orm/session.py", line 334, in _connection_for_bind
conn = bind.contextual_connect()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/base.py", line 2039, in contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/base.py", line 2078, in _wrap_pool_connect
e, dialect, self)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/base.py", line 1405, in _handle_dbapi_exception_noconnection
exc_info
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/util/compat.py", line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/base.py", line 2074, in _wrap_pool_connect
return fn()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 376, in connect
return _ConnectionFairy._checkout(self)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 713, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 480, in checkout
rec = pool._do_get()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 1060, in _do_get
self._dec_overflow()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/util/langhelpers.py", line 60, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 1057, in _do_get
return self._create_connection()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 323, in _create_connection
return _ConnectionRecord(self)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 449, in init
self.connection = self.**connect()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/pool.py", line 607, in __connect
connection = self.__pool._invoke_creator(self)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/strategies.py", line 97, in connect
return dialect.connect(_cargs, _cparams)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/sqlalchemy/engine/default.py", line 385, in connect
return self.dbapi.connect(_cargs, _cparams)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/__init
.py", line 179, in connect
return MySQLConnection(_args, *_kwargs)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/connection.py", line 95, in init
self.connect(**kwargs)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/abstracts.py", line 719, in connect
self._open_connection()
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/connection.py", line 210, in _open_connection
self._ssl)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/connection.py", line 144, in _do_auth
self._auth_switch_request(username, password)
File "/gluonfs1/gluex/sim-recon/ccdb_1.06.01.Linux_RHEL6-x86_64-gcc4.9.2/python/mysql/connector/connection.py", line 177, in _auth_switch_request
raise errors.get_exception(packet)
sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError) 1045 (28000): Access denied for user 'rcdb'@'gluon108.jlab.org' (using password: YES)

Master branch may have a problem. A guess. Try version 0.00.

Had the same problem with 0.00
On Sat, Oct 8, 2016 at 4:00 PM Mark M. Ito notifications@github.com wrote:

Master branch may have a problem. A guess. Try version 0.00.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#43 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIJak-3d0iY1yv2DRoAhMN_J-rVBboQks5qx_ZOgaJpZM4KRvE-
.

Let me check what is happening... Gluon you say...

I can't login to Gluon108, but I've tried Gluon100. Everything seems working there with mysql://rcdb:@hallddb/rcdb.

I've tried the ifarm. It works there too.

The message

rcdb.errors.SqlSchemaVersionError: SQL schema version doesn't match. Probably RCDB is connecting with wrong, empty or older/newer DB

indeed corresponds to the case that there is a problem connecting to database.

There is the last line in the error report

sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError) 1045 (28000): Access denied for user 'rcdb'@'gluon108.jlab.org' (using password: YES)

I can connect from my desktop at the Lab to the Computer-Center-based server:

lorentz:marki:marki> mysql -hhallddb -urcdb rcdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 777172
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [rcdb]> show tables;
+--------------------------------+
| Tables_in_rcdb                 |
+--------------------------------+
| alembic_version                |
| board_configurations           |
| board_configurations_have_runs |
| board_installations            |
| board_installations_have_runs  |
| boards                         |
| condition_types                |
| conditions                     |
| crates                         |
| dac_presets                    |
| files                          |
| files_have_runs                |
| logs                           |
| readout_masks                  |
| readout_thresholds             |
| runs                           |
| schema_versions                |
| trigger_masks                  |
| trigger_thresholds             |
+--------------------------------+
19 rows in set (0.01 sec)

Note that I am not using a password.

And I can also connect from home to the outside-the-lab-facing server:

markdesk4:marki:marki> mysql -hhallddb.jlab.org -urcdb rcdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 66289
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [rcdb]> show tables
    -> ;
+--------------------------------+
| Tables_in_rcdb                 |
+--------------------------------+
| alembic_version                |
| board_configurations           |
| board_configurations_have_runs |
| board_installations            |
| board_installations_have_runs  |
| boards                         |
| condition_types                |
| conditions                     |
| crates                         |
| dac_presets                    |
| files                          |
| files_have_runs                |
| logs                           |
| readout_masks                  |
| readout_thresholds             |
| runs                           |
| schema_versions                |
| trigger_masks                  |
| trigger_thresholds             |
+--------------------------------+
19 rows in set (0.06 sec)

I was also able to connect via the MySQL command line but not using the
python API
On Sat, Oct 8, 2016 at 5:15 PM Mark M. Ito notifications@github.com wrote:

And I can also connect from home to the outside-the-lab-facing server:

markdesk4:marki:marki> mysql -hhallddb.jlab.org -urcdb rcdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 66289
Server version: 5.5.50-MariaDB MariaDB Server

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

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

MariaDB [rcdb]> show tables
-> ;
+--------------------------------+
| Tables_in_rcdb |
+--------------------------------+
| alembic_version |
| board_configurations |
| board_configurations_have_runs |
| board_installations |
| board_installations_have_runs |
| boards |
| condition_types |
| conditions |
| crates |
| dac_presets |
| files |
| files_have_runs |
| logs |
| readout_masks |
| readout_thresholds |
| runs |
| schema_versions |
| trigger_masks |
| trigger_thresholds |
+--------------------------------+
19 rows in set (0.06 sec)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#43 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIJaoV_RQQ2zimZAsax8DUhCHT8gZ69ks5qyBYGgaJpZM4KRvE-
.

OK, I found a case where I wasn't passing some parameters correctly, so
currently I can connect to gluondb1 without a problem, but am still getting
schema errors when connecting to hallddb with the python API

On Sat, Oct 8, 2016 at 5:23 PM Sean Dobbs seandobbs@gmail.com wrote:

I was also able to connect via the MySQL command line but not using the
python API
On Sat, Oct 8, 2016 at 5:15 PM Mark M. Ito notifications@github.com
wrote:

And I can also connect from home to the outside-the-lab-facing server:

markdesk4:marki:marki> mysql -hhallddb.jlab.org -urcdb rcdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 66289
Server version: 5.5.50-MariaDB MariaDB Server

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

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

MariaDB [rcdb]> show tables
-> ;
+--------------------------------+
| Tables_in_rcdb |
+--------------------------------+
| alembic_version |
| board_configurations |
| board_configurations_have_runs |
| board_installations |
| board_installations_have_runs |
| boards |
| condition_types |
| conditions |
| crates |
| dac_presets |
| files |
| files_have_runs |
| logs |
| readout_masks |
| readout_thresholds |
| runs |
| schema_versions |
| trigger_masks |
| trigger_thresholds |
+--------------------------------+
19 rows in set (0.06 sec)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#43 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIJaoV_RQQ2zimZAsax8DUhCHT8gZ69ks5qyBYGgaJpZM4KRvE-
.

My idea was that the problem comes when one tries to write to DB. But it works (checked on ifarm only).

Could you provide some small script exploiting the issue?

I wonder why the transcript of the original errors are so different between the two platforms.

Just now, on my desktop machine, lorentz.jlab.org, running RHEL7:

lorentz:marki:marki> source /group/halld/Software/build_scripts/gluex_env_jlab.csh
lorentz:marki:marki> which rcnd
/group/halld/Software/builds/Linux_RHEL7-x86_64-gcc4.8.5/rcdb/rcdb_0.00/rcnd
lorentz:marki:marki> echo $RCDB_CONNECTION
mysql://rcdb@hallddb.jlab.org/rcdb
lorentz:marki:marki> rcnd 11457 event_count
181137844

I tried my scripts again today, and was able to connect from the ifarm and gluons through the python API without a problem. Maybe I was specifying the wrong servers before... anyway, sorry for the confusion!