From fc0889d3b6f76419d4393a90752a73a175667f3a Mon Sep 17 00:00:00 2001 From: Leena Gupte Date: Wed, 2 Dec 2015 12:02:59 +0000 Subject: [PATCH 1/2] Update README 1. Update the database replication instructions 2. Add a note about where to find RabbitMQ logs Fix formatting to be PEP8 compliant. --- README.md | 10 ++++++++-- backdrop/core/log_handler.py | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b11bde95..2199c6d9 100644 --- a/README.md +++ b/README.md @@ -78,9 +78,9 @@ Copy data from an environment to the local Backdrop database (should be run on y You may need to setup your [ssh config](https://github.gds/pages/gds/opsmanual/2nd-line/technical-setup.html#ssh-config) correctly for this to work -To sync to the govuk dev vm, you can pass `govuk_dev` as the 2nd argument to this script - +To sync to the govuk dev vm, you can pass `govuk_dev` as the 2nd argument to this script - -`bash tools/replicate-db.sh mongo-1.pp-preview govuk_dev` +`bash tools/replicate-db.sh performance-mongo-1.preview govuk_dev` ## Emptying a dataset @@ -135,4 +135,10 @@ following command `celery worker -A backdrop.transformers.worker -l debug` +## Troubleshooting + +The logs for RabbitMQ can be found in: `/var/log/rabbitmq/` +If there are any problems running transforms, this should be the first place to look. + + diff --git a/backdrop/core/log_handler.py b/backdrop/core/log_handler.py index 220e1b11..d3eb8d94 100644 --- a/backdrop/core/log_handler.py +++ b/backdrop/core/log_handler.py @@ -5,6 +5,7 @@ class RequestIdFilter(logging.Filter): + def filter(self, record): try: record.govuk_request_id = request.headers.get('Govuk-Request-Id') From abd727a47273466def163a45c207a023f7f78323 Mon Sep 17 00:00:00 2001 From: Leena Gupte Date: Wed, 2 Dec 2015 12:03:50 +0000 Subject: [PATCH 2/2] Change development config to match other environments The spike into Services page data anomalies has uncovered that the configuration for transform in the development differs from that in preview, staging in production. This means that you can't just start backdrop and curl the transform end point update a transform data set. In all of the other environments both backdrop write and transform use user backdrop_write and vhost /backdrop_write for the queue config. In development, backdrop write uses user backdrop_write and vhost /backdrop_write for the queue config, but transforms uses user transformer and vhost /transformations. To successfully trigger a transform in development with this set up I had to create the transformer user and /transformations vhost manually in rabbitmq. To make life easier for future developers, the transform config has been changed to match backdrop_write. This change won't affect how transform run in the other environments. --- backdrop/transformers/config/development.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backdrop/transformers/config/development.py b/backdrop/transformers/config/development.py index 6c056360..788ae55d 100644 --- a/backdrop/transformers/config/development.py +++ b/backdrop/transformers/config/development.py @@ -1,4 +1,4 @@ -TRANSFORMER_AMQP_URL = 'amqp://transformer:notarealpw@localhost:5672/%2Ftransformations' +TRANSFORMER_AMQP_URL = 'amqp://backdrop_write:backdrop_write@localhost:5672/%2Fbackdrop_write' STAGECRAFT_URL = 'http://localhost:3103' STAGECRAFT_OAUTH_TOKEN = 'development-oauth-access-token' BACKDROP_READ_URL = 'http://backdrop-read.dev.gov.uk/data'