2
votes

Setup Details: 1x EC2 running Ubuntu 14.04 with Postgres 9.3, 1x RDS running Postgres 9.3

I am trying to move a postgres database that I have on an EC2 onto an RDS. I am using Londiste, which is recommended by AWS for migrating databases with minimal downtime. Specifically, I am using Londiste/Skytools 2.1.13, because Londiste3 requires superuser privileges on both systems.

I have tried installing Skytools both via the zip from their website and via apt-get (both 2.1.13). I have installed what I believe to be all of the dependencies: postgres,libpq-dev, postgresql-server-dev-9.3, pip, and psycopg2.

Regardless, whenever I try to use any skytools commands, I get the following error:

Traceback (most recent call last):
File "/usr/local/bin/pgqadm.py", line 9, in from pgq.ticker import SmartTicker File "/usr/local/lib/python2.7/dist-packages/pgq/init.py", line 6, in

import pgq.consumer File "/usr/local/lib/python2.7/dist-packages/pgq/consumer.py", line 6, in from pgq.baseconsumer import BaseConsumer, BaseBatchWalker File "/usr/local/lib/python2.7/dist-packages/pgq/baseconsumer.py", line 75,

in class BaseConsumer(skytools.DBScript): File "/usr/local/lib/python2.7/dist-packages/skytools/apipkg.py", line 114,

in __makeattr result = importobj(modpath, attrname) File "/usr/local/lib/python2.7/dist-packages/skytools/apipkg.py", line 37,

in importobj module = import(modpath, None, None, ['doc']) File "/usr/local/lib/python2.7/dist-packages/skytools/scripting.py", line 23,

in default_skylog = skytools.installer_config.skylog

AttributeError: 'module' object has no attribute 'skylog'

Am I missing a dependency? (Skylog seems to be a part of skytools, so I've concluded it's not that.) Has anyone else hit this issue? (There don't seem to be any google results with this error.) Thanks!

1
I've also hit this issues. Did you solve it already?bronislav

1 Answers

1
votes

tl;dr:

make sure you're running pgqadm.py that is in your local skytools-2.x.y installation directory, eg: ./python/pgqadm.py ticker.ini install

This can be a problem if you have previously installed Skytools 3.x, which may come up first in your PATH.

Background

I just ran into this same issue. I have the same use case (migrating pg->rds), and followed the same recommendation from the AWS documentation.

I had initially installed Skytools 3.x before noticing that it requires superuser privileges on the would-be replica. which pgqadm.py returns /usr/bin/pgqadm.py, which is an artifact of my abandoned Skytools 3.x installation.

I became suspicious of a version conflict when I went to the Skytools source repository looking for instances of skylog. The first result was here: https://github.com/pgq/skytools-legacy/blob/11afc5210a92d4a2ccf701e4f92138488c31a3cb/python/skytools/installer_config.py.in

However, I realized that this repository is now tracking the latest 3.x release. I switched to the apparent 2.1.x branch, and skylog was nowhere to be found, as expected:

https://github.com/pgq/skytools-legacy/blob/skytools_2_1_stable/python/skytools/installer_config.py.in

Fully-qualifying the path to pgqadm.py resolves this issue in this case.