From d742fc6ccca824cb55afea03ebd5a753c32fa7da Mon Sep 17 00:00:00 2001 From: Ynda Jas Date: Wed, 20 Nov 2024 18:48:59 +0000 Subject: [PATCH] Update data replication guidance - Fix `--assume-role-ttl` duration value. Using `180m` for this results in the following error: `aws-vault: error: invalid input duration string, try --help`. Updating it to `3h` fixes this - Document potential issues when trying to run the data replication scripts --- docs/how-tos.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/how-tos.md b/docs/how-tos.md index c00089d3..d91b9934 100644 --- a/docs/how-tos.md +++ b/docs/how-tos.md @@ -47,10 +47,10 @@ You will need to assume-role into AWS using the [gds-cli](https://docs.publishin ``` # as an AWS PowerUser... -gds aws govuk-integration-poweruser --assume-role-ttl 180m ./bin/replicate-postgresql.sh content-publisher +gds aws govuk-integration-poweruser --assume-role-ttl 3h ./bin/replicate-postgresql.sh content-publisher # as an AWS User... -gds aws govuk-integration-readonly --assume-role-ttl 180m ./bin/replicate-postgresql.sh content-publisher +gds aws govuk-integration-readonly --assume-role-ttl 3h ./bin/replicate-postgresql.sh content-publisher ``` All the scripts, other than `replicate-elasticsearch.sh`, take the name of the app to replicate data for. @@ -59,6 +59,15 @@ Draft data can be replicated with `replicate-postgresql.sh draft-content-store` If you want to download data without importing it, set the `SKIP_IMPORT` environment variable (to anything). +### Troubleshooting + +The replication scripts might fail for the following reasons: + +- `pv` not being installed. This is used to display a progress bar. On macOS, you can [install pv using Homebrew](https://formulae.brew.sh/formula/pv). +- Running out of space in Docker. This might result in an error like `ERROR 1114 (HY000) at line 11768: The table 'govspeak_contents' is full`. If you see this, you could do either or both of the following: + - If you're okay with removing some or all of your Docker containers, images, and possibly volumes and other data, run [docker system prune](https://docs.docker.com/reference/cli/docker/system/prune). + - If you have enough spare space on your local machine, allocate more space to Docker. Using Docker Desktop, this setting is under Settings > Resources > Advanced > Resource Allocation > Virtual disk limit. + ## How to: set environment variables While most environment variables should be set in the config for a project, sometimes it's necessary to set assign one or more variables at the point of running a command, such as a Rake task. This can be done using `env` e.g.