-
-
Save talexb/95153b422598cd499509 to your computer and use it in GitHub Desktop.
Testing API -- getting 404 for my local API access.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@debian:~/dev$ cat api-test1.pl | |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use ElasticSearch; | |
{ | |
my $es = ElasticSearch->new( servers => 'localhost:5000', no_refresh => 1 ); | |
# my $es = ElasticSearch->new( servers => 'api.metacpan.org', no_refresh => 1 ); | |
my $scroller = $es->scrolled_search( | |
query => { match_all => {} }, | |
search_type => 'scan', | |
scroll => '5m', | |
index => 'v0', | |
type => 'author', | |
size => 15, | |
); | |
my $max = 30; | |
while ( my $result = $scroller->next ) { | |
print $result->{_source}->{author}, $/; | |
last unless ( --$max ); | |
} | |
} | |
vagrant@debian:~/dev$ perl -w api-test1.pl | |
[ERROR] ** ElasticSearch::Error::Missing at /usr/local/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/ElasticSearch/Transport/HTTP.pm line 67 : | |
Not Found (404) | |
With vars:{ | |
'request' => { | |
'qs' => { | |
'scroll' => '5m', | |
'search_type' => 'scan' | |
}, | |
'post_process' => undef, | |
'as_json' => undef, | |
'cmd' => '/v0/author/_search', | |
'method' => 'GET', | |
'data' => { | |
'query' => { | |
'match_all' => {} | |
}, | |
'size' => 15 | |
} | |
}, | |
'status_code' => 404, | |
'content' => '{ | |
"code" : 404, | |
"message" : "v0/author/_search" | |
} | |
', | |
'server' => 'localhost:5000', | |
'status_msg' => 'Not Found' | |
} | |
vagrant@debian:~/dev$ |
vagrant@debian:~/dev$ perl -w api-test2.pl
[Thu Aug 8 14:28:00 2013] Protocol: http, Server: localhost:5000
curl -XGET 'http://127.0.0.1:9200/v0/author/MSTROUT?pretty=1'
[Thu Aug 8 14:28:01 2013] Response:
{
"message" : "v0/author/MSTROUT",
"code" : 404
}
[ERROR] ** ElasticSearch::Error::Missing at /usr/local/perlbrew/perls/perl-5.16.2/lib/site_perl/5.16.2/ElasticSearch/Transport/HTTP.pm line 67 :
Not Found (404)
With vars:{
'request' => {
'qs' => {},
'post_process' => undef,
'as_json' => undef,
'cmd' => '/v0/author/MSTROUT',
'method' => 'GET',
'data' => undef
},
'status_code' => 404,
'content' => '{
"code" : 404,
"message" : "v0/author/MSTROUT"
}
',
'server' => 'localhost:5000',
'status_msg' => 'Not Found'
}
vagrant@debian:~/dev$
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)
at org.apache.lucene.store.Lock.obtain(Lock.java:84)
at org.apache.lucene.index.IndexWriter.(IndexWriter.java:1098)
at org.apache.lucene.index.XIndexWriter.(XIndexWriter.java:17)
at org.elasticsearch.index.engine.robin.RobinEngine.createWriter(RobinEngine.java:1365)
at org.elasticsearch.index.engine.robin.RobinEngine.start(RobinEngine.java:250)
... 6 more
Caused by: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.(RandomAccessFile.java:233)
at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:203)
at org.apache.lucene.store.Lock.obtain(Lock.java:95)
... 10 more
[2013-08-08 13:40:57,649][WARN ][cluster.action.shard ] [Vibraxas] sending failed shard for [cpan_v1][1], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][1] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][1] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,649][WARN ][cluster.action.shard ] [Vibraxas] received shard failed for [cpan_v1][1], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][1] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][1] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/1/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,652][WARN ][cluster.action.shard ] [Vibraxas] sending failed shard for [cpan_v1][0], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][0] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][0] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,652][WARN ][cluster.action.shard ] [Vibraxas] received shard failed for [cpan_v1][0], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][0] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][0] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/0/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,655][WARN ][cluster.action.shard ] [Vibraxas] sending failed shard for [user][0], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[user][0] failed recovery]; nested: EngineCreationFailureException[[user][0] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,655][WARN ][cluster.action.shard ] [Vibraxas] received shard failed for [user][0], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[user][0] failed recovery]; nested: EngineCreationFailureException[[user][0] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/user/0/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,659][WARN ][cluster.action.shard ] [Vibraxas] sending failed shard for [cpan_v1][2], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][2] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][2] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)]; ]]
[2013-08-08 13:40:57,659][WARN ][cluster.action.shard ] [Vibraxas] received shard failed for [cpan_v1][2], node[DEJRUWKhSN2NnGibct5PEA], [P], s[INITIALIZING], reason [Failed to start shard, message [IndexShardGatewayRecoveryException[[cpan_v1][2] failed recovery]; nested: EngineCreationFailureException[[cpan_v1][2] failed to create engine]; nested: LockObtainFailedException[Lock obtain timed out: NativeFSLock@/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock: java.io.FileNotFoundException: /var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)]; nested: FileNotFoundException[/var/elasticsearch/metacpan_v1/nodes/0/indices/cpan_v1/2/index/write.lock (Permission denied)]; ]]