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

Truffle Migration Failure #365

Closed
mnaamani opened this issue Jul 23, 2018 · 1 comment
Closed

Truffle Migration Failure #365

mnaamani opened this issue Jul 23, 2018 · 1 comment

Comments

@mnaamani
Copy link
Contributor

When running truffle migration I see the following error after the last migration step:

(node:63563) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected end of JSON input
(node:63563) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
node[63563]: ../src/timer_wrap.cc:107:static void node::(anonymous namespace)::TimerWrap::Stop(const FunctionCallbackInfo<v8::Value> &): Assertion `HandleWrap::IsAlive(wrap)' failed.
 1: node::Abort() [/usr/local/bin/node]
 2: node::(anonymous namespace)::DomainEnter(node::Environment*, v8::Local<v8::Object>) [/usr/local/bin/node]
 3: node::(anonymous namespace)::TimerWrap::~TimerWrap() [/usr/local/bin/node]
 4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/bin/node]
 5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/bin/node]
 6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
 7: 0x1f532b98463d

I believe this is a result of truffle not running the migrations sequentially, or issues with how async/await pattern is used in the migrations scripts.

Error seen when running following versions of node and truffle:

Node v8.9.4
Truffle v4.1.13

A good pattern that has worked well for me to use in the migrations scripts:

module.exports = function (deployer, network, accounts) {
  return deployer.then(async () => {

  })
}
@sohkai
Copy link
Contributor

sohkai commented Jul 24, 2018

Closed by #366.

@sohkai sohkai closed this as completed Jul 24, 2018
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

2 participants