Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations sometimes don't take effect when running stf local for the first time #509

Closed
weilinzhang opened this issue Dec 25, 2016 · 10 comments

Comments

@weilinzhang
Copy link

I have installed all requirements for stf and run npm install normally. but when I run stf local command, the error messages is threw.
FTL/reaper 690 [reaper001] Unable to load initial state { ReqlOpFailedError: Database stf does not exist in:
r.table("devices").getAll(true, {"index": "present"})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
at ReqlOpFailedError.ReqlError [as constructor] (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/errors.js:23:13)
at ReqlOpFailedError.ReqlRuntimeError [as constructor] (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/errors.js:90:51)
at ReqlOpFailedError.ReqlAvailabilityError [as constructor] (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/errors.js:167:56)
at new ReqlOpFailedError (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/errors.js:178:52)
at mkErr (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/util.js:177:10)
at TcpConnection.Connection._processResponse (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/net.js:152:16)
at TcpConnection.Connection._data (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/net.js:122:12)
at Socket. (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/net.js:689:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:551:20)
From previous event:
at Function.TermBase.run (/Users/zhangwl/work/stf-master/node_modules/rethinkdb/ast.js:135:12)
at /Users/zhangwl/work/stf-master/lib/db/index.js:110:14
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
at Object.db.run (/Users/zhangwl/work/stf-master/lib/db/index.js:109:23)
at Object.dbapi.loadPresentDevices (/Users/zhangwl/work/stf-master/lib/db/api.js:333:13)
at loadInitialState (/Users/zhangwl/work/stf-master/lib/units/reaper/index.js:80:18)
at module.exports (/Users/zhangwl/work/stf-master/lib/units/reaper/index.js:122:3)
at Object.module.exports.handler (/Users/zhangwl/work/stf-master/lib/cli/reaper/index.js:42:39)
at Object.self.runCommand (/Users/zhangwl/work/stf-master/node_modules/yargs/lib/command.js:169:22)
at parseArgs (/Users/zhangwl/work/stf-master/node_modules/yargs/yargs.js:869:28)
at Object.get [as argv] (/Users/zhangwl/work/stf-master/node_modules/yargs/yargs.js:809:16)
at Object. (/Users/zhangwl/work/stf-master/lib/cli/index.js:40:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
name: 'ReqlOpFailedError',
msg: 'Database stf does not exist.',
frames: [],
message: 'Database stf does not exist in:\nr.table("devices").getAll(true, {"index": "present"})\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^' }
FTL/util:lifecycle 690 [reaper001] Shutting down due to fatal error
FTL/cli:local 684 [] Child process had an error ExitError: Exit code "1"
at ChildProcess. (/Users/zhangwl/work/stf-master/lib/util/procutil.js:49:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
INF/cli:local 684 [
] Shutting down all child processes
INF/util:lifecycle 686 [app001] Winding down for graceful exit
INF/util:lifecycle 687 [dev001] Winding down for graceful exit
INF/util:lifecycle 688 [proc001] Winding down for graceful exit
INF/util:lifecycle 689 [proc002] Winding down for graceful exit
WRN/db 688 [proc001] Connection closed
INF/db 688 [proc001] Connecting to 127.0.0.1:28015
WRN/db 689 [proc002] Connection closed
INF/db 689 [proc002] Connecting to 127.0.0.1:28015

@weilinzhang
Copy link
Author

at the first time when I run stf local ,the error message is the stf database does not exist , so i create stf database in rethinkdb manually, then the message is Database stf does not exist in:
r.table("devices").getAll(true, {"index": "present"})

@0x88l
Copy link

0x88l commented Dec 26, 2016

Database have not created.Maybe is a bug in version 2.3.0.

@weilinzhang
Copy link
Author

@0x88l , where can I find scripts to create stf database in rethinkdb manually. I can't sure if it is a bug in version 2.3.0.

@0x88l
Copy link

0x88l commented Dec 27, 2016

Version 2.3.0 has update many files.I know there is a problem.However,I do not have detailed access.

@vbanthia-zz
Copy link
Member

Run stf migrate once before stf local. This may solve your problem.

@jasong-peakbagger
Copy link

@vbanthia Thank you kind sir! I was having the same error as described above and your pro-tip fixed the problem for me.

@tokinonagare
Copy link

tokinonagare commented Jan 29, 2017

@vbanthia Thanks, it‘s work for me : )

@sorccu
Copy link
Member

sorccu commented Jan 29, 2017

I had this error recently as well. My rethinkdb was starting extremely slowly since upgrading to Sierra, and that may have been the reason why the migration somehow didn't run. It may be related to rethinkdb/rethinkdb#6047. I found a way to fix the slowness in there which also fixed the migration issue (although it could've been a coincidence).

@sorccu sorccu changed the title stf local throw exception on Mac OS Migrations sometimes don't take effect when running stf local for the first time Jan 29, 2017
@perfectspr
Copy link

It works for me after changing the last line of lib/cli/local/index.js

  return procutil.fork(__filename, ['migrate'])
    .done(run)

to

return procutil.fork(path.resolve(__dirname, '..'), ['migrate']).done(run)

@sorccu
Copy link
Member

sorccu commented Feb 9, 2017

Cause found by @perfectspr in #509. Now fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants