ArrayType is undefined when supplying a BN as an argument to an Anchor instruction - anchor-solana

The error message itself.
The code causing the error.
(Due to issues with shared clipboards, I can't copy/paste code from the VM I'm working in to the host machine.)
This seems to have something to do with the fact that I am supplying an anchor.BN as an argument, which I've managed to do elsewhere successfully, albeit not in the browser. On the Anchor discord, I heard that toArrayLike, one of the functions in the error's stack trace, does not exist in the browser, but I expect this was out of date. Any idea what might be going wrong here?

Related

How come Stackdriver messes up my error grouping

In my experience the Stackdriver Error Reporting service groups unrelated errors together. This is a big problem for me on several levels:
The titles often do not correlate to the reported errors in "recent samples". So I have to look at the samples for each error to see what errors really happend because the title really can't be trusted.
I might set an error to "muted" and as a result other errors that are grouped under the same title don't get reported anymore. It might take me months to discover that certain errors have been happening that I wasn't aware of.
In general I have no overview about what errors are happening in what rate.
This all seems to violate basic functionality for an error reporting system, so I think I must be missing something.
The code is running on Firebase Functions, so the Firebase flavour of Google Cloud Functions and is written in Typescript (compiled to Javascript with Firebase predeploy script).
I log errors using console.error with arguments formatted as Error instances like console.error(new Error('some error message')). AFAIK that is the correct way for code running on Node.js.
Is there anything special I can do to make Stackdriver understand my code better?
I have this in a root of my functions deployment:
import * as sourceMaps from "source-map-support";
sourceMaps.install();
Below is a screenshot of one error category. You see that the error title is "The service is currently unavailable", yet the samples contain errors for "Request contains an invalid argument" and "This request was already locked..."
The error about service and invalid argument could be related to the FCM service, so there is some correlation although I think these are very different errors.
The error about request lock is really something completely unrelated. The word "request" in this context means something really different but the word is the only relationship I can see.
The error reporting supports Javascript, but not Typescript as mentioned in the documentation for the product, nevertheless, you should take a look at your logs and see if they are properly formatted for them to be ingested in the error reporting.
Also, keep in mind that the errors are grouped based on the guidelines over at this document, so maybe you won't get the grouping you get due to them.
Hope you find this useful.

vb.net memory overflow without error trap using listview

I have the following code that is crashing:
Try
Logger.Warn("do_databind entered.")
Session("AgentId") = AgentId
Session("section") = Section
SectionId.Value = Section.ToString()
Session("dtresponses") = dtresponses
Session("dtlv") = dtlv
lvQuestions.DataSource = dtlv
Logger.Warn("just before databind.")
lvQuestions.DataBind()
Logger.Warn("databind successful. ")
Catch ex As Exception
Logger.Error(ex)
If Not IsNothing(ex.InnerException) Then
Logger.Error(ex.InnerException)
End If
End Try
The coding reaches the "just before databind" message, and then the application aborts. The "databind successful" message is never reached.
The catch loop is never reached because the error message in it is not recorded.
This has been working for months, and just quit working today. I would think it is a server problem.
The listview size at the point of the databind command is only 8 records, and I know the page it generates takes less than 10k total with a number of other blocks it generates.
In the old days, we would say this is probably a heap-stack collision, but I am not sure that terminology applies as well to managed memory in VB.Net. The code that traps the error is probably being overwritten. Other than that, I have no clue as to why it would stop working on our servers overnight.
Has anyone encountered this particular problem before?
UPDATE: The server indicates that it is a stack overflow error in w3wp.exe with error code 0xc00000fd (i.e., stack overflow)
I don't use the databinding or databound events for anything, but it would be an additional diagnostic to see where the memory crash may be occurring.
This app is in testing, so I have extensive error-trapping and comment logging at this point to make sure that the functions are working correctly.
The error does not leave a trace in the program. It is being caught by the server. This makes sense if the error is caused by a stack overflow. It is overwriting the catch code.
UPDATE:
Found the problem.
The program depends on a database, and a change was made to the database that resulted in a recursive procedure that called itself with the same information.
It ran until all the system memory on the server was consumed, and then aborted with a stack overflow error.
I put in diagnostic messages until I finally found it.
The trick here is it was on the staging server, and the database on the development server was not identical, so it worked on the development server the correct way but bombed on the staging server because the database contents were different.
I thought my coding had accounted for the condition that led to the error, but it had not.
Now I know to look for recursive problems if I get an abort in an application that is loaded with try-catch loops and results in no error logging where error logging should exist.

Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception

