From 8e5f7edb9c9e4f95b6f67b750d197cfd32ff9b3a Mon Sep 17 00:00:00 2001 From: Paul Melnikow Date: Tue, 20 Aug 2019 16:59:36 +0100 Subject: [PATCH] Fix TLS errors preventing Redis connections in production ioredis 4.14.0 introduced an issue where custom TLS options are no longer honored. I reported it here: luin/ioredis#947 For now let's downgrade to the latest working version, which I've confirmed working via the script (checked in). --- package-lock.json | 6 +++--- package.json | 2 +- scripts/redis-connectivity-test.js | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 scripts/redis-connectivity-test.js diff --git a/package-lock.json b/package-lock.json index e763618b5d196..13ce0121248cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13976,9 +13976,9 @@ "dev": true }, "ioredis": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.14.0.tgz", - "integrity": "sha512-vGzyW9QTdGMjaAPUhMj48Z31mIO5qJLzkbsE5dg+orNi7L5Ph035htmkBZNDTDdDk7kp7e9UJUr+alhRuaWp8g==", + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.13.1.tgz", + "integrity": "sha512-AsfcOmo+imI4pt2Jd5c6NWGYYKrmoWZIN972xeTwMqqSSbdOxWoSXHyaDDMhDbX7aGDwqN19z6i5e1J6wSJhsQ==", "requires": { "cluster-key-slot": "^1.1.0", "debug": "^4.1.1", diff --git a/package.json b/package.json index c9c77feb808ba..4d90fc564d550 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "glob": "^7.1.4", "graphql": "^14.4.2", "graphql-tag": "^2.10.1", - "ioredis": "^4.14.0", + "ioredis": "4.13.1", "joi-extension-semver": "3.0.0", "js-yaml": "^3.13.1", "jsonpath": "~1.0.2", diff --git a/scripts/redis-connectivity-test.js b/scripts/redis-connectivity-test.js new file mode 100644 index 0000000000000..2aaf4baffec29 --- /dev/null +++ b/scripts/redis-connectivity-test.js @@ -0,0 +1,26 @@ +'use strict' + +const config = require('config').util.toObject() +console.log(config) +const GithubConstellation = require('../services/github/github-constellation') + +const { persistence } = new GithubConstellation({ + persistence: config.public.persistence, + service: config.public.services.github, + private: config.private, +}) + +async function main() { + const tokens = await persistence.initialize() + console.log(`${tokens.length} tokens loaded`) + await persistence.stop() +} + +;(async () => { + try { + await main() + } catch (e) { + console.error(e) + process.exit(1) + } +})()