#7972 Release-monitoring openshift (staging): Error "must be owner of relation runs"
Closed: Fixed 3 months ago by zlopez. Opened 3 months ago by zlopez.

Hi,

with recent deployment I started to getting this error, according to developer of psycopg2 library (https://github.com/psycopg/psycopg2/issues/945), which is returning this error, this is returned by database.

This error is returned when doing migration using alembic in pre-deployment phase.

Is this issue database related?


Is that the full error? Whats the sql it's trying to do?

This sounds like a permission issue... like your user isn't an owner of a relation thats it's trying to reset or something.

Metadata Update from @kevin:
- Issue priority set to: Waiting on Assignee (was: Needs Review)

3 months ago

This is happening in pre-deployment pod without specific user set. This was used for long time for plenty of migrations, but it stopped working now.

Here is the full stack trace:

--> pre: Running hook pod ...
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
[anitya.config INFO] Loading Anitya configuration from /etc/anitya/anitya.toml
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 1ab95561edae -> e34988f3e2f4, Add statistics to run
Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: must be owner of relation runs


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/alembic-3", line 11, in <module>
    load_entry_point('alembic==1.0.10', 'console_scripts', 'alembic')()
  File "/usr/lib/python3.7/site-packages/alembic/config.py", line 540, in main
    CommandLine(prog=prog).main(argv=argv)
  File "/usr/lib/python3.7/site-packages/alembic/config.py", line 534, in main
    self.run_cmd(cfg, options)
  File "/usr/lib/python3.7/site-packages/alembic/config.py", line 514, in run_cmd
    **dict((k, getattr(options, k, None)) for k in kwarg)
  File "/usr/lib/python3.7/site-packages/alembic/command.py", line 276, in upgrade
    script.run_env()
  File "/usr/lib/python3.7/site-packages/alembic/script/base.py", line 475, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python3.7/site-packages/alembic/util/compat.py", line 156, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.7/site-packages/anitya/db/migrations/env.py", line 77, in <module>
    run_migrations_online()
  File "/usr/local/lib/python3.7/site-packages/anitya/db/migrations/env.py", line 69, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/lib/python3.7/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python3.7/site-packages/alembic/runtime/migration.py", line 361, in run_migrations
    step.migration_fn(**kw)
  File "/usr/local/lib/python3.7/site-packages/anitya/db/migrations/versions/e34988f3e2f4_add_statistics_to_run.py", line 22, in upgrade
    op.add_column("runs", sa.Column("total_count", sa.Integer(), default=0))
  File "<string>", line 8, in add_column
  File "<string>", line 3, in add_column
  File "/usr/lib/python3.7/site-packages/alembic/operations/ops.py", line 1904, in add_column
    return operations.invoke(op)
  File "/usr/lib/python3.7/site-packages/alembic/operations/base.py", line 345, in invoke
    return fn(self, operation)
  File "/usr/lib/python3.7/site-packages/alembic/operations/toimpl.py", line 131, in add_column
    operations.impl.add_column(table_name, column, schema=schema)
  File "/usr/lib/python3.7/site-packages/alembic/ddl/impl.py", line 230, in add_column
    self._exec(base.AddColumn(table_name, column, schema=schema))
  File "/usr/lib/python3.7/site-packages/alembic/ddl/impl.py", line 134, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1050, in _execute_ddl
    compiled,
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 399, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) must be owner of relation runs

