Enabling projections

I have installed the 3.0.3 on a ubuntu 14.10, (following the instructions on the old ‘Installing event store on azure’ doc),
all is working fine, execept I cannot enable projections.

After a long delay, I get the following error message:

Enabling all projections have failed, reason : $by_event_type: null $by_category: null $stream_by_category: null $streams: null

Restarts and deleting the db don’t change anything…

Any reason ?

32bit or 64bit ubuntu?

Anything in log?

a 64bit ubuntu on Azure

Nothing in log

did you export LD_LIBRARY_PATH?

yes…

It’s listening on its public addess… not on 127.0.0.1 … could it be a prb ?

that doesnt have anything to do with it. Normally its something like
not being able to load the unmanaged stuff associated with v8.

What is your config/command line?

env LD_LIBRARY_PATH=’/datadrive/EventStore-OSS-Linux-v3.0.3/’

in the /etc/init/eventstore.conf file…

Actually it seems nothing happens at all, and the message seems to happen due to a timeout…

The yaml config file:

#Database and logs path

Db: /datadrive/eventstore/db

Log: /datadrive/eventstore/logs

ExtIp: 172.16.13.5

#Run all projections

RunProjections: All

and the /etc/init/eventstore.conf:

description “Event Store”

start on (filesystem and net-device-up eth0)

stop on runlevel [!2345]

Path to Event Store installation

env EVENTSTORE_DIR=’/datadrive/EventStore-OSS-Linux-v3.0.3/’

Path to Event Store Configuration file

env EVENTSTORE_CONFIG=’/datadrive/EventStore-OSS-Linux-v3.0.3/eventstore.config’

Path to v8 and js1

env LD_LIBRARY_PATH=’/datadrive/EventStore-OSS-Linux-v3.0.3/’

Name (and local user) to run Event Store as

setuid eventstore

Keep the process alive, limit to 5 restarts in 60s

respawn

respawn limit 5 60

Start

chdir /datadrive/EventStore-OSS-Linux-v3.0.3

exec ${EVENTSTORE_DIR}clusternode --config=${EVENTSTORE_CONFIG}

Can you run it with a --whatif just so it logs what your config if effectively?

Got this:

Exiting with exit code: 0.

Exit reason: WhatIf option specified

[08424,01,19:30:12.991]

ES VERSION: 3.0.3.0 (master/a1382252dd1ed0554ddb04015cdb2cbc1b0a65c1, Fri, 13 Mar 2015 13:56:05 -0400)

OS: Unknown (Unix 3.16.0.34)

RUNTIME: 3.12.0 (tarball) (64-bit)

GC: 2 GENERATIONS

LOGS: /datadrive/eventstore/logs

HELP: False ()

VERSION: False ()

LOG: /datadrive/eventstore/logs (Config File)

CONFIG: /datadrive/EventStore-OSS-Linux-v3.0.3/eventstore.config (Command Line)

DEFINES: ()

WHAT IF: True (Command Line)

INT IP: 127.0.0.1 ()

EXT IP: 172.16.13.5 (Config File)

INT HTTP PORT: 2112 ()

EXT HTTP PORT: 2113 ()

INT TCP PORT: 1112 ()

INT SECURE TCP PORT: 0 ()

EXT TCP PORT: 1113 ()

EXT SECURE TCP PORT: 0 ()

INT TCP HEARTBEAT TIMEOUT: 700 ()

EXT TCP HEARTBEAT TIMEOUT: 1000 ()

INT TCP HEARTBEAT INTERVAL: 700 ()

EXT TCP HEARTBEAT INTERVAL: 2000 ()

FORCE: False ()

CLUSTER SIZE: 1 ()

NODE PRIORITY: 0 ()

MIN FLUSH DELAY MS: 2 ()

COMMIT COUNT: -1 ()

PREPARE COUNT: -1 ()

ADMIN ON EXT: True ()

STATS ON EXT: True ()

GOSSIP ON EXT: True ()

DISABLE SCAVENGE MERGING: False ()

DISCOVER VIA DNS: True ()

CLUSTER DNS: fake.dns ()

CLUSTER GOSSIP PORT: 30777 ()

GOSSIP SEED: ()

STATS PERIOD SEC: 120 (Config File)

CACHED CHUNKS: -1 ()

CHUNKS CACHE SIZE: 536871424 ()

MAX MEM TABLE SIZE: 1000000 ()

DB: /datadrive/eventstore/db (Config File)

MEM DB: False ()

SKIP DB VERIFY: False ()

RUN PROJECTIONS: All (Config File)

PROJECTION THREADS: 3 ()

WORKER THREADS: 5 ()

HTTP PREFIXES: ()

ENABLE TRUSTED AUTH: False ()

CERTIFICATE STORE LOCATION: ()

CERTIFICATE STORE NAME: ()

CERTIFICATE SUBJECT NAME: ()

CERTIFICATE THUMBPRINT: ()

CERTIFICATE FILE: ()

CERTIFICATE PASSWORD: ()

USE INTERNAL SSL: False ()

SSL TARGET HOST: n/a ()

SSL VALIDATE SERVER: True ()

AUTHENTICATION TYPE: internal ()

PREPARE TIMEOUT MS: 2000 ()

COMMIT TIMEOUT MS: 2000 ()

UNSAFE DISABLE FLUSH TO DISK: False ()

GOSSIP INTERVAL MS: 1000 ()

GOSSIP ALLOWED DIFFERENCE MS: 60000 ()

GOSSIP TIMEOUT MS: 500 ()

[08424,01,19:30:13.057] Exiting with exit code: 0.

Exit reason: WhatIf option specified

And nothing at all in log about projections?

can you send them to me directly?

Ok, sent by mail…

Here is also the nginx config:
server {

listen 80;

server_name myserver;

access_log /var/log/www/eventstore/log/nginx.access.log;

error_log /var/log/www/eventstore/log/nginx.error.log;

location / {

proxy_pass http://172.16.13.5:2113;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $remote_addr;

}

}

Ok. got it.

The port redirection seems to make the command fail…

When using it on :2113 (and not :80 thru the proxy) it works !

Thx for help

For future people on this the issue seems to be the forwarding ...
will be looking at why its failing as it should work

What does the URI go back as is it 2113 or 80?

@jeremie do you set x-forwarded-port as well?

True, the x-forwarded-port make it now try on port 80… But the host is still the internal ip…

Here a the headers:

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-Port 80;

proxy_set_header X-Forwarded-For $remote_addr;

I also tried with :

proxy_set_header X-Forwarded-Host $http_host;

but it still uses the internal ip…

OOOkk !
It’s working now…

So, to make it work.

I added the x-forwarded-port 80 header and passed also the Host $host header.

And in the eventstore config I added the http://*:2113/ prefix.

This way, the url use the host passed by the proxy and the port forwarded by the proxy.

Thx for helping !