Kaizala Web is crashing due to accessing an undefined variable - kaizala

We adopted Kaizala as a way for our employees to stay in touch with our customers. Kaizala itself is installed on a Tablet every employee has and they are mainly using the Web App of Kaizala for communication.
After roughly 1 month, today the web app of one employee consistently fails. Meaning after providing a location, the phone number and the code for coupling, the web app briefly shows the list of chats and groups and than turns white. This happens on all major browsers only for this user.
In the DevTools theres this output
webcommon.js?v=1.1.20.0713.173537:164 TypeError: Cannot read property 'convId' of undefined
at Function.mapToProps (webapp.js?v=1.1.20.0713.173537:47)
at r (webcommon.js?v=1.1.20.0713.173537:1)
at Function.r.mapToProps (webcommon.js?v=1.1.20.0713.173537:1)
at r (webcommon.js?v=1.1.20.0713.173537:1)
at webcommon.js?v=1.1.20.0713.173537:1
at Object.run (webcommon.js?v=1.1.20.0713.173537:1)
at a.initSelector (webcommon.js?v=1.1.20.0713.173537:1)
at new Connect(t) (webcommon.js?v=1.1.20.0713.173537:1)
at constructClassInstance (webcommon.js?v=1.1.20.0713.173537:164)
at beginWork (webcommon.js?v=1.1.20.0713.173537:164)
Which I traced to this location (pretty printed, in webapp.js), the error mentioned above happens on the 3rd row.
t.ConversationItemContainer = i.connect((function(e, t) {
var n = e.conversationsState.allConversations[t.convId]
, i = e.conversationsState.allConversationsMetadata[t.convId]
, r = e.conversationsState.selectedConversation === n.convId
, a = t.conversationItemIndex
, l = t.conversationListSize
, u = o.conversationsSelectors.getAccessPolicyResult(e, n.convId)
, p = c.groupManagerSelectors.getTenantData(e, n.tenantId);
And in there, t.convId is undefined but other attributes are set.
Does someone has an idea what maybe is the source problem?
[Update]
Using break points in Chrome's DevTools I could see, that in line
var n = e.conversationsState.allConversations[t.convId]
the value for t.convId was undefined, which led to line
r = e.conversationsState.selectedConversation === n.convId
throwing the mentioned TypeError, to the fact, that n was undefined

I solved the problem by mere luck I think. In all groups that one employee (with the problems) was in, there also was at least one other employee in. Other employees didn't had those problems, so I guessed, that the problem of the crashing web app didn't come from groups but from one-on-one conversations.
Having the employee with the problems delete all the one-on-one conversations resulted in solving the problem. Now we can only guess that maybe in one of those conversations there was only one message which got deleted. And maybe with the deletion of that one message (being the only one in the conversation) the whole conversation was deleted but not completeley. That's at least what I can guess due to the fact that t.convId was undefined.

Related

Magento 1.9 site where "SQL ERROR: SQLSTATE[42S22]" keeps showing up after daily reindex (and in other instances)

I own a Magento CE 1.7 based website where we keep getting variations of the following error, usually after the daily morning site reindex:
"SQL ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.data' in 'field list'
SQL QUERY: SELECT DISTINCT main_table.data, main_table.lifetime, main_table.expire, main_table.priority, additional_table.*, IFNULL(al.value, main_table.frontend_label) AS store_label FROM eav_attribute AS main_table
INNER JOIN catalog_eav_attribute AS additional_table ON additional_table.attribute_id = main_table.attribute_id
LEFT JOIN eav_attribute_label AS al ON al.attribute_id = main_table.attribute_id AND al.store_id = 1 WHERE (main_table.entity_type_id (...)"
I have a website down detector set up so that I can know immediately when the site is unavailable. However it obviously doesn't detect whenever the site is unusable due to errors such as “SQL ERROR: SQLSTATE[42S22]”. That means that my team must be constantly manually (!!!) monitoring if the site is indeed working properly (by clicking on product and category links)!
Usually we surpass the error by just cleaning the cache or performing a new reindex.
My questions are the following:
1 - Is there a way of automatically perform a detection of this type of errors in Magento so that - if it happens - a cache cleaning (or a site reindex) is immediately run and an alert is sent to the webmaster?
2 – If such an error is detected, is there a way of it not be shown to the person accessing the site? That is, if the error is detected, is it possible to immediately display a message (“We’ll be back soon”) while the cache is being cleaned or the site reindexed?
I will be grateful for any help you can provide.
Thank you!

Log messages classification/grouping and finding human readable pattern for each group

As new to data science and machine learning I would like to ask the following questions about the problem explained below:
Is machine learning good for such problem or is it overkill?
Could this problem be related with another classical problem that has already published papers so I can choose the right solution?
The problem:
I've been doing a research on pretty interesting problem that I believe many Analytics system solved by automated process.
We are collecting many JavaScript error messages that happen in all kind of browsers and custom build web applications. Our goal is to group the similar messages and label each group by the common pattern the grouped messages have.
Example:
+---------------------------------------------------------------+
|Label: "Forbidden: User session {{placeholder1}} has expired." |
+---------------------------------------------------------------+
|Message: "Forbidden: User session aad3-1v299-4400 has expired."|
|Message: "Forbidden: User session jj41-1d333-bbaa has expired."|
|Message: "Forbidden: User session aab3-bn12n-1111 has expired."|
+---------------------------------------------------------------+
So far we have semi-automated process that solves the problem but from time to time we get new user generated JavaScript error messages that slip through our filters.
I've been thinking about naive 2 step approach that uses existing libraries/tools/algorithms.
For a batch of error lines run an algorithm (e.g. Levenshtein) that finds similar strings. Group the similar errors.
Within a group of similar strings run a diff and find the dynamic parts. Check the diff:
For reference here we have error messages that were collected in the period of one minute:
Message: 3312445,Error: Unknown page "retina_list"
Message: 9931234,Error: Unknown page "widget_summary"
Message: ReferenceError: 'alg,TypeError: g' is undefined
Message: 522574,Error: Unknown page "page_options"
Message: ReferenceError: '297756| Zly / Error in handler for event:,[object Object],ApiListenerError: TypeError: a' is undefined
Message: [Euv warn]: style="width: {{item.evaluation}}em": interpolation in 'style' attribute will cause the attribute to be discarded in Internet Explorer. Use krt-bind:style instead. (found in component: <default-componentfalse2320383>)
Message: [Euv warn]: src="//www.example.com/image/{{item._id}}-1.jpg?w=220&h=165&mode=crop": interpolation in 'src' attribute will cause a 404 request. Use krt-bind:src instead. (found in component: <default-componentfalse8372912>)
Message: [Euv warn]: src="//www.example.com/image/{{item._id}}?car=recommend_sp312": interpolation in 'src' attribute will cause a 404 request. Use krt-bind:src instead. (found in component: <default-componentfalse3330736>)
Message: [Euv warn]: src="//www.example.com/image/{{item._id}}-1.jpg?w=220&h=165&mode=crop": interpolation in 'src' attribute will cause a 404 request. Use krt-bind:src instead. (found in component: <default-componentfalse4893336>)
Message: ReferenceError: 'alg,TypeError: g' is undefined
Message: 73276| Zly / Error in handler for event:,[object Object],ApiListenerError: TypeError: Cannot read property 'campaignName' of undefined
Message: ReferenceError: 'alg,TypeError: g' is undefined
Message: ReferenceError: 'bend,TypeError: f' is undefined
I've been playing lately with Tensorflow JS where I am complete beginner but I may try to train something that could help me classify strings and label them.
I also think that the more serious problem is to generate the group label than grouping the strings because sometimes a pair of similar strings have very different length and the placeholders are long sentences with special characters like \,".^%#&*!?<>|][{}.
As you have pointed out, it sounds like we can separate this problem into two distinct steps.
Group together similar messages, and
Label each group.
Step 1:
While I am not too familiar with Tensorflow JS, I do not believe it is overkill to use Machine Learning (ML) to tackle this problem, especially for step 1.
In fact, this type of problem is a great candidate for a specific form of ML known as Unsupervised Learning, and more specifically, Clustering. In Unsupervised Learning, we look to find “previously unknown patterns in our data without pre-existing labels”.
See: https://en.wikipedia.org/wiki/Unsupervised_learning
In this context, that means that we do not know if “Error Message 1” and “Error Message 2” will belong to the same group before we apply our Clustering algorithm. Using your example, we can reasonably suspect that the messages:
“Forbidden: User session aad3-1v299-4400 has expired"
“Forbidden: User session jj41-1d333-bbaa has expired"
will belong to the same group, but the Clustering algorithm does not know this when it starts.
We can contrast this with a form of Supervised Learning known as Classification, where we know beforehand that we expect a group to have the form
“Forbidden: User session {{placeholder1}} has expired".
Then the pre-existing labels in the data are that messages such as
“Forbidden: User session aad3-1v299-4400 has expired"
“Forbidden: User session jj41-1d333-bbaa has expired"
belong to the expected group just above. We essentially give the ML model a bunch of examples of what this group looks like, and then incoming messages that appear to be similar will be classified to this group.
It sounds like from your description that for Step 1, you want to perform a string match (such as Levenshtein) to compare all of the example messages, and then apply a Clustering algorithm to those results. Then after you have groups (clusters) of messages, Step 2 involves finding an appropriate label for each group.
Step 2:
Agreed that finding an appropriate label for each group is likely the harder problem here. One approach that could be useful is to count how many times a word or phrase appears within a group or cluster, and if it does not meet some pre-defined threshold, to use a placeholder as you have in your example label. For example, the words “Forbidden”, “User”, “session”, and “expired” will be common to the group, whereas the alpha numeric ID’s listed are unique to the individual messages. If the threshold is that a word or phrase must show up in at least two messages, only the ID’s will be replaced by the placeholder.
In this approach, you are essentially looking to find words or phrases that are uncommon to the group, and do not provide useful information in forming an appropriate label. In a way, this is the opposite of a concept used in many search engines that aims to find how common or important a word or phrase is to a document (see https://en.wikipedia.org/wiki/Tf%E2%80%93idf).

MB_CREATE_GOODS_MOVEMENT returns subrc = 5 when running BAPI_GOODSMVT_CREATE

Using me21n to do a returns purchase order (credit) we are getting a pretty uninformative error text in the return table when creating a MIGO entry. This is an enhanced step on the user exit. BAPI_GOODSMVT_CREATE returns;
1, E, WRF_CONS, 010, No data available, , 000000, , , , , GOODSMVT_ITEM, 1, , RPECLNT500
I have attempted to debug further as 'No data available' doesn't mean a whole lot to me. I noticed MB_CREATE_GOODS_MOVEMENT returned a subrc of 5 in the EMKPF structure. Not sure if i have gone off on a tangent here or not... Its pretty darned heavy going in there.
Anyway the create MIGO step is only giving the above return error for a particular vendor code. When we use the exact same data with the exception of Vendor code and Info Record (which populates automatically via the vendor selection) the MIGO step is successful. Any suggestions?
Thanks for the help
Ok this is resolved. We had to add partner LF into Site A302 for Vendor profile. Then add the STO details in SPRO. Huzar for config....

How to track down a AccessViolationException from a CLI project?

We got a CLI Wrapper that uses C++ Code written by another team. Since a few versions with very large changes in the sourcecode, we get randomly AccessViolationExceptions from the CLI. Its completely random, we tried to figure out under which circumstances the exception occurs - without success.
The Stacktrace is the following:
at QDataStream.{ctor}(QDataStream* , QByteArray* , QFlags<enum QIODevice::OpenModeFlag>* )
at XMLParsers.privGetCheckSumOf(XMLParsers* , ParameterManager* PM, ActiveFlag Active)
at XMLParsers.Set_XMLStream(XMLParsers* , QXmlStreamWriter* pXSW, ParameterManager* PM, ActiveFlag Active)
at XMLParsers.ExportToExchangeFormat(XMLParsers* , QString* , ParameterManager* PM, ActiveFlag Active)
at XMLParsers.ExportToXML(XMLParsers* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , ParameterManager* PM, ActiveFlag Active)
at ParameterManager.GetExchangeFormat(ParameterManager* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* , ActiveFlag Active)
My first step was to search the internet for exceptions when using QDataStream - but i did not found any. So my fear is now that some internal pointers are broken. The only strange thing is, that this exception just happens randomly with the very same input given. (about 1-2% of all calls)
Anyway, posting the original Sourcecode would be way too much here - the lines of codes invoked in the C++ code are several thousand, so my main question here is not in which specific line the exception has its origin, but rather how (in general) we can narrow down this AccessViolationException.
Which memory profiling tool would you recommend? I assume that the call to the QDataStream Ctor above is not the reason of this exception, i think it's just the part where the (already invalid state of the class) can be detected.
Can i get any further informations from an AccessViolationException? At the moment, my application just crashes and i'm only able to get the stacktrace from the windows event log.
Any other hints what we could check / change in our CLI to find out detailed informations of this exception?
Any help is appreciated, as we're getting despaired of this bug after searching for many days (and nights..).

Apple iOS ASlog, polling for messages.. [code]

After reading these links:
Using Objective C to read log messages posted to the device console
https://developer.apple.com/library/ios/#documentation/System/Conceptual/ManPages_iPhoneOS/man3/asl.3.html
I've successfully posted messages to the ASlog using
aslmsg m = asl_new(ASL_TYPE_MSG);
asl_log(NULL, m, ASL_LEVEL_INFO, result);
The problem is that when I go to query the log there is extreme lag in getting the results. It seems to be searching everything since I started printing with NSLog earlier today.
My current code to get the information is:
q = asl_new(ASL_TYPE_QUERY);
asl_set_query(q, ASL_KEY_SENDER, "db_poc", ASL_QUERY_OP_EQUAL);
asl_set_query(q, ASL_KEY_TIME, "1306768140", ASL_QUERY_OP_GREATER);
I'm trying to get my app to send messages to the console (from javascript/UIWebview). I want to then watch the console for these messages so I can send data back to the UIWebviews javascript code..
I wonder are there any extra flags I can set on either send or receive side to speed up things? Also, is there a way to clear this ASlog?
Any ideas..?
Thanks.
Have you tried creating your own aslclient using ASL_OPT_NO_DELAY?