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

the value "-" is not the same as the value "-1" #2526

Closed
pheitman opened this issue Nov 22, 2016 · 4 comments
Closed

the value "-" is not the same as the value "-1" #2526

pheitman opened this issue Nov 22, 2016 · 4 comments
Labels
type/bug Feature does not function as expected
Milestone

Comments

@pheitman
Copy link

If you have a question, please direct it to the
consul mailing list if it hasn't been
addressed in either the FAQ or in one
of the Consul Guides.

When filing a bug, please include the following:

consul version for both Client and Server

Client: Consul v0.7.1
Server: Consul v0.7.1

consul info for both Client and Server

Client:

[Client `consul info` here]

Server:

agent:
	check_monitors = 0
	check_ttls = 1
	checks = 3
	services = 10
build:
	prerelease = 
	revision = 'a9455cd
	version = 0.7.1
consul:
	bootstrap = false
	known_datacenters = 1
	leader = false
	leader_addr = 192.168.2.35:8300
	server = true
raft:
	applied_index = 12488
	commit_index = 12488
	fsm_pending = 0
	last_contact = 38.772958ms
	last_log_index = 12488
	last_log_term = 2
	last_snapshot_index = 8218
	last_snapshot_term = 2
	latest_configuration = [{Suffrage:Voter ID:192.168.2.35:8300 Address:192.168.2.35:8300} {Suffrage:Voter ID:192.168.2.34:8300 Address:192.168.2.34:8300} {Suffrage:Voter ID:192.168.2.33:8300 Address:192.168.2.33:8300}]
	latest_configuration_index = 1
	num_peers = 2
	protocol_version = 1
	protocol_version_max = 3
	protocol_version_min = 0
	snapshot_version_max = 1
	snapshot_version_min = 0
	state = Follower
	term = 2
runtime:
	arch = amd64
	cpu_count = 2
	goroutines = 73
	max_procs = 2
	os = linux
	version = go1.7.3
serf_lan:
	encrypted = true
	event_queue = 0
	event_time = 14
	failed = 0
	health_score = 0
	intent_queue = 0
	left = 0
	member_time = 9
	members = 5
	query_queue = 0
	query_time = 1
serf_wan:
	encrypted = true
	event_queue = 0
	event_time = 1
	failed = 0
	health_score = 0
	intent_queue = 0
	left = 0
	member_time = 1
	members = 1
	query_queue = 0
	query_time = 1

Operating system and Environment details

CentOS 6.8

Description of the Issue (and unexpected/desired result)

consul kv put -1
appears to read from stdin as if the value were "-"
Instead consul should realize that the value is -1, not - and put the value in to the kv store

Reproduction steps

consul kv put foo -1

Log Fragments or Link to gist

Include appropriate Client or Server log fragments. If the log is longer
than a few dozen lines, please include the URL to the
gist.

TIP: Use -log-level=TRACE on the client and server to capture the maximum log detail.

@slackpad slackpad added this to the 0.7.2 milestone Nov 22, 2016
@slackpad slackpad added the type/bug Feature does not function as expected label Nov 22, 2016
@mckennajones
Copy link
Contributor

@pheitman On my machine, when executing consul kv put with any negative values the command hangs. Does this happen do you too? I am running on Arch Linux.

@pheitman
Copy link
Author

Yes, I am pretty sure that consul is treating the negative value as if it
was a minus sign which tells consul to read the value from stdin.

On Tue, Nov 22, 2016, 6:01 PM McKenna Jones notifications@github.com
wrote:

@pheitman https://github.com/pheitman On my machine, when executing consul
kv put with any negative values the command hangs. Does this happen do
you too? I am running on Arch Linux.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2526 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQYjg5MgHo0a5ebY_kmxTyrzv_r4H98Dks5rA3QtgaJpZM4K5oPz
.

@mckennajones
Copy link
Contributor

@pheitman aha, I just tried it out again and I think you're correct. Will look into fixing this.

@slackpad
Copy link
Contributor

slackpad commented Dec 1, 2016

Fixed in #2533.

@slackpad slackpad closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Feature does not function as expected
Projects
None yet
Development

No branches or pull requests

3 participants