[SQL: ALTER TABLE runs ADD COLUMN total_count INTEGER]
(Background on this error at: http://sqlalche.me/e/f405 )
--> pre: Failed
error: pre hook failed: the pre hook failed: , aborting rollout of release-monitoring/release-monitoring-web-216

For some reason the runs table was owned by 'anitya' instead of 'anitya_admin'.

I've changed it, can you test and see if that fixed it?

I was able to deploy Anitya now, but I'm getting similar error when Anitya is starting:

[Fri Jul 12 07:27:46.828868 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] [flask.app ERROR] Exception on / [GET]
[Fri Jul 12 07:27:46.828892 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] Traceback (most recent call last):
[Fri Jul 12 07:27:46.828895 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
[Fri Jul 12 07:27:46.828897 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     cursor, statement, parameters, context
[Fri Jul 12 07:27:46.828900 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
[Fri Jul 12 07:27:46.828908 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     cursor.execute(statement, parameters)
[Fri Jul 12 07:27:46.828911 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] psycopg2.ProgrammingError: permission denied for relation runs
[Fri Jul 12 07:27:46.828913 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] 
[Fri Jul 12 07:27:46.828915 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] 
[Fri Jul 12 07:27:46.828918 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] The above exception was the direct cause of the following exception:
[Fri Jul 12 07:27:46.828920 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] 
[Fri Jul 12 07:27:46.828922 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] Traceback (most recent call last):
[Fri Jul 12 07:27:46.828925 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
[Fri Jul 12 07:27:46.828927 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     response = self.full_dispatch_request()
[Fri Jul 12 07:27:46.828929 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
[Fri Jul 12 07:27:46.828932 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     rv = self.handle_user_exception(e)
[Fri Jul 12 07:27:46.828934 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
[Fri Jul 12 07:27:46.828937 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return original_handler(e)
[Fri Jul 12 07:27:46.828939 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
[Fri Jul 12 07:27:46.828941 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     reraise(exc_type, exc_value, tb)
[Fri Jul 12 07:27:46.828944 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
[Fri Jul 12 07:27:46.828946 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     raise value
[Fri Jul 12 07:27:46.828960 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
[Fri Jul 12 07:27:46.828963 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     rv = self.dispatch_request()
[Fri Jul 12 07:27:46.828965 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
[Fri Jul 12 07:27:46.828968 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return self.view_functions[rule.endpoint](**req.view_args)
[Fri Jul 12 07:27:46.828970 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/local/lib/python3.7/site-packages/anitya/ui.py", line 34, in index
[Fri Jul 12 07:27:46.828973 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return flask.render_template("index.html", current="index", total=total)
[Fri Jul 12 07:27:46.828975 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/templating.py", line 133, in render_template
[Fri Jul 12 07:27:46.828978 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     ctx.app.update_template_context(context)
[Fri Jul 12 07:27:46.828980 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib/python3.7/site-packages/flask/app.py", line 792, in update_template_context
[Fri Jul 12 07:27:46.828987 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     context.update(func())
[Fri Jul 12 07:27:46.828990 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/local/lib/python3.7/site-packages/anitya/app.py", line 125, in inject_variable
[Fri Jul 12 07:27:46.828992 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     cron_status = utilities.get_last_cron(Session)
[Fri Jul 12 07:27:46.828994 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/local/lib/python3.7/site-packages/anitya/lib/utilities.py", line 614, in get_last_cron
[Fri Jul 12 07:27:46.828997 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return models.Run.last_entry(session)
[Fri Jul 12 07:27:46.828999 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/local/lib/python3.7/site-packages/anitya/db/models.py", line 707, in last_entry
[Fri Jul 12 07:27:46.829002 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return query.first()
[Fri Jul 12 07:27:46.829004 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/query.py", line 3222, in first
[Fri Jul 12 07:27:46.829007 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     ret = list(self[0:1])
[Fri Jul 12 07:27:46.829009 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/query.py", line 3012, in __getitem__
[Fri Jul 12 07:27:46.829012 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return list(res)
[Fri Jul 12 07:27:46.829014 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/query.py", line 3324, in __iter__
[Fri Jul 12 07:27:46.829016 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return self._execute_and_instances(context)
[Fri Jul 12 07:27:46.829019 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/query.py", line 3349, in _execute_and_instances
[Fri Jul 12 07:27:46.829022 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     result = conn.execute(querycontext.statement, self._params)
[Fri Jul 12 07:27:46.829024 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
[Fri Jul 12 07:27:46.829026 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return meth(self, multiparams, params)
[Fri Jul 12 07:27:46.829029 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
[Fri Jul 12 07:27:46.829031 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     return connection._execute_clauseelement(self, multiparams, params)
[Fri Jul 12 07:27:46.829034 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
[Fri Jul 12 07:27:46.829036 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     distilled_params,
[Fri Jul 12 07:27:46.829039 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
[Fri Jul 12 07:27:46.829041 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     e, statement, parameters, cursor, context
[Fri Jul 12 07:27:46.829044 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
[Fri Jul 12 07:27:46.829049 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     util.raise_from_cause(sqlalchemy_exception, exc_info)
[Fri Jul 12 07:27:46.829052 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 399, in raise_from_cause
[Fri Jul 12 07:27:46.829054 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     reraise(type(exception), exception, tb=exc_tb, cause=cause)
[Fri Jul 12 07:27:46.829057 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
[Fri Jul 12 07:27:46.829059 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     raise value.with_traceback(tb)
[Fri Jul 12 07:27:46.829061 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
[Fri Jul 12 07:27:46.829064 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     cursor, statement, parameters, context
[Fri Jul 12 07:27:46.829066 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]   File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
[Fri Jul 12 07:27:46.829069 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]     cursor.execute(statement, parameters)
[Fri Jul 12 07:27:46.829071 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) permission denied for relation runs
[Fri Jul 12 07:27:46.829074 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] 
[Fri Jul 12 07:27:46.829076 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] [SQL: SELECT runs.total_count AS runs_total_count, runs.error_count AS runs_error_count, runs.ratelimit_count AS runs_ratelimit_count, runs.success_count AS runs_success_count, runs.created_on AS runs_created_on 
[Fri Jul 12 07:27:46.829079 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] FROM runs ORDER BY runs.created_on DESC 
[Fri Jul 12 07:27:46.829081 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638]  LIMIT %(param_1)s]
[Fri Jul 12 07:27:46.829084 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] [parameters: {'param_1': 1}]
[Fri Jul 12 07:27:46.829086 2019] [wsgi:error] [pid 15:tid 139947197585152] [client 10.131.0.1:48638] (Background on this error at: http://sqlalche.me/e/f405 )

ok, try now. I added a grant for select on that table...

The new version is now deployed on staging, thanks :thumbsup:

Metadata Update from @zlopez:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 months ago

Metadata Update from @zlopez:
- Issue status updated to: Open (was: Closed)

3 months ago

The issue is unfortunately back. This time, when I'm trying to insert into runs table.

Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
    cursor.execute(statement, parameters)
psycopg2.ProgrammingError: permission denied for relation runs


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/check_service.py", line 251, in <module>
    checker.run()
  File "/usr/local/bin/check_service.py", line 189, in run
    session.commit()
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 1027, in commit
    self.transaction.commit()
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 494, in commit
    self._prepare_impl()
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 473, in _prepare_impl
    self.session.flush()
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 2459, in flush
    self._flush(objects)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 2597, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 154, in reraise
    raise value
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/session.py", line 2557, in _flush
    flush_context.execute()
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 422, in execute
    rec.execute(self)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
    uow,
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 245, in save_obj
    insert,
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 1084, in _emit_insert_statements
    c = cached_connections[connection].execute(statement, multiparams)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
    distilled_params,
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 399, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 550, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) permission denied for relation runs

[SQL: INSERT INTO runs (total_count, error_count, ratelimit_count, success_count, created_on) VALUES (%(total_count)s, %(error_count)s, %(ratelimit_count)s, %(success_count)s, %(created_on)s)]
[parameters: {'total_count': 10, 'error_count': 0, 'ratelimit_count': 0, 'success_count': 0, 'created_on': datetime.datetime(2019, 7, 15, 14, 56, 43, 422437, tzinfo=tzutc())}]
(Background on this error at: http://sqlalche.me/e/f405 )

Yeah, I only added select. I can add insert, but do you know all the permissions you are going to need for that table so I can do them all at once?

Metadata Update from @kevin:
- Issue assigned to kevin

3 months ago

Anitya is only inserting and selecting from this table. So if you add insert, it should be enough.

I don't plan to do any updates or deletes from this table, this table will only hold the statistics for each run.

Done.

Please test and see if there's anything else needed here.

I can confirm, that everything is working as it should now :-)

Metadata Update from @zlopez:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

3 months ago

Login to comment on this ticket.

Metadata