Bug 44441 - SQL OperationalError during App installation
SQL OperationalError during App installation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: App Center
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.2-3
Assigned To: Dirk Wiesenthal
Felix Botner
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-21 14:51 CEST by Florian Best
Modified: 2017-11-28 17:26 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number: 2017042021000803, 2017050521000572, 2017102121000399
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2017-04-21 14:51:54 CEST
Version: 4.2-0 errata2 (Lesum)

Execution of command 'appcenter/docker/progress' has failed:
Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 249, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 309, in _thread
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 375, in invoke_docker
    result['success'] = action.call(app=app, username=self.username, password=self.password, **kwargs)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 227, in call
    return obj.call_with_namespace(namespace)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 233, in call_with_namespace
    result = self.main(namespace)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 70, in main
    return self.do_it(args)
  File "%PY2.7%/univention/appcenter/actions/install_base.py", line 110, in do_it
    self._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/docker_install.py", line 67, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 83, in _do_it
    self._register_database(app)
  File "%PY2.7%/univention/appcenter/actions/register.py", line 342, in _register_database
    database_connector.create_database()
  File "%PY2.7%/univention/appcenter/database.py", line 184, in create_database
    self.create_db_and_user(password)
  File "%PY2.7%/univention/appcenter/database.py", line 282, in create_db_and_user
    self.execute('CREATE DATABASE IF NOT EXISTS `%s`' % self.escape(self.get_db_name()))
  File "%PY2.7%/univention/appcenter/database.py", line 279, in escape
    return self.get_root_connection().escape(unicode(value))
  File "%PY2.7%/univention/appcenter/database.py", line 257, in get_root_connection
    self._connection = mysql.connect(host='localhost', user='root', passwd=passwd)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
Comment 1 Florian Best univentionstaff 2017-05-10 16:04:35 CEST
Version: 4.2-0 errata10 (Lesum)
Die Ausführung des Kommandos appcenter/docker/progress ist fehlgeschlagen:

Traceback (most recent call last):
  File "%PY2.7%/univention/management/console/base.py", line 249, in execute
    function.__func__(self, request, *args, **kwargs)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 318, in _response
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/mixins.py", line 149, in progress
    ret = progress_obj.poll()
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 309, in _thread
    result = _multi_response(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 192, in _response
    return function(self, request)
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 440, in _response
    return list(function(self, iterator, *nones))
  File "%PY2.7%/univention/management/console/modules/decorators.py", line 286, in _fake_func
    yield function(self, *args)
  File "%PY2.7%/univention/management/console/modules/appcenter/__init__.py", line 375, in invoke_docker
    result['success'] = action.call(app=app, username=self.username, password=self.password, **kwargs)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 227, in call
    return obj.call_with_namespace(namespace)
  File "%PY2.7%/univention/appcenter/actions/__init__.py", line 233, in call_with_namespace
    result = self.main(namespace)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 70, in main
    return self.do_it(args)
  File "%PY2.7%/univention/appcenter/actions/install_base.py", line 110, in do_it
    self._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/docker_install.py", line 67, in _do_it
    ret = super(Install, self)._do_it(app, args)
  File "%PY2.7%/univention/appcenter/actions/install.py", line 83, in _do_it
    self._register_database(app)
  File "%PY2.7%/univention/appcenter/actions/register.py", line 342, in _register_database
    database_connector.create_database()
  File "%PY2.7%/univention/appcenter/database.py", line 178, in create_database
    if self.db_user_exists():
  File "%PY2.7%/univention/appcenter/database.py", line 275, in db_user_exists
    cursor = self.execute("SELECT EXISTS (SELECT DISTINCT user FROM mysql.user WHERE user = '%s')" % self.escape(self.get_db_user()))
  File "%PY2.7%/univention/appcenter/database.py", line 279, in escape
    return self.get_root_connection().escape(unicode(value))
  File "%PY2.7%/univention/appcenter/database.py", line 257, in get_root_connection
    self._connection = mysql.connect(host='localhost', user='root', passwd=passwd)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)")
Comment 2 Florian Best univentionstaff 2017-10-23 16:49:19 CEST
Version: 4.2-2 errata203 (Lesum)

Remark: Tritt bei der Installation der WordPress App auf.

OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")
Comment 3 Dirk Wiesenthal univentionstaff 2017-11-21 16:56:43 CET
Fixed in
  univention-appcenter (6.0.10-22)
Comment 4 Dirk Wiesenthal univentionstaff 2017-11-21 16:57:48 CET
(Just a better error message - and we do not receive 500, instead 418)
Comment 5 Florian Best univentionstaff 2017-11-21 17:51:00 CET
(In reply to Dirk Wiesenthal from comment #4)
> (Just a better error message - and we do not receive 500, instead 418)
No, we don't.
From management/univention-appcenter/umc/python/appcenter/sanitizers.py:
 65 »   if isinstance(exc, (Abort, SystemError, AppcenterServerContactFailed)):
 66 »   »   MODULE.error(str(exc))
 67 »   »   raise umcm.UMC_Error(str(exc), status=500)

→ The status is 500 and should remain 500! Using 418 (or any of the other codes from python/appcenter/exceptions.py) would violate the HTTP semantics.
Comment 6 Dirk Wiesenthal univentionstaff 2017-11-21 17:57:28 CET
(In reply to Florian Best from comment #5)
> (In reply to Dirk Wiesenthal from comment #4)
> > (Just a better error message - and we do not receive 500, instead 418)
> No, we don't.
> From management/univention-appcenter/umc/python/appcenter/sanitizers.py:
>  65 »   if isinstance(exc, (Abort, SystemError,
> AppcenterServerContactFailed)):
>  66 »   »   MODULE.error(str(exc))
>  67 »   »   raise umcm.UMC_Error(str(exc), status=500)
> 
> → The status is 500 and should remain 500! Using 418 (or any of the other
> codes from python/appcenter/exceptions.py) would violate the HTTP semantics.

I meant the code sent to Univention after an installation. 500 is traceback, 400+ is defined in python/appcenter/exceptions.py. 418 is DatabaseConnectorError
Comment 7 Felix Botner univentionstaff 2017-11-22 14:38:59 CET
please rebuild in ucs4.2-3
Comment 8 Dirk Wiesenthal univentionstaff 2017-11-23 17:52:17 CET
Rebuilt as
  univention-appcenter 6.0.11-1A~4.2.0.201711231631
Comment 9 Felix Botner univentionstaff 2017-11-24 13:11:17 CET
OK, QA'ed with 4.2-2

OK - error dialog if mysql is down
OK - changelog
Comment 10 Erik Damrose univentionstaff 2017-11-28 17:26:37 CET
UCS 4.2-3 has been released.