Econe cli tools fail with ParseException

I am trying to register an image for econe usage with ‘econe-register’ and then to fetch it with ‘econe-describe-images’.
The commands were issued like so:
econe-register 32 -K econe_test -S <hashedPW> -v -U https:/<MyAwesomeURL>/EC2

Both command output the following error:

econe-register: #<REXML::ParseException: Missing end tag for 'img' (got "body")
Line: 20
Position: 445
Last 80 unconsumed characters:
>
/usr/share/ruby/rexml/parsers/baseparser.rb:338:in `pull_event'
/usr/share/ruby/rexml/parsers/baseparser.rb:183:in `pull'
/usr/share/ruby/rexml/parsers/treeparser.rb:22:in `parse'
/usr/share/ruby/rexml/document.rb:287:in `build'
/usr/share/ruby/rexml/document.rb:43:in `initialize'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS.rb:344:in `new'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS.rb:344:in `aws_error?'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS.rb:300:in `block in make_request'
/usr/share/ruby/net/http.rb:852:in `start'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS.rb:274:in `make_request'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS.rb:324:in `response_generator'
/usr/local/share/gems/gems/amazon-ec2-0.9.17/lib/AWS/EC2/images.rb:94:in `register_image'
/usr/lib/one/ruby/cloud/econe/EC2QueryClient.rb:299:in `register_image'
/usr/bin/econe-register:63:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/econe-register:36:in `new'
/usr/bin/econe-register:36:in `<main>'
...
Missing end tag for 'img' (got "body")
Line: 20
Position: 445
Last 80 unconsumed characters:
Line: 20
Position: 445
Last 80 unconsumed characters:

Any help would be greatly appreciated.

Thanks
Christian

Hi,

Could you check if there is any error in the logs (oned.log, econe.log, econe.error) after trying to register the image?

Hi,
sure! The only message showing up related to the call is in econe-server.log and looks like so:

Thu Feb 25 11:49:41 2016 [I]: Updating user pool cache.
Thu Feb 25 11:49:41 2016 [I]: ::ffff:<MyIpAddress> - - [25/Feb/2016:11:49:41 +0100] "POST /EC2 HTTP/1.0" 404 453 0.1225

There is a 404 error, so it looks like it cannot find the image, could you check oned.log also?

I did, there is nothing happening in oned.log except for the occasional monitoring of VMs, Datastores and Hosts.

Here is a screenshot of the econe-register request and the corresponding content from oned.log:

Is there anything related in oned.log?

Ok, I think the problem is that you are running econe server using the ‘/EC2’ path and the server expects the requests on ‘/’.

You can try rewriting the path in the server configuration or just changing the code in the econe server:

from

post '/' do
    result, rc = $ec2_app.do_http_request(params)
    treat_response(result, rc)
end

get '/' do
    result, rc = $ec2_app.do_http_request(params)
    treat_response(result, rc)
end

to

post '/EC2' do
    result, rc = $ec2_app.do_http_request(params)
    treat_response(result, rc)
end

get '/EC2' do
    result, rc = $ec2_app.do_http_request(params)
    treat_response(result, rc)
end
1 Like

Thanks a lot! Working like a charm now!

My econe server configuration has the “ssl_server” option set to “https:///EC2”. I thought that would be recognized path-wise by the econe-server.rb. Is there a reason it is not?

There’s no special reason for it. The thing is that the ssl_server option is used to generate the Signature for the authentication, it could be also used to enable path based routes.

However, if you deploy an SSL proxy on top of econe server, you would need the path for the signature, but no path for the requests in the server. So probably, we would need an extra option for it.