Skip to content

Upgrade Travel Advice Publisher to use postgres 13#6

Open
Havoooo wants to merge 2 commits into
mainfrom
travel-advice-publisher-postgres-13
Open

Upgrade Travel Advice Publisher to use postgres 13#6
Havoooo wants to merge 2 commits into
mainfrom
travel-advice-publisher-postgres-13

Conversation

@Havoooo

@Havoooo Havoooo commented Jul 20, 2023

Copy link
Copy Markdown
Owner

This is the version we are planning to upgrade PostgreSQL to in production, so we need to update our development environment too.

beccapearce and others added 2 commits December 2, 2021 17:06
This is the version we are planning to upgrade PostgreSQL to in
production, so we need to update our development environment too.
Havoooo pushed a commit that referenced this pull request Jul 20, 2023
This commit sets `shm_size: 512mb` so that browser based tests run correctly (e.g. Jasmine unit tests and Capybara feature specs).

Docker allocates 64mb shared memory to containers by default, but recent versions of Chrome require more than this. Otherwise you'll start to see error messages complaining about an "invalid session id". In a previous discussion on Slack, it was informally agreed that 512mb seems to be the 'right sized' amount to allocate – but this was anecdotal, so other values may work equally well for our needs.

If the `shm_size` is too small, you'll get error messages that look something like this in your terminal:

```
NoSuchSessionError: invalid session id
    at Object.throwDecodedError (/govuk/whitehall/node_modules/selenium-webdriver/lib/error.js:522:15)
    at parseHttpResponse (/govuk/whitehall/node_modules/selenium-webdriver/lib/http.js:548:13)
    at Executor.execute (/govuk/whitehall/node_modules/selenium-webdriver/lib/http.js:474:28)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async thenableWebDriverProxy.execute (/govuk/whitehall/node_modules/selenium-webdriver/lib/webdriver.js:735:17)
    at async Object.runSpecs (/govuk/whitehall/node_modules/jasmine-browser-runner/index.js:116:9)
    at async Command.runSpecs (/govuk/whitehall/node_modules/jasmine-browser-runner/lib/command.js:187:5) {
  remoteStacktrace: '#0 0xaaaabaf6b1b0 <unknown>\n' +
    '#1 0xaaaabada13b0 <unknown>\n' +
    '#2 0xaaaabadc7fe4 <unknown>\n' +
    '#3 0xaaaabadc9864 <unknown>\n' +
    '#4 0xaaaabafa75f8 <unknown>\n' +
    '#5 0xaaaabafa9d98 <unknown>\n' +
    '#6 0xaaaabafa9acc <unknown>\n' +
    '#7 0xaaaabaf987e0 <unknown>\n' +
    '#8 0xaaaabafaa500 <unknown>\n' +
    '#9 0xaaaabaf8e080 <unknown>\n' +
    '#10 0xaaaabafc1790 <unknown>\n' +
    '#11 0xaaaabafc1950 <unknown>\n' +
    '#12 0xaaaabafdbbd4 <unknown>\n' +
    '#13 0xffffb0f28628 <unknown>\n' +
    '#14 0xffffb075501c <unknown>\n'
}
error Command failed with exit code 1.
```

This config needs to be applied to each service that needs to run Chrome. In this commit, I've added it to applications owned by the Publishing service. Other applications (including frontend applications) may also benefit from this config, but I didn't want to make assumptions about which applications need it and which don't.

More information about this problem is covered in this blog post:
https://thecurve.io/dealing-with-cryptic-seleniumwebdrivererrorinvalidsessioniderror-errors/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants