my $model = MyDataModel->new;
my $name = $model->lookup( member => $member_id );
みたいなコードがあったとして、lookupメソッドが走るときに"extra bytes"ってエラーが出ることがあります。
そんな時は、テーブルに格納されているデータを疑ってみてください。もしかすると、decodeされっぱなしのデータが格納されているかもしれません。
my $model = MyDataModel->new;
my $name = $model->lookup( member => $member_id );
Can't use string ("k… ÎKÇ
» Ú") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.8/Data/Model/Driver/Memcached.pm line 188.
# perl t/060_driver/memcached/serializer.t
1..20
ok 1
ok 2
ok 3
:
(中略)
:
ok 18
ok 19
ok 20
# cpanm Data::MessagePack
Fetching http://search.cpan.org/CPAN/authors/id/T/TO/TOKUHIROM/Data-MessagePack-0.10.tar.gz ... OK
Configuring Data-MessagePack-0.10 ... OK
Building and testing Data-MessagePack-0.10 for Data::MessagePack ... OK
Successfully installed Data-MessagePack-0.10
# perl t/060_driver/memcached/serializer.t
1..100
ok 1
ok 2 - pack
ok 3 - unpack
ok 4
ok 5 - NOT INT: pack with Data::MessagePack
:
(中略)
:
ok 99
ok 100 - INT: pack with Data::MessagePack
my $tokyo_tyrant = Data::Model::Driver::Memcached->new(
memcached => Cache::Memcached::Fast->new( {
servers => [qw/ 127.0.0.1:1978 /],
} ),
serializer => 'Default',
);
# ttservctl start
Starting the server of Tokyo Tyrant
Executing: ttserver -port 1978 -dmn -pid /var/ttserver/pid
Done
# ttservctl start
Starting the server of Tokyo Tyrant
Executing: ttserver -port 1978 -dmn -pid /var/ttserver/pid
/usr/local/sbin/ttservctl: line 72: ttserver: command not found
The server could not started
# ln -s /usr/local/bin/ttserver /usr/bin/
# yum -y install zlib2-devel
# vzctl set [VEID] --privvmpages 512M --vmguarpages 512M --save
$ dig to.
; <<>> DiG 9.4.2-P2.1 <<>> to.
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42625
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 0
;; QUESTION SECTION:
;to. IN A
;; ANSWER SECTION:
to. 86342 IN A 216.74.32.107
;; AUTHORITY SECTION:
to. 86342 IN NS ns1.iafrica.com.
to. 86342 IN NS tonic.to.
to. 86342 IN NS colo.to.
to. 86342 IN NS ns-to.ripe.net.
to. 86342 IN NS auth02.ns.uu.net.
;; Query time: 1 msec
;; SERVER: 192.168.1.241#53(192.168.1.241)
;; WHEN: Tue Apr 13 16:42:57 2010
;; MSG SIZE rcvd: 159
$.ajaxSetup({ cache: false });
# cpan App::cpanminus
$ mkdir bin && cd ~/bin $ wget http://xrl.us/cpanm $ chmod +x cpanm
$ wget http://xrl.us/cpanmを
$ wget http://xrl.us/cpanm --no-check-certificateとしなければダメな環境もあるようです。
root@nephos:/home/yt# cpanm Plack
Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Plack-0.9929.tar.gz ... OK
Configuring Plack-0.9929 ... OK
==> Found dependencies: Hash::MultiValue, HTTP::Body, Filesys::Notify::Simple, Devel::StackTrace::AsHTML
Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Hash-MultiValue-0.08.tar.gz ... OK
Configuring Hash-MultiValue-0.08 ... OK
Building and testing Hash-MultiValue-0.08 for Hash::MultiValue ... OK
Successfully installed Hash-MultiValue-0.08
Fetching http://search.cpan.org/CPAN/authors/id/M/MR/MRAMBERG/HTTP-Body-1.07.tar.gz ... OK
Configuring HTTP-Body-1.07 ... OK
Building and testing HTTP-Body-1.07 for HTTP::Body ... OK
Successfully installed HTTP-Body-1.07 (upgraded from 1.05)
Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Filesys-Notify-Simple-0.06.tar.gz ... OK
Configuring Filesys-Notify-Simple-0.06 ... OK
Building and testing Filesys-Notify-Simple-0.06 for Filesys::Notify::Simple ... OK
Successfully installed Filesys-Notify-Simple-0.06
Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/Devel-StackTrace-AsHTML-0.09.tar.gz ... OK
Configuring Devel-StackTrace-AsHTML-0.09 ... OK
Building and testing Devel-StackTrace-AsHTML-0.09 for Devel::StackTrace::AsHTML ... OK
Successfully installed Devel-StackTrace-AsHTML-0.09
Building and testing Plack-0.9929 for Plack ... OK
Successfully installed Plack-0.9929
http://yellowstore.dip.jp/test.html
GET /test.html HTTP/1.1
Host: yellowstore.dip.jp
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; ja; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
If-Modified-Since: Sun, 04 Apr 2010 06:02:04 GMT
If-None-Match: "325e8f-85-48362f3a97e2f"
Cache-Control: max-age=0
HTTP/1.1 304 Not Modified
Date: Sun, 04 Apr 2010 06:02:42 GMT
Server: Apache/2.2.12 (Ubuntu)
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Etag: "325e8f-85-48362f3a97e2f"
Vary: Accept-Encoding
----------------------------------------------------------
http://yellowstore.dip.jp/test.html
GET /test.html HTTP/1.1
Host: yellowstore.dip.jp
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; ja; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
If-Modified-Since: Sun, 04 Apr 2010 06:02:04 GMT
If-None-Match: "325e8f-85-48362f3a97e2f"
Cache-Control: max-age=0
HTTP/1.1 304 Not Modified
Date: Sun, 04 Apr 2010 06:06:55 GMT
Server: Apache/2.2.12 (Ubuntu)
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Etag: "325e8f-85-48362f3a97e2f"
Vary: Accept-Encoding
----------------------------------------------------------
http://dcs.consumerinput.com/fast-cgi/MI?ver=3ss&userid=30789874083664180®istrar=shr&d=http%3A%2F%2Fyellowstore.dip.jp%2Ftest.html
GET /fast-cgi/MI?ver=3ss&userid=30789874083664180®istrar=shr&d=http%3A%2F%2Fyellowstore.dip.jp%2Ftest.html HTTP/1.1
Host: dcs.consumerinput.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; ja; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ja,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
HTTP/1.1 200 OK
Date: Sun, 04 Apr 2010 06:06:56 GMT
Server: Apache/2.2.3 (Debian) mod_python/3.3.1 Python/2.5.1 mod_ssl/2.2.3 OpenSSL/0.9.8c
Keep-Alive: timeout=5, max=500
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
----------------------------------------------------------