franckcuny/net-http-spore — Issue #14: HTTP status 599, no error message and "authentication" : true error
Author: clrh
Created: 2012-02-28 12:54:08+00:00
State: open

I am trying to do the simplest thing with trello and Net::HTTP::Spore lib. (https://github.com/clrh/trello-spore-perl)

I don't understand why it doesn't work, logs do not give me more data...

$ perl trello.pl ; echo ""; cat logs/log_spore_trello.log
HTTP status: 599
== enabling middleware Net::HTTP::Spore::Middleware::Format::JSON
> GET /1/boards/4e7279550a78dcdfe520b4f7?key=2c0dd858791fbb92730a6dc2af0cfcca&token=f905312900d0ba42e0d86703b576f2a4a2166b4670ab09ca15bfa883e827ec21&cards=all
> Host: api.trello.com
> Accept: application/json
> User-Agent: Net::HTTP::Spore v0.03 (Perl)
< Connection: keep-alive
< Content-Length: 12
< Content-Type: text/plain; charset=utf-8
< Access-Control-Allow-Methods: GET, PUT, POST, DELETE
< Access-Control-Allow-Origin: *
< Client-Date: Tue, 28 Feb 2012 12:48:32 GMT
< Client-Peer: 64.34.80.210:443
< Client-Response-Num: 1
< Client-SSL-Cert-Issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3
< Client-SSL-Cert-Subject: /C=US/ST=New York/L=New York/O=Fog Creek Software, Inc./OU=Technical/CN=*.trello.com
< Client-SSL-Cipher: AES256-SHA
< Client-SSL-Warning: Peer certificate not verified
< Client-Warning: Redirect loop detected (max_redirect = 0)
< X-Powered-By: Express

Finally I thought "authentication" spore param was missing but I have an error when I add "authentication":true in trello.json

unable to create new Net::HTTP::Spore object: Attribute (authentication) does not pass the type constraint because: Validation failed for 'Bool' with value JSON::XS::Boolean=SCALAR(0x91d7af8) at /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1275
Moose::Meta::Attribute::verify_against_type_constraint('Moose::Meta::Attribute=HASH(0x96cd7b8)', 'JSON::XS::Boolean=SCALAR(0x91d7af8)', 'instance', 'Class::MOP::Class::__ANON__::SERIAL::11=HASH(0x999fe28)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1262
Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Attribute=HASH(0x96cd7b8)', 'JSON::XS::Boolean=SCALAR(0x91d7af8)', 'Class::MOP::Class::__ANON__::SERIAL::11=HASH(0x999fe28)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 531
Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Attribute=HASH(0x96cd7b8)', 'Moose::Meta::Instance=HASH(0x9981a38)', 'Class::MOP::Class::__ANON__::SERIAL::11=HASH(0x999fe28)', 'HASH(0x99818c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 525
Class::MOP::Class::_construct_instance('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x999f828)', 'HASH(0x99818c8)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 498
Class::MOP::Class::new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x999f828)', 'HASH(0x99818c8)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Class.pm line 274
Moose::Meta::Class::new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x999f828)', 'formats', 'ARRAY(0x96bd158)', 'trace', '1=logs/log_spore_trello.log', 'base_url', 'https://api.trello.com', 'authentication', 'JSON::XS::Boolean=SCALAR(0x91d7af8)') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 107
Net::HTTP::Spore::__ANON__() called at /usr/share/perl5/Try/Tiny.pm line 76
eval {...} called at /usr/share/perl5/Try/Tiny.pm line 67
Try::Tiny::try('CODE(0x999f408)', 'Try::Tiny::Catch=REF(0x999f3c8)') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 114
Net::HTTP::Spore::_attach_spec_to_class('{\x{a} "name" : "Trello-Perl",\x{a} "base_url" : "https://api.t...', 'HASH(0x91f0018)', 'Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x999f828)') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 27
Net::HTTP::Spore::new_from_string('Net::HTTP::Spore', '{\x{a} "name" : "Trello-Perl",\x{a} "base_url" : "https://api.t...', 'trace', '1=logs/log_spore_trello.log') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 59
Net::HTTP::Spore::new_from_spec('Net::HTTP::Spore', 'spec/trello.json', 'trace', '1=logs/log_spore_trello.log') called at trello.pl line 9
at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 113
Net::HTTP::Spore::__ANON__('Attribute (authentication) does not pass the type constraint ...') called at /usr/share/perl5/Try/Tiny.pm line 100
Try::Tiny::try('CODE(0x999f408)', 'Try::Tiny::Catch=REF(0x999f3c8)') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 114
Net::HTTP::Spore::_attach_spec_to_class('{\x{a} "name" : "Trello-Perl",\x{a} "base_url" : "https://api.t...', 'HASH(0x91f0018)', 'Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x999f828)') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 27
Net::HTTP::Spore::new_from_string('Net::HTTP::Spore', '{\x{a} "name" : "Trello-Perl",\x{a} "base_url" : "https://api.t...', 'trace', '1=logs/log_spore_trello.log') called at /usr/local/share/perl/5.10.1/Net/HTTP/Spore.pm line 59
Net::HTTP::Spore::new_from_spec('Net::HTTP::Spore', 'spec/trello.json', 'trace', '1=logs/log_spore_trello.log') called at trello.pl line 9

Maybe I miss a really stupid thing, any idea could help me...