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

Failed to connect to central server #44

Closed
nkokkos opened this issue Jun 4, 2014 · 8 comments
Closed

Failed to connect to central server #44

nkokkos opened this issue Jun 4, 2014 · 8 comments

Comments

@nkokkos
Copy link

nkokkos commented Jun 4, 2014

Hi.

I am getting a connection error (failed to connect to central server) after trying the command:

crowd node

Looking over to the command window from which I started the crowd server I see

NoMethodError - undefined method 'find_or_create_by'

Have you seen this before?

@knowtheory
Copy link
Member

Hey @nkokkos, you'll have to give us a little more info about where the find_or_create_by error is occurring. Also a little bit about your system, such as what operating system and version of ruby you're running.

@nkokkos
Copy link
Author

nkokkos commented Jun 4, 2014

Hi, thanx

ruby 1.9.3p547
2.2.2 gem version
Centos 6.2

crowd server boots up with no errors but it crashes when I try to create a node with

crowd node

It crashes on node_record, line 35:

https://github.com/documentcloud/cloud-crowd/blob/master/lib/cloud_crowd/models/node_record.rb#L35

Here's a screenshot:
error

@nathanstitt
Copy link
Member

I believe find_or_create_by was introduced in ActiveRecord version 4. Looking at the crowd-cloud gemspec, we're only requiring >= 3.

@nkokkos My suspicion is that you're running ActiveRecord 3.x, hence the exception. You can check by looking in the Gemfile.lock to identify the version.

@knowtheory
Copy link
Member

@nathanstitt yep, looks like you're right. My intention was to keep CloudCrowd accessible to both AR 3 and AR 4 projects and it looks like i messed it up. I'll take a look at how we can get support for that later.

@nkokkos for now my recommendation is that, if you can, upgrade to rails4, and CloudCrowd should work fine for you.

@nkokkos
Copy link
Author

nkokkos commented Jun 5, 2014

Thank you, I upgraded to activerecord 4.x but now I am getting :

server_error

I am using the postgresql driver and connection pool has been set to 15 in database.yml

Perhaps this is related to #43 ?

nathanstitt added a commit that referenced this issue Jun 5, 2014
Worker nodes do not require DB access.  Since the defer call wraps a connection pool it's usage was causing excessive
connections and was causing errors if the node's configuration didn't have a database setup.

Reported in issue #44
nathanstitt added a commit that referenced this issue Jun 5, 2014
find_or_create_by was introduced in version 4.  Reported in #44
@nathanstitt
Copy link
Member

@nkokkos Looks like the node currently requires a database configuration and is throwing the exception because it doesn't have it.

I've just pushed up a commit that should remove that requirement as well as allow cloud-crowd to work with ActiveRecord 3.2.

For now, it should work if you copy your database configuration from the server to the node. The connection is only made when the node checks in and is then dropped so it's not super expensive.

@nkokkos
Copy link
Author

nkokkos commented Jun 11, 2014

@nathanstitt
Thanks Nathan. Now it works fine.

@nathanstitt
Copy link
Member

Closing the issue since it's been resolved. Thanks for the confirmation

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

3 participants