Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser crashes if Elasticsearch not available #3369

Closed
humphd opened this issue Mar 31, 2022 · 1 comment · Fixed by #3373
Closed

parser crashes if Elasticsearch not available #3369

humphd opened this issue Mar 31, 2022 · 1 comment · Fixed by #3373
Assignees

Comments

@humphd
Copy link
Contributor

humphd commented Mar 31, 2022

If Elasticsearch isn't running/ready, the parser service can crash (it just did for me locally). Let's take a page from Supabase and postgres, and add a restart: unless-stopped to the parser service, so it keeps trying, or increase the time it waits:

{"level":30,"time":1648685382499,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Loading all feeds into feed queue for processing"}
{"level":30,"time":1648685383013,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685383511,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685384013,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685384511,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685385010,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685385513,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685386016,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685386529,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685387024,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685387522,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685388019,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685388522,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685389032,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685389521,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685390023,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685390522,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685391022,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685391525,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":30,"time":1648685392024,"pid":7,"hostname":"cbae5a4f5dbb","msg":"Attempting to connect to elasticsearch..."}
{"level":50,"time":1648685392501,"pid":7,"hostname":"cbae5a4f5dbb","err":{"type":"Error","message":"Unable to connect to Elasticsearch. Use `MOCK_ELASTIC=1` in your `.env` to mock Elasticsearch, or install (see https://github.com/Seneca-CDOT/telescope/blob/master/docs/environment-setup.md)","stack":"Error: Unable to connect to Elasticsearch. Use `MOCK_ELASTIC=1` in your `.env` to mock Elasticsearch, or install (see https://github.com/Seneca-CDOT/telescope/blob/master/docs/environment-setup.md)\n    at Timeout._onTimeout (/app/src/utils/indexer.js:141:9)\n    at listOnTimeout (node:internal/timers:559:17)\n    at processTimers (node:internal/timers:502:7)"},"msg":"Unable to connect to Elasticsearch. Use `MOCK_ELASTIC=1` in your `.env` to mock Elasticsearch, or install (see https://github.com/Seneca-CDOT/telescope/blob/master/docs/environment-setup.md)"}
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: Unable to connect to Elasticsearch. Use `MOCK_ELASTIC=1` in your `.env` to mock Elasticsearch, or install (see https://github.com/Seneca-CDOT/telescope/blob/master/docs/environment-setup.md)
    at Timeout._onTimeout (/app/src/utils/indexer.js:141:9)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
@TueeNguyen TueeNguyen self-assigned this Mar 31, 2022
@TueeNguyen TueeNguyen added this to the 3.0-alpha Release milestone Mar 31, 2022
@manekenpix
Copy link
Member

The fix is in production.yml here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants