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

Had an issue when trying to read the Riak server's version number #120

Merged
merged 2 commits into from Sep 5, 2013

Conversation

jacepp
Copy link
Contributor

@jacepp jacepp commented Sep 4, 2013

Trimming the version number to prevent Rails error: Malformed version number string 1.4.2-0-g61ac9d8

This was the version number sent back from the Riak Server that is currently hosted on AWS. I'm not entirely sure why it is read that way on my end, but when I SSH into that AWS server and check Riak's version it just says 1.4.2.

This was a simple fix that I did, if there is a better way to do this, I am all ears.

Thanks,
Jace

@bkerley
Copy link
Contributor

bkerley commented Sep 4, 2013

Is the server version coming back from http://localhost:10018/stats (or the corresponding URL on your Riak server?)

@jacepp
Copy link
Contributor Author

jacepp commented Sep 4, 2013

I am using the IP address for the AWS server to connect and retrieve the version number.

@@ -27,7 +27,7 @@ def get_server_version
# @return [Gem::Version] the version of the Riak node to which
# this backend is connected
def server_version
@server_version ||= Gem::Version.new(get_server_version)
@server_version ||= Gem::Version.new(get_server_version[0,5])
Copy link
Contributor

Choose a reason for hiding this comment

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

This should truncate after the first minus, to support cases when Riak has two digits in some components of the version number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it should look something like:

get_server_version = get_server_version.split("-").first
@server_version ||= Gem::Version.new(get_server_version)

@jacepp
Copy link
Contributor Author

jacepp commented Sep 4, 2013

Made the change to use .split("-").first instead of straight truncating at the 5th index.

bkerley added a commit that referenced this pull request Sep 5, 2013
Had an issue when trying to read the Riak server's version number
@bkerley bkerley merged commit 9993805 into basho:master Sep 5, 2013
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.

None yet

2 participants