[Bucardo-general] Permission denied on source db - related to "validate_sync"

Eadan Fahey eadan176 at gmail.com
Tue Jan 30 10:14:52 UTC 2018


Hello everyone,

I am in the process of setting up bucardo to replicate a postgres database
on an RDS instance, to another postgres database also running on an AWS
instance. I have no problems installing bucardo within an Ubuntu 16.04
docker container. Adding the respective databases, tables and creating
herds has also went smoothly. However, creating a sync between the
databases is presenting a problem. Specifically, bucardo is returning the
error:

WARNING:  Issuing rollback() due to DESTROY without explicit disconnect()
of DBD::Pg::db handle
dbname=<SOURCE_DBNAME>;host=<SOURCE_HOST>;port=<SOURCE_PORT> at -e line 56.
Failed to add sync: DBD::Pg::st execute failed: ERROR:  DBD::Pg::db do
failed: ERROR:  permission denied for database <SOURCE_DBNAME> at line 275.
at line 30.
CONTEXT:  PL/Perl function "validate_sync" at /usr/bin/bucardo line 4612.

This error message states the error is occuring within the "validate_sync"
function of bucardo on line 4612. I have lines 4603 to 4616 of the bucardo
script below:

    ## Attempt to insert this into the database
    my $columns = join ',' => keys %$dbcols;
    my $qs = '?,' x keys %$dbcols;
    chop $qs;
    $SQL = "INSERT INTO bucardo.sync ($columns) VALUES ($qs)";
    $DEBUG and warn "SQL: $SQL\n";
    $sth = $dbh->prepare($SQL);
    $DEBUG and warn Dumper values %$dbcols;
    eval {
        $count = $sth->execute(values %$dbcols);    ### LINE 4612 - ERROR
HERE
    };
    if ($@) {
        die "Failed to add sync: $@\n";
    }

I using the bucardo tutorial at
https://www.compose.com/articles/using-bucardo-5-3-to-migrate-a-live-postgresql-database/
as a guide. I have tested that respective users I am using with bucardo for
the source and target databases have the ability to run "SET
session_replication_role TO 'replica'" and that the extension plperl can be
installed.

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20180130/753cf451/attachment.html>


More information about the Bucardo-general mailing list