Closed GaikwadPratik closed 3 years ago
So the query here tries to be executed onto the unexisting database and returning the proper error. Also, the connection to the database is working in this example, so see no bug in this code. Closing.
@atassis,
The database does exists. I named them as UnknownDB
and UnknownTable
. That is bad on my part. I wasn't thinking clearly.
@atassis I renamed database and table and here is correct stack trace. Can you please reopen the issue again?
➜ rethink-test git:(main) npm run build && node dist/index.js
> rethink-test@1.0.0 build
> rm -rf dist/* && tsc
Database connection error received in handler, reinitializing changefeed once rethink is up
Reconnected to db localhost driver
/Users/pratikgaikwad/dev/hive/code/rethink-test/node_modules/rethinkdb-ts/lib/response/cursor.js:248
throw new error_1.RethinkDBError(results[0], {
^
RethinkDBError [ReqlOpFailedError]: cannot subscribe to table `TestRethinkErrorDB.TestRethinkErrorTable`: primary replica for shard ["", +inf) not available in:
r.db("TestRethinkErrorDB").table("TestRethinkErrorTable").changes({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
includeInitial: true,
^^^^^^^^^^^^^^^^^^^^^
squash: false
^^^^^^^^^^^^^
})
^^
at Cursor.handleErrors (/Users/pratikgaikwad/dev/hive/code/rethink-test/node_modules/rethinkdb-ts/lib/response/cursor.js:248:23)
at Cursor.resolve (/Users/pratikgaikwad/dev/hive/code/rethink-test/node_modules/rethinkdb-ts/lib/response/cursor.js:185:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Proxy.<anonymous> (/Users/pratikgaikwad/dev/hive/code/rethink-test/node_modules/rethinkdb-ts/lib/query-builder/term-builder.js:79:29)
at async main (/Users/pratikgaikwad/dev/hive/code/rethink-test/dist/index.js:58:24)
at async Object.error (/Users/pratikgaikwad/dev/hive/code/rethink-test/dist/index.js:95:13) {
msg: 'cannot subscribe to table `TestRethinkErrorDB.TestRethinkErrorTable`: primary replica for shard ["", +inf) not available',
_type: 17,
cause: undefined,
term: [
152,
[
[ 15, [ [ 14, [Array] ], 'TestRethinkErrorTable' ] ]
],
{ include_initial: true, squash: false }
],
backtrace: []
}
Created db and table
Please pull up the git repo one more time. I updated dbname and tablename in the source code. And the stack trace after renaming is above
Cannot receive an error locally, some problems on your test stand, or missing more info. But think its a first case, this error shows when rethinkdb is busy with smth
What more info do you need? So I should try by waiting more than 1 sec?
how to reproduce an error from scratch Which tables to create, etc
I used below queries to create database, and table in web explorer:
r.dbCreate("TestRethinkErrorDB");
r.db("TestRethinkErrorDB")
.tableCreate("TestRethinkErrorTable", { primaryReplicaTag: "hio_config", replicas: { "hio_config": 1 } });
the tag hio_config
is embedded in db server that I'm working with. In essence this should be replicable with default
tag as well.
So can you please reopen the bug so we can track it?
Steps to reproduce:
r.dbCreate("TestRethinkErrorDB");
r.db("TestRethinkErrorDB").tableCreate("TestRethinkErrorTable")
rethinkdb-error
repo from the link aboverpm run build && node dist/index.js
in rethinkdb-error
directorynode
code is running, restart rethinkdb
service(in my case, systemctl restart rethinkdb
).@atassis ,
Can you please re-open this bug? or I can create a new one with all the information, if you prefer it that way
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior: Use rethink-error to reproduce. After cloning it, run
nom run build && node dist/index.js
Expected behavior Query should be executed without any errors upon reconnection
Actual behavior I am getting below logs as output
System info
Ubuntu 18.04.5 LTS
with5.4.0-37-generic
rethinkdb 2.3.6+14+g9ca0d3+dirty~0 (CLANG 6.0.0 (tags/RELEASE_600/final))