Skip to content

Server crash when using RethinkDB storage #25

@nfsmaniac

Description

@nfsmaniac

Deepstream.io v5.0.4 Linux binary

As I wasn't able to set custom db name in Deepstream config, I created in RethinkDB web interface fresh database deepstream and then a devices table in it (but I changed primary key name to imei).
Then inserted sample document
r.db('deepstream').table('devices').insert({ imei: "123456789876543", holder: "John Doe", contacts: ["[email protected]", "[email protected]"] })

Now I accessed local HTML file to read holder value.

<!DOCTYPE html>
<html>
    <head>
        <script src="https://cdn.deepstream.io/js/client/latest/ds.min.js"></script>
    </head>
    <body>
        <script type="text/javascript">
            const client = new DeepstreamClient('ip:6020')
            client.login()
            const record = client.record.getRecord('123456789876543')
            console.log(record.get('holder'));
        </script>
    </body>
</html>

Unfortunately it causes immediate server crash.
Result:

CONFIG_TRANSFORM | Loaded content from /root/deepstream/conf/permissions.yml for fileLoad(permissions.yml)
INFO | logger ready: std out/err
INFO | server name: k2nr950f-y1l1uyke5ao0
INFO | deepstream version: 5.0.4
INFO | configuration file loaded from conf/config.yml
INFO | library directory set to: /root/deepstream/lib
CLUSTER_JOIN | k2nr950f-y1l1uyke5ao0
CLUSTER_SIZE | The cluster size is now 1
INFO | logger ready: std out/err
INFO | monitoring ready: Noop Monitoring
INFO | subscriptions ready: Subscription Registry
INFO | cache ready: Local Cache
INFO | permission ready: Valve Permissions
INFO | locks ready: Distributed Lock Registry
INFO | clusterNode ready: Single Cluster Node
INFO | clusterRegistry ready: Distributed Cluster Registry
INFO | clusterStates ready: Distributed State Registry
INFO | authentication ready: Open Authentication
INFO | Listening for http connections on 0.0.0.0:6020
INFO | Listening for health checks on path /health-check
INFO | httpService ready: NodeJS HTTP Service
INFO | storage ready: Rethinkdb Storage Connector 2.0.0
INFO | connectionEndpoint ready: Binary WebSocket Connection Endpoint
INFO | connectionEndpoint ready: WS Text Protocol Connection Endpoint
INFO | connectionEndpoint ready: WS Text Connection Endpoint
INFO | connectionEndpoint ready: HTTP connection endpoint
INFO | Deepstream started
INCOMING_CONNECTION | from undefined (censored.ip.address.__)
AUTH_SUCCESSFUL | open

/root/deepstream/lib/@deepstream/storage-rethinkdb/src/connector.ts:155
            version = entry.__ds._v
                                 ^
TypeError: Cannot read property '_v' of undefined
    at rethinkdb.table.get.run (/root/deepstream/lib/@deepstream/storage-rethinkdb/src/connector.ts:155:34)
    at tryCatcher (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/util.js:26:23)
    at Promise.successAdapter (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/nodeify.js:23:30)
    at Promise._settlePromiseAt (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/promise.js:582:21)
    at Promise._settlePromises (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/promise.js:700:14)
    at Async._drainQueue (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/async.js:123:16)
    at Async._drainQueues (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues (/root/deepstream/lib/@deepstream/storage-rethinkdb/node_modules/bluebird/js/main/async.js:15:14)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions