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

publish_address ipv4 is mis-parsed as ipv6, leading to a undefined nil access and failure #48

Closed
robbat2 opened this issue Mar 22, 2023 · 0 comments

Comments

@robbat2
Copy link
Contributor

robbat2 commented Mar 22, 2023

(REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:82:in `parse_publish_address': undefined method `[]' for nil:NilClass (NoMethodError)
# curl -s http://localhost:9200/_nodes |jq '.nodes|to_entries|first|.value|.http.publish_address'
"inet[/127.0.0.1:9200]"

This leads to a failure in parse_publish_address

	 8: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/base.rb:99:in `reload_connections!'
	 7: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:46:in `hosts'
	 6: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/timeout-0.3.2/lib/timeout.rb:196:in `timeout'
	 5: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/timeout-0.3.2/lib/timeout.rb:189:in `block in timeout'
	 4: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:49:in `block in hosts'
	 3: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:49:in `map'
	 2: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:49:in `each'
	 1: from (REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:51:in `block (2 levels) in hosts'
(REDACTED)/vendor/bundle/ruby/2.7.0/gems/elastic-transport-8.2.0/lib/elastic/transport/transport/sniffer.rb:82:in `parse_publish_address': undefined method `[]' for nil:NilClass (NoMethodError)
robbat2 added a commit to robbat2/elastic-transport-ruby that referenced this issue Mar 22, 2023
Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: elastic#48
Signed-off-by: Robin H. Johnson <[email protected]>
robbat2 added a commit to robbat2/elastic-transport-ruby that referenced this issue Mar 22, 2023
picandocodigo pushed a commit that referenced this issue Jul 4, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 4, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 4, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 5, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 5, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 5, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 5, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
picandocodigo pushed a commit that referenced this issue Jul 5, 2023
* sniffer: fix parsing of inet[hostname/ip:port]

Prior to commit 53f37cb,
publish_address of the format `inet[hostname/ip:port]` worked correctly.

When the sniffer code was refactored, this format broke, and is an easy
fix to restore.

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

* sniffer: fix empty hostname like inet[/127.0.0.1:9200]

Fixes: #48
Signed-off-by: Robin H. Johnson <[email protected]>

---------

Signed-off-by: Robin H. Johnson <[email protected]>
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

No branches or pull requests

1 participant