"An extrinsic failed" when following Add a Pallet to Your Runtime tutorial - substrate

I've added nicks pallet as in Add a Pallet to Your Runtime tutorial
My changes are here https://github.com/led73/substrate-node-template/commit/8f3025a73b35804edf7c8dd7cd5630b387f2d344
But when I try to interact with the pallet and setName, it fails with event
system:ExtrinsicFailed:: (phase={"ApplyExtrinsic":1})-0
DispatchError: {"Module":{"index":9,"error":0}}, DispatchInfo: {"weight":50000000,"class":"Normal","paysFee":"Yes"}
An extrinsic failed. \[error, info\]
Where should I look what went wrong?
Screenshot is here

Your problem has an easy fix, check this line of your nicks pallet code, you are defining a minimum length of 8 characters, yet your test with larry will fail, as it doesn't reach the minimum requested length.
For future occasions there it goes a tip when a dispatch error happens.
index:9 and error:0 are the index of the pallet in construct_runtime! which is throwing the error, and the index of the error in the #[pallet::error] definition of the pallet concerned.
Error with index 0 for nicks pallet being this one

Related

Reading message from chronicle queue does not move the current index to the next cycle automatically

Reading message from chronicle queue does not move the current index to the next cycle automatically. I get the following logs messages:
697917 [SCHEDULER#4] INFO net.openhft.chronicle.queue.impl.single.SingleChronicleQueueExcerpts - Rolled 2 times to find the next cycle file. This can occur if you appenders have not written anything for a while, leaving the cycle files with a gap.
What does this means?
My queue files are : 20160824.cq4 20160826.cq4 20160829.cq4 20160830.cq4. The 20160825.cq4 file does not exist, because there was no data added to the queue.
Can you clarify what the error is you are getting?.
We have tests which show skipping missing cycles works both forwards and backwards.
What does this means?
You have explained it here
"The 20160825.cq4 file does not exist, because there was no data added to the queue."
which is why a cycle is skipped and you see
"Rolled 2 times to find the next cycle file. This can occur if you appenders have not written anything for a while, leaving the cycle files with a gap."
This is just FYI since I can't comment as I just signed up. I was seeing a similar issue however not with the empty journals between days, just multiple days. I was getting a false return from ExcerptTailer.readDocument and noticed that the index hopped by a number greater than 2^32 between my last index and my first indicating a cycle shift. I only switched versions from
compile 'net.openhft:chronicle-queue:4.5.5'
compile 'net.openhft:chronicle-queue:4.5.27'
And the issue was resolved. As I am just in a prototyping phase I have not had a need to keep up so was quite far behind. I hope this helps and it does indeed look to be resolved for my case anyway.

Lua hook-like call AFTER line processing

Lua features hook call BEFORE every processed line. What I need is a call AFTER line is processed, so that I can check for encountered errors and so on. Is there a way to make such kind of call?
Otherwise things get a little bit confusing if error is encountered at the last line of the script. I don't get any feedback.
UPDATE #1
We want to catch both Lua errors and 'our' errors asserted via lua_error(*L) C interface, and Lua should throw correct debug info including the line number where the error occurred.
Using return hook we always get error line number -1, which is not what we want. Using any combination of pcall and any hook setup after lua_error(*L) we get either line number -1, or number of the next executed line, never a correct one.
SOLUTION#
We managed to make everything work. The thing was that Lua throws a real C exception after it detects an error, so some of our 'cleaning & finalizing' C code called from Lua operation did not execute, which messed up some flags and so on. The solution was to execute 'cleaning code' right before calling lua_error(...). This is correct and desired Lua behavior as we really want to stop executing the function once lua_error(...) is called, it was our mistake to expect any code would be executed after lua_error(...) call.
Tnx Paul Kulchenko, some of this behavior was found while trying to design a simple example script which reproduces the problem.
Try setting a return hook: it'll be called after the last line is executed.
I'm not sure debug hook is the best solution for what you are trying to do (or you need to provide more details). If you just need to check for run-time errors, why use debug hooks at all if you can run your code with pcall and get an error message that points to the line number where the error happened (or use xpcall, which also allows you to get a stack trace)? You can combine this with debug.getinfo(func, "L") to get a table whose indexes are valid line numbers for the function.

Quartus vhdl error with pin assignments

I've always been able to compile my project without assigning pin assignments. However, now that I'm instantiating certain files within my project directory I am recieving the error:
Error (35032): Output port "pre_syn.bp.CPU_address_0_" on partition "Top" must drive a top-level pin but is driving ""
I've done my research and cannot find how to address this error because I haven't even assigned pins in the first place which I never have needed to before IOT get a full compilation.
Does anyone know what this error means and how I can trace it? (quartus is not helping very much) Thank you!

HTK HEREST ISSUE

I'm doing some speech recognition using HTK (HMM ToolKit) and I'm getting this odd error:
ERROR [+7390] StepAlpha: Alpha prune failed sq(16) > qHi(15)
I have tried to play around with pruning but only those 15/16 would change to other numbers, I keel receiving the same error. I've even tried to disable pruning and it keeps giving me this error.
I just don't know where to look for anything, if I knew I could fix it.
this is my HERest command:
HERest -C config -I Label.mlf -t 250 100 1000 -S trainlist.scp -H hmms\0\vFloors -H hmms\0\hmm0 -M hmms\1 wordlist
I've looked into the HTK book but there is nothing about the error number 7390.
I work with the HTK toolkit off and on, but not with HEREST. I also have never seen the error that you have encountered. A quick search on the web reveals some links that may be helpful.
Link 1
Scroll to the bottom of the link above, and you see an error code like ??9?. This means that a sanity check has failed. It further says that the error has nothing to do with your code, but that the HTK itself may be faulty. I think, given that Error 7390 has not occurred any where else, and that it also fits your error code, you might want to consider re-installing HTK.
Link 2
The link above shows a lot of common errors and its causes seen when working with the HTK toolkit. The original poster has painstakingly put up errors and common conditions that cause them. Saved me a lot of effort. In my eyes, she deserves the Nobel (or something like that).
Link 3
This link gives more detailed, module by module error codes. Also worth a look.
Do let me know here how you were able to solve your problem.
HTH,
Sriram.
In my case it was related to big (15 MB) file in input data. It worked after deleting it. Run HERest with -T 1 option to see which file causes problem, then remove or split it.
You must adjust -t parameter. This error occur when pruning is failed, so with modify prune parameter. I have this problem and with -t 10 it's solved!

amzi prolog + eclipse question

hey guys i have a question regarding amzi prolog with eclipse,
Im running a .pro file which executes a breadth first search and if queue gets too long,
the following error message appears:
system_error 1021 Control stack full.
Compile code or increase .cfg
parameter 'control'
If so, how may i run the compiled code under eclipse? I've tried running the project but the listener just ends without accepting any queries....?
Control stack full means one of two things:
You have a deep recursion that exhausts the control stack. In that case you need to increase the default value of 'control' in your amzi.cfg file. You may find you that have to increase 'heap', 'trail' and/or 'local' as well.
You have an error in your program causing an infinite recursion.
Running the program in the debugger will show you which case you've got. In the initial case you will see it digging deeper and deeper for a solution. In the later case you will see it chasing it's tail in circles with each recursion the same as the one before, but with different variables.
I don't know amzi prolog (I only used SICStus and SWI), and never used Eclipse for prolog, but as the error message says, try compiling (instead of consulting) your code. Look under project/properties for build configurations (like run/deug, as it works for Java/C++). Hopefully, that ".cfg paramerer" can also be accessed through project/properties.

Resources