Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random failing tests verdi quicksetup on SqlAlchemy python 3 #2950

Closed
sphuber opened this issue May 29, 2019 · 1 comment · Fixed by #2954
Closed

Random failing tests verdi quicksetup on SqlAlchemy python 3 #2950

sphuber opened this issue May 29, 2019 · 1 comment · Fixed by #2954

Comments

@sphuber
Copy link
Contributor

sphuber commented May 29, 2019

I have noticed this test failing multiple times the recent days, always on python 3 and SqlAlchemy. Not sure where it is coming from:

======================================================================
FAIL: test_quicksetup_from_config_file (aiida.backends.tests.cmdline.commands.test_setup.TestVerdiSetup)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/aiidateam/aiida_core/aiida/backends/tests/utils/configuration.py", line 105, in decorated_function
    function(*args, **kwargs)
  File "/home/travis/build/aiidateam/aiida_core/aiida/backends/tests/cmdline/commands/test_setup.py", line 90, in test_quicksetup_from_config_file
    self.assertClickResultNoException(result)
  File "/home/travis/build/aiidateam/aiida_core/aiida/backends/testbase.py", line 187, in assertClickResultNoException
    self.assertIsNone(cli_result.exception, ''.join(traceback.format_exception(*cli_result.exc_info)))
AssertionError: SystemExit(<ExitCode.CRITICAL: 1>,) is not None : Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "user" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/travis/build/aiidateam/aiida_core/aiida/cmdline/commands/cmd_setup.py", line 72, in setup
    backend.migrate()
  File "/home/travis/build/aiidateam/aiida_core/aiida/orm/implementation/django/backend.py", line 53, in migrate
    migrate_database()
  File "/home/travis/build/aiidateam/aiida_core/aiida/backends/djsite/utils.py", line 54, in migrate_database
    call_command('migrate')
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 83, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/migrations/loader.py", line 52, in __init__
    self.build_graph()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/migrations/loader.py", line 210, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 65, in applied_migrations
    self.ensure_schema()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 52, in ensure_schema
    if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 254, in cursor
    return self._cursor()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 229, in _cursor
    self.ensure_connection()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/postgresql/base.py", line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  role "user" does not exist
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/testing.py", line 326, in invoke
    cli.main(args=args or (), prog_name=prog_name, **extra)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/travis/build/aiidateam/aiida_core/aiida/cmdline/commands/cmd_setup.py", line 173, in quicksetup
    ctx.invoke(setup, **setup_parameters)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/travis/build/aiidateam/aiida_core/aiida/cmdline/commands/cmd_setup.py", line 75, in setup
    'database migration failed, probably because connection details are incorrect:\n{}'.format(exception))
  File "/home/travis/build/aiidateam/aiida_core/aiida/cmdline/utils/echo.py", line 114, in echo_critical
    sys.exit(ExitCode.CRITICAL)
SystemExit: ExitCode.CRITICAL

@ltalirz
Copy link
Member

ltalirz commented Jun 2, 2019

I see, I think the problem is that the backend is not properly set. Will make PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants