stf icon indicating copy to clipboard operation
stf copied to clipboard

Crashing with error "Index 'present' was not found on table 'stf.devices'"

Open romitincedoinc opened this issue 11 years ago • 3 comments

FTL/reaper 28116 [reaper001] Unable to load initial state { name: 'ReqlOpFailedError', msg: 'Index present was not found on table stf.devices.', frames: [], message: 'Index present was not found on table stf.devices in:\nr.table("devices").getAll(true, {index: "present"})\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' } FTL/util:lifecycle 28116 [reaper001] Shutting down due to fatal error FTL/cli:local 28106 [*] Child process had an error ExitError: Exit code "1" at ChildProcess. (/usr/local/lib/node_modules/stf/lib/util/procutil.js:49:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at Process.ChildProcess._handle.onexit (child_process.js:797:12)

romitincedoinc avatar Nov 04 '15 16:11 romitincedoinc

Well, this is a known bug which is already fixed in master branch. Looks like you have installed stf using npm and npm latest version is pretty old compare to master branch. Refer: https://github.com/openstf/stf/issues/117

You have two choices. 1 Add 'present' index manually in devices table

  • Go to rethinkdb administrative UI (http://localhost:8080)
  • Open Data Explorer
  • Add index using query
 r.db("stf").table("devices").indexCreate('present');
  • Make sure your device table should look like below, check using this query.
r.db("stf").table("devices").info();

Output

{  
   "db":{  
      "id":"7195ff75-7ddf-49b5-99e9-64cebbd75da8",
      "name":"stf",
      "type":"DB"
   },
   "doc_count_estimates":[  
      0
   ],
   "id":"e4363c74-eaa3-42b6-b4d7-f019caed0bf6",
   "indexes":[  
      "owner",
      "present",
      "providerChannel"
   ],
   "name":"devices",
   "primary_key":"serial",
   "type":"TABLE"
}

2 Use master branch

You can find instruction here

vbanthia-zz avatar Nov 04 '15 17:11 vbanthia-zz

Most probably the problem is related to this rethinkdb bug. I am now able to reproduce this with rethinkdb < 2.1.3

These are my findings with different rethinkdb versions.

2.1.1 - X 2.1.3 - O 2.1.4 - O 2.1.5 - O

The problem is because indexes in devices tables are being created parallel and only the last one is actually being created.

vbanthia-zz avatar Nov 06 '15 17:11 vbanthia-zz

Problem occurs only with older rethinkdb.

Now, you can run stf doctor command in order to confirm all the stf dependencies.

vbanthia-zz avatar Feb 03 '16 07:02 vbanthia-zz