HTTP APIs - getting 404s all the time...

We’ve got Event Store running on an AWS Linux server, and have it running nicely with remote connections sending event messages to the Store, with Projections working like a dream.

But now I need to get projections to be automatically deployable, so I’m attempting to use the HTTP API, and that’s where the problem starts. Following the Stream Metadata example:

curl -i http://127.0.0.1:2113/streams/$zme --user admin:changeit

I get:

HTTP/1.1 404 Not Found

Access-Control-Allow-Methods:

Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-Forwarded-Host, X-PINGOTHER, Authorization, ES-LongPoll, ES-ExpectedVersion, ES-EventId, ES-EventType, ES-RequiresMaster, ES-HardDelete, ES-ResolveLinkTo, ES-ExpectedVersion

Access-Control-Allow-Origin: *

Access-Control-Expose-Headers: Location, ES-Position

Content-Type:

Server: Mono-HTTPAPI/1.0

Content-Length: 0

Keep-Alive: timeout=15,max=100

I know that this stream exists because I am writing to it. In fact any call to http://127.0.0.1:2113/streams returns a 404.

I’ve checked that the endpoint is accessible with: curl -i ‘http://0.0.0.0:2113/web/index.html’ -u admin:changeit which returns:

Event Store - {{ $state.current.data.title }}

So I know that the endpoint is accessible.

What am I doing wrong?

What does your configuration look like?

It would appear you are setting ExtIp to 0.0.0.0. If that’s the case, you probably want to set AddInterfacePrefixes to false and then setup the http prefixes.

So, as part of the configuration file, you can set for example the following.

ExtIp: 0.0.0.0

AddInterfacePrefixes: false

ExtHttpPrefixes: http://*:2113/

You should then be able to use the ip address of the vm or the public ip address assigned by amazon.

Also,

curl -i http://127.0.0.1:2113/streams/$zme --user admin:changeit

Just make sure that you make sure that the ‘$’ gets encoded. i.e. %24zme. That said, $ in a stream name is reserved for streams internal to Event Store, so it’s advisable not to use them as you might just end up with conflicts or other undesired behaviours.

Which stream metadata example are you referring to?

curl -i http://127.0.0.1:2113/streams/$zme --user admin:changeit

There are three issues I see here. This has a $ in it which should be
url encoded, its pointing at a system stream that we don't have
(starts with a $), and its not metadata (metadata is
/streams/foo/metadata).

What do you get on a simple post/get from a stream named foo?

Currently its running with:
/run-node.sh --ext-http-prefixes=http://*:2113/ --ext-ip=0.0.0.0 --db /data/db --log /data/logs --run-projections=all

Good point on the $ streams, I shall fix that.

Thanks for those pointers - an error in the explanation there, I was looking for the metadata but kept getting 404s so stripped everything back to that I knew was a real stream.
I’ll remove the $ as doing a foo request as you suggested resulted in a HTTP/1.1 406 Description Document

So that’s getting me closer to where I need to be - thanks Greg

Rob

Try setting an accept header. The description document is just the
default for the stream.