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

Error: Unable to parse elastic URL "http://elasticsearch:9200" and/or PORT "9200" #1442 #1443

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

zg3d
Copy link
Contributor

@zg3d zg3d commented Nov 23, 2020

Issue This PR Addresses

#1442

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

Tested the docker build and it was succes full

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

@zg3d zg3d requested a review from manekenpix November 23, 2020 02:52
@zg3d zg3d changed the title made sure elastic url is parasable fixes issue-1442 Error: Unable to parse elastic URL "http://elasticsearch:9200" and/or PORT "9200" #1442 Nov 23, 2020
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, a few things I see.

docker-compose.yml Show resolved Hide resolved
src/backend/utils/url-parser.js Outdated Show resolved Hide resolved
src/backend/utils/url-parser.js Outdated Show resolved Hide resolved
src/backend/utils/url-parser.js Outdated Show resolved Hide resolved
test/url-parser.test.js Outdated Show resolved Hide resolved
made urlparser global and added testing

added addtional testing and made it so the return is only 2 datatypes
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, great work. One tip on the way you're writing these tests. You have 6 variables at the top of the describe block that are shared between all the tests. This isn't a great pattern, and you'd be better off moving all of these into the test functions that use them (maximum isolation between tests, no dependencies, etc).

In your case this isn't going to break, since you used const with strings; but if you had non-immutable types (e.g., object references) this could be problematic, if one test updated the data before another used it.

@humphd humphd requested a review from c3ho November 24, 2020 20:35
@humphd
Copy link
Contributor

humphd commented Nov 24, 2020

Tagging @c3ho since he needs this fix for #1450.

@c3ho
Copy link
Contributor

c3ho commented Nov 24, 2020

image

I don't know if its me, but I can't get telescope to work with docker-compose up --build Telescope keeps crashing on Windows 10. I can confirm ElasticSearch is working now, but I can't say the same for Telescope

@humphd
Copy link
Contributor

humphd commented Nov 24, 2020

@c3ho what's in the log file it generated?

@c3ho
Copy link
Contributor

c3ho commented Nov 24, 2020

One of the earlier runs:
image

Terminal message in the most recent run:
image

I wiped docker images prior to testing this and still doesn't work. Maybe my elastic container is taking too long to start and Telescope crashes from it?

If I run the command docker-compose up redis elasticsearch + npm start separately, it will work, but docker-compose up --build fails.

@humphd
Copy link
Contributor

humphd commented Nov 24, 2020

Or maybe this PR isn't parsing the URL in your env correctly? What are you using for env with these elasitic params?

@c3ho
Copy link
Contributor

c3ho commented Nov 24, 2020

image

Should it matter though? I thought we're overwriting it with the docker-compose envs when we run docker-compose up --build?

It's weird because obviously it is working since it passes the CI checks on github.

Edit: Elasticsearch works, but Telescope crashes before Elasticsearch is fully up and running.

@manekenpix
Copy link
Member

@c3ho change ELASTIC_DELAY_MS in your .env file, give it more time. The same was happening to me and the problem was that it was taking ES more than ELASTIC_DELAY_MS to be ready to store posts.

Copy link
Contributor

@c3ho c3ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it to work after @manekenpix suggestion.

@c3ho c3ho merged commit 5dc0aab into Seneca-CDOT:master Nov 25, 2020
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.

Error: Unable to parse elastic URL "http://elasticsearch:9200" and/or PORT "9200"
4 participants