documentcloud / cloud-crowd

Parallel Processing for the Rest of Us
https://github.com/documentcloud/cloud-crowd/wiki
MIT License
851 stars 92 forks source link

Failed to connect to central server #44

Closed nkokkos closed 9 years ago

nkokkos commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

@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 commented 10 years ago

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 https://github.com/documentcloud/cloud-crowd/issues/43 ?

nathanstitt commented 10 years ago

@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 commented 10 years ago

@nathanstitt Thanks Nathan. Now it works fine.

nathanstitt commented 9 years ago

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