1

Topic: re-occurence of RC db access error

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Linux/BSD distribution name and version: Centos 6.5, Linux 3.14.4-x86_64-linode40 on x86_64
- Related log if you're reporting an issue: maillog
====

The issue has resurfaced, but this time with a slightly different msg:

May 29 09:28:43 mail roundcube: DB Error: [7] ERROR:  permission denied for relation cache_shared (SQL Query: DELETE FROM cache_shared WHERE expires < now()) in /var/www/roundcubemail-1.0.1/program/lib/Roundcube/rcube_db.php on line 467 (GET /mail/?_email=root%40mail.garden-lan.com&_action=photo&_task=addressbook)

I see no obvious issues with using RC other than I see those errors in the logs. thanks.

- Fabian S.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: re-occurence of RC db access error

Granting DLETE privilege on table "cache_shared" to Roundcube SQL user "roundcube" should fix this issue.

3

Re: re-occurence of RC db access error

That did not work. Same error observed.

4

Re: re-occurence of RC db access error

*) Are you sure it raises the SAME error?
*) How can i reproduce this issue?
*) Please show me output of below SQL command:

pgsql> \c roundcubemail;
pgsql> \z

*) Does below one work for you?

pgsql> GRANT SELECT,INSERT,UPDATE,DELETE ON cache_shared,system TO roundcube;

5

Re: re-occurence of RC db access error

Last few days errors:
May 28 16:38:27 mail roundcube: DB Error: [7] ERROR:  permission denied for relation cache_shared (SQL Query: DELETE FROM cache_shared WHERE expires < now()) in /var/www/roundcubemail-1.0.1/program/lib/Roundcube/rcube_db.php on line 467 (GET /mail/?_task=settings&_action=edit-folder&_mbox=&_framed=1)
May 29 09:28:43 mail roundcube: DB Error: [7] ERROR:  permission denied for relation cache_shared (SQL Query: DELETE FROM cache_shared WHERE expires < now()) in /var/www/roundcubemail-1.0.1/program/lib/Roundcube/rcube_db.php on line 467 (GET /mail/?_email=root%40mail.garden-lan.com&_action=photo&_task=addressbook)
May 30 09:41:06 mail roundcube: DB Error: [7] ERROR:  permission denied for relation cache_shared (SQL Query: DELETE FROM cache_shared WHERE expires < now()) in /var/www/roundcubemail-1.0.1/program/lib/Roundcube/rcube_db.php on line 467 (GET /mail/?_task=mail&_err=session)

Not sure how to reproduce. I just leave RC open and use it casually and eventually the error shows up. Haven't a clear cause based on my actions yet.

output of your \z command:
postgres=# \c roundcubemail
You are now connected to database "roundcubemail" as user "postgres".
roundcubemail=# \z
                                       Access privileges
Schema |        Name         |   Type   |     Access privileges     | Column ac
cess privileges
--------+---------------------+----------+---------------------------+----------
----------------
public | cache               | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | cache_index         | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | cache_messages      | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | cache_shared        | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=d/postgres      |
public | cache_thread        | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | contactgroupmembers | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | contactgroups       | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | contactgroups_seq   | sequence | postgres=rwU/postgres    +|
        |                     |          | roundcube=rwU/postgres    |
public | contacts            | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | contacts_seq        | sequence | postgres=rwU/postgres    +|
        |                     |          | roundcube=rwU/postgres    |
public | dictionary          | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | identities          | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | identities_seq      | sequence | postgres=rwU/postgres    +|
        |                     |          | roundcube=rwU/postgres    |
public | searches            | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | searches_seq        | sequence | postgres=rwU/postgres    +|
        |                     |          | roundcube=rwU/postgres    |
public | session             | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | system              | table    |                           |
public | users               | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=arwd/postgres   |
public | users_seq           | sequence | postgres=rwU/postgres    +|
        |                     |          | roundcube=rwU/postgres    |
(19 rows)

roundcubemail=#


output from your sql statement:
roundcubemail=# GRANT SELECT,INSERT,UPDATE,DELETE ON cache_shared,system TO roundcube;
GRANT
roundcubemail=#

6

Re: re-occurence of RC db access error

fsantiago06111979 wrote:

public | cache_shared        | table    | postgres=arwdDxt/postgres+|
        |                     |          | roundcube=d/postgres      |
...
public | system              | table    |                           |

iRedMail doesn't set proper permission on these 2 tables: cache_shared, system. Does the latest SQL command fix your issue?

pgsql> GRANT SELECT,INSERT,UPDATE,DELETE ON cache_shared,system TO roundcube;

7

Re: re-occurence of RC db access error

i will try it and let you know. thanks.