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

Error when connecting #501

Closed
Jeetah opened this issue Jun 1, 2016 · 5 comments
Closed

Error when connecting #501

Jeetah opened this issue Jun 1, 2016 · 5 comments

Comments

@Jeetah
Copy link

Jeetah commented Jun 1, 2016

I often get this error when connecting to a Postgres DB:

SQL Error [42501]: ERROR: permission denied for relation pg_authid
org.postgresql.util.PSQLException: ERROR: permission denied for relation pg_authid

Wrong configuration? Or bug?

@serge-rider
Copy link
Member

Please post error stacktrace (from Error Log view).
does this error just appear in the Error Log or you see the error dialog which block UI?
This error may happen with databases with limited permissions. But it shouldn't lead to any problems, it's a kind of warning.

serge-rider added a commit that referenced this issue Jun 2, 2016
serge-rider added a commit that referenced this issue Jun 2, 2016
@serge-rider
Copy link
Member

I've added an extra workaround for PG security errors.
Please check it in EA version (http://dbeaver.jkiss.org/files/ea/).

@Jeetah
Copy link
Author

Jeetah commented Jun 2, 2016

Stacktrace:

org.postgresql.util.PSQLException: ERROR: permission denied for relation pg_authid
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:161)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:155)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCPreparedStatementImpl.execute(JDBCPreparedStatementImpl.java:252)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCPreparedStatementImpl.executeStatement(JDBCPreparedStatementImpl.java:196)
at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache.loadObjects(JDBCObjectCache.java:103)
at org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache.getAllObjects(JDBCObjectCache.java:70)
at org.jkiss.dbeaver.ext.postgresql.PostgreUtils.getObjectById(PostgreUtils.java:127)
at org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase.getDBA(PostgreDatabase.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jkiss.dbeaver.runtime.properties.ObjectPropertyDescriptor.readValue(ObjectPropertyDescriptor.java:227)
at org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract$PropertySheetLoadService.evaluate(PropertySourceAbstract.java:330)
at org.jkiss.dbeaver.runtime.properties.PropertySourceAbstract$PropertySheetLoadService.evaluate(PropertySourceAbstract.java:1)
at org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:82)
at org.jkiss.dbeaver.ui.LoadingJob.run(LoadingJob.java:69)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:103)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

@conceptrat
Copy link

conceptrat commented Jun 8, 2016

Looking at the PostgreSQL documentation the "pg_authid" catalog paragraph 2...

Since this catalog contains passwords, it must not be publicly readable. pg_roles is a publicly readable view on pg_authid that blanks out the password field.

I think perhaps the correct way to access the roles is via the "pg_roles" view. I can see a comment in the Dbeaver codebase about fixing this. Perhaps this would be it?

@serge-rider
Copy link
Member

Many PG system objects refers pg_authid (by oid), pg_roles can't substitute it.
I've just suppressed error dialog but actually this "access denied" error will happen on some databases. Generally it won't lead to any significant troubles.

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

No branches or pull requests

3 participants