DB exception: error opening DB mysql

Post Reply
nmarchini
OpenVpn Newbie
Posts: 4
Joined: Mon Jun 18, 2018 3:29 pm

DB exception: error opening DB mysql

Post by nmarchini » Thu Aug 02, 2018 3:16 pm

I have followed the documentation to create databases on an external database platform (we are using MySQL RDS).

This is the documentation I have been using.
https://docs.openvpn.net/command-line/c ... d-backups/

I created the .my.cnf and the sym link to it and can run the mysqql -h <servername>/<db_name> command and it connects to the RDS instance with no problem.

When I try and start openvpnas it give an error

(OperationalError) (1045, "Access denied for user 'root'@'10.210.0.155' (using password: NO)")

Full Log output

Code: Select all

2018-08-02 13:19:05+0000 [-] Log opened.
2018-08-02 13:19:05+0000 [-] twistd 9.0.0 (/usr/local/openvpn_as/bin/python 2.7.11) starting up.
2018-08-02 13:19:05+0000 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2018-08-02 13:19:05+0000 [-] rmdir /usr/local/openvpn_as/etc/db_push
2018-08-02 13:19:05+0000 [-] *** MyError.report ***
2018-08-02 13:19:05+0000 [-] Stack Traceback
2018-08-02 13:19:05+0000 [-] ('/usr/local/openvpn_as/lib/python2.7/site-packages/Twisted-9.0.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py', 323, '_runCallbacks', 'self.result = callback(self.result, *args, **kw)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 104, 'cb2', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 56, 'get_active_config_profile', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 575, 'get_active_profile', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 531, 'get_active', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 521, '_get_active_raise', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 516, '_get_active_noraise', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbwrap.py', 87, 'db', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 55, '<lambda>', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 82, '__init__', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbase.py', 152, 'init', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbase.py', 136, 'init', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/schema.py', 2590, 'create_all', 'tables=tables)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py', 2298, '_run_visitor', 'conn = self.contextual_connect(close_with_result=False)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py', 2489, 'contextual_connect', 'self.pool.connect(),')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 236, 'connect', 'return _ConnectionFairy(self).checkout()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 401, '__init__', 'rec = self._connection_record = pool._do_get()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 746, '_do_get', 'con = self._create_connection()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 189, '_create_connection', 'return _ConnectionRecord(self)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 282, '__init__', 'self.connection = self.__connect()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 344, '__connect', 'connection = self.__pool._creator()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/strategies.py', 80, 'connect', 'return dialect.connect(*cargs, **cparams)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py', 281, 'connect', 'return self.dbapi.connect(*cargs, **cparams)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/MySQLdb/__init__.py', 81, 'Connect', 'return Connection(*args, **kwargs)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/MySQLdb/connections.py', 193, '__init__', 'super(Connection, self).__init__(*args, **kwargs2)')
2018-08-02 13:19:05+0000 [-] Failover initialization error: DB exception: error opening DB mysql://openvpnrds-dev.ckp68cxbhbcs.us-east-1.rds.amazonaws.com/config: (OperationalError) (1045, "Access denied for user 'root'@'10.210.0.155' (using password: NO)") None None: internet/defer:323,sagent/svcset:104,sagent/svcset:56,db/confdb:575,db/confdb:531,db/confdb:521,db/confdb:516,db/dbwrap:87,sagent/svcset:55,db/confdb:82,db/dbase:152,db/dbase:136,sqlalchemy/schema:2590,engine/base:2298,engine/base:2489,sqlalchemy/pool:236,sqlalchemy/pool:401,sqlalchemy/pool:746,sqlalchemy/pool:189,sqlalchemy/pool:282,sqlalchemy/pool:344,engine/strategies:80,engine/default:281,MySQLdb/__init__:81,MySQLdb/connections:193 (sqlalchemy.exc.OperationalError)
2018-08-02 13:19:05+0000 [-] True
2018-08-02 13:19:05+0000 [-] Will continue with non-failover setup
2018-08-02 13:19:05+0000 [-] ACCESS SERVER starting, version=2.5
2018-08-02 13:19:05+0000 [-] Max open files set to (4096, 4096)
2018-08-02 13:19:05+0000 [-] /etc/resolv.conf changed, reparsing
2018-08-02 13:19:05+0000 [-] Resolver added ('10.210.0.2', 53) to server list
2018-08-02 13:19:05+0000 [-] *** MyError.report ***
2018-08-02 13:19:05+0000 [-] Stack Traceback
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 147, 'transition', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 622, '__init__', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 572, 'init_components', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 254, 'init_config_db_module', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbwrap.py', 87, 'db', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/sagent/svcset.py', 253, '<lambda>', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/confdb.py', 82, '__init__', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbase.py', 152, 'init', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/pyovpn/db/dbase.py', 136, 'init', None)
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/schema.py', 2590, 'create_all', 'tables=tables)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py', 2298, '_run_visitor', 'conn = self.contextual_connect(close_with_result=False)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py', 2489, 'contextual_connect', 'self.pool.connect(),')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 236, 'connect', 'return _ConnectionFairy(self).checkout()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 401, '__init__', 'rec = self._connection_record = pool._do_get()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 746, '_do_get', 'con = self._create_connection()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 189, '_create_connection', 'return _ConnectionRecord(self)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 282, '__init__', 'self.connection = self.__connect()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/pool.py', 344, '__connect', 'connection = self.__pool._creator()')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/strategies.py', 80, 'connect', 'return dialect.connect(*cargs, **cparams)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py', 281, 'connect', 'return self.dbapi.connect(*cargs, **cparams)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/MySQLdb/__init__.py', 81, 'Connect', 'return Connection(*args, **kwargs)')
2018-08-02 13:19:05+0000 [-] ('build/bdist.linux-x86_64/egg/MySQLdb/connections.py', 193, '__init__', 'super(Connection, self).__init__(*args, **kwargs2)')
2018-08-02 13:19:05+0000 [-] Server agent initialization failed: DB exception: error opening DB mysql://openvpnrds-dev.ckp68cxbhbcs.us-east-1.rds.amazonaws.com/config: (OperationalError) (1045, "Access denied for user 'root'@'10.210.0.155' (using password: NO)") None None: sagent/svcset:147,sagent/svcset:622,sagent/svcset:572,sagent/svcset:254,db/dbwrap:87,sagent/svcset:253,db/confdb:82,db/dbase:152,db/dbase:136,sqlalchemy/schema:2590,engine/base:2298,engine/base:2489,sqlalchemy/pool:236,sqlalchemy/pool:401,sqlalchemy/pool:746,sqlalchemy/pool:189,sqlalchemy/pool:282,sqlalchemy/pool:344,engine/strategies:80,engine/default:281,MySQLdb/__init__:81,MySQLdb/connections:193 (sqlalchemy.exc.OperationalError)
2018-08-02 13:19:05+0000 [-] Main loop terminated.
2018-08-02 13:19:05+0000 [-] Server Shut Down.


novaflash
I should be on the dev team.
Posts: 755
Joined: Fri Apr 13, 2012 8:43 pm

Re: DB exception: error opening DB mysql

Post by novaflash » Thu Aug 02, 2018 5:15 pm

Hello,

> (OperationalError) (1045, "Access denied for user 'root'@'10.210.0.155' (using password: NO)")

Hm well, it seems to not want to authenticate with a password, and that's probably really necessary, so I'm guessing the my.cnf file isn't working right somehow? I'd suggest reading that page again real closely, perhaps you can spot a flaw. Pretty sure those instructions work to be honest.

nmarchini
OpenVpn Newbie
Posts: 4
Joined: Mon Jun 18, 2018 3:29 pm

Re: DB exception: error opening DB mysql

Post by nmarchini » Fri Aug 03, 2018 10:17 am

I've been over it a fews time but today is a new so fresh eyes may help.

novaflash
I should be on the dev team.
Posts: 755
Joined: Fri Apr 13, 2012 8:43 pm

Re: DB exception: error opening DB mysql

Post by novaflash » Fri Aug 03, 2018 11:10 am

Maybe you messed with account data in the as.conf file so it's running under another account, therefore doesn't see the .my.cnf file, therefore doesn't use those values?

Post Reply