Sorry for replying late - been away for some days.
So I can reproduce the error with the following code (credentials for my login are of course the correct ones...)
require "rubygems"
require 'active_resource'
class Project < ActiveResource::Base
puts "class Project"
self.site = 'http://localhost:7777'
self.user = 'theUser'
self.password = 'thePassword'
self.format = :xml
end
puts "retrieving all projects"
myProjects = Project.find(:all, :params => { :limit => 1000 })
puts "searching for project 'Test'"
testProject = nil
myProjects.each { |project|
if (project.name == "Test") then
testProject = project;
break;
end
}
if (testProject == nil) then
puts "project 'Test' not found"
exit -1
end
puts "Project #{testProject.name} has id #{testProject.id}"
puts "create new subproject for #{testProject.name}"
newProject = Project.new(
:parent_id => testProject.id,
:name => "Test Subproject",
:identifier => "test_subproject"
)
puts "make new project persistent"
newProject.save
If I run this on my current redmine installation, I will get the following:
class Project
retrieving all projects
searching for project 'Test'
Project Test has id 17
create new subproject for Test
make new project persistent
This shows that I am connected to my redmine instance, and that retrieving projects is possible. After the last line, the script will not return, but wait for the
save
to return. When I go to the browser interface, it will tell me "waiting for localhost" as the server is busy with the
save
command.
The only way to make the system work again is killing the rails instance for redmine.
This will give me the following output:
/home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:153:in `read_nonblock': end of file reached (EOFError)
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:153:in `rbuf_fill'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:144:in `readline'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http/response.rb:39:in `read_status_line'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http/response.rb:28:in `read_new'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1414:in `block in transport_request'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1411:in `catch'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1411:in `transport_request'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1384:in `request'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1377:in `block in request'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:853:in `start'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1375:in `request'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1398:in `send_entity'
from /home/zane/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1186:in `post'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/connection.rb:121:in `block in request'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `block in instrument'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `instrument'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/connection.rb:118:in `request'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/connection.rb:106:in `block in post'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/connection.rb:216:in `with_auth'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/connection.rb:106:in `post'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/base.rb:1435:in `block in create'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_create_callbacks'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/base.rb:1434:in `create'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/observing.rb:21:in `create_with_notifications'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/base.rb:1224:in `block in save'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_save_callbacks'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/base.rb:1223:in `save'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/validations.rb:116:in `save_with_validation'
from /home/zane/.rvm/gems/ruby-2.2.3/gems/activeresource-4.0.0/lib/active_resource/observing.rb:21:in `save_with_notifications'
from makeProject.rb:32:in `<main>'
This way I can reproduce the problem on my installation, but I guess this will not work on a fresh database.
I saw postings that said that active resource can be a problem when you have complex relations between tables.