I've updated HereMaps JavaScript from 2.2.4 to 2.5.3 and the map has stopped working on Chrome (version 31.0.1650.57 m). Firefox and IE work as before.
On the console I see the message many times
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158
TypeError: Cannot read property 'body' of undefined
Does anyone have a hint of what might be wrong?
Thanks.
It is very difficult to answer your specific problem without seeing your code, but I am able to produce a similar error which may help you track down your issue.
If you are getting multiple error messages, then it is likely that the JavaScript library itself is calling something periodically. From the text of the error it likely that the library is running a Coroutine, which is usually used for threading within the application.
The error I can produce is in a callback - if I add an overlay to the map, and deliberately try to access a non-existent property within my code I can get:
Coroutine 'nokia.maps.map.render.p2d.Engine#_renderCo' aborted abnormally with exception base.js:158
TypeError: Cannot read property 'bar' of undefined
This was because I added a typo as follows:
I changed the reference from foo.something.bar in the callback to foo.does_not_exist.bar. So I guess somewhere in your callbacks you are referencing foo.something.body in your callback - it could be in a listener for example.
Another possibility, is that you are switching directly to Display.SATELLITE when you are creating the map - this is no longer allowed:
Taken from the News feed on developer.here.com:
Breaking changes with 2.5.3
The new rendering engine requires the map to be initialized
asynchronously. If you want to change the center, zoom level or the
base map type the API now requires the application to wait for the
"displayready" event to be fired. This event is only fired once.
Please refer to the developer's guide (section "Beyond the Basic Map Application
") for details.

TextField and Security Sandbox Violation

I am creating a TextField in my flash application, but when i am starting to write something the following error in written to trace:
* Security Sandbox Violation *
SecurityDomain xxx tried to access incompatible context yyy
What is the reason for that? How can i solve it?
The error doesn't have much to do with your Textfield. When you enter some text you must be starting some sort of logic that leads to this error. The error itself is pretty clear, some logic in your code seems to be loading some content and indicates a problem with your policy file. It's impossible to help without seeing some code, you need to implement some form of debug routine to try and break your application in different parts, according to each part's concern, in order to try & isolate the error.

Error on deserialization of Array Collection in Flex: RangeError: Error #2006

I am getting this error during serialization:
RangeError: Error #2006: The supplied
index is out of bounds.
The error occurs in AbstractMessage.as when it attempts to read input of timestamp.
After that my fault handler gets this error:
faultCode:Server.Acknowledge.Failed
faultString:'Didn't receive an
acknowledge message' faultDetail:'Was
expecting
mx.messaging.messages.AcknowledgeMessage,
but received null'
It appears to be happening as a result of an ArrayCollection coming back from the server.
Is it necessary to create custom classes to handle serialization of ArrayCollections with custom objects as shown here?
I've also followed the serialization recommendations here with no luck.
Thanks for your help!
The solution was correcting a mistake in writeExternal on the Java side. I was being very careful about the order of serialization but was writing an int as an object using writeObject. This will cause errors in completely unrelated code on the client side after it tries to readInt.
I just experienced this error myself, and it turns out it is caused by the Flash Builder Network monitor being enabled!! FB 4.0.1 this is.
I was going nuts for not finding the reason, so sharing it here for your peace of mind.

Resources