I am using ussd-builder to build a ussd app, I have installed ussd-builder in my local project - node.js

While running the project I get below error which i am stuck on how to solve it.
Failed to get route: TypeError: Cannot read property 'split' of undefined
at UssdMenu.resolveRoute (C:\Users\admin\Documents\USSD\tuma-ussd\node_modules\ussd-builder\lib\ussd-menu.js:135:47)
at C:\Users\admin\Documents\USSD\tuma-ussd\node_modules\ussd-builder\lib\ussd-menu.js:572:22
at processTicksAndRejections (internal/process/task_queues.js:95:5)
This is not stable where i can say it happen on the specific step, but at any on the step can happen or pass the step that it happen before and appear on another step.
Please guys help me on how to solve the error.

Related

Free search failed in OpenSearch Dashboards(Kibana)

I got OpenSearch installed and from time to time i got free search failure.
When i try to search anything in a search tab i got an error.
i searched for the cause of the error and tried many different possible solutions.
Currently the "solution" is to delete the index and recreate it, but it's not ideal for anybody.
I wonder if there is anyone who knows the way to prevent this issue or fix it without deleting the index.
thank you.
Error: Bad Request
at Fetch._callee3$
(http://opensearch.com/1/bundles/core/core.entry.js:6:59862)
at tryCatch (http://opensearch.com/1/bundles/plugin/queryWorkbenchDashboards/queryWorkbenchDashboards.plugin.js:1:33827)
at Generator.invoke [as _invoke] (http://opensearch.com/1/bundles/plugin/queryWorkbenchDashboards/queryWorkbenchDashboards.plugin.js:1:37778)
at Generator.next (http://opensearch.com/1/bundles/plugin/queryWorkbenchDashboards/queryWorkbenchDashboards.plugin.js:1:34966)
at fetch_asyncGeneratorStep (http://opensearch.com/1/bundles/core/core.entry.js:6:52965)
at _next (http://opensearch.com/1/bundles/core/core.entry.js:6:53281)
Here is the logs from the opensearch node:
Opensearch logs

java.net.ConnectException: Connection refused: connect error thrown in the middle of the webdriverio v7 test

I am using webdriverIO v7 and cucumber to test my application.
I have feature file with 10 scenarios.
What happens is that when I run the test then first 4 scenarios are executed seamlessly and on the fifth scenario all of sudden I get the error:
unknown error: java.net.ConnectException: Connection refused: connect
at Object.getErrorFromResponseBody (C:\my-project\node_modules\webdriver\build\utils.js:189:12)
at WebDriverRequest._request (C:\my-project\node_modules\webdriver\build\request.js:168:31)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at Browser.runCommandWithHooks (C:\my-project\node_modules\#wdio\sync\build\wrapCommand.js:105:25)
at Browser.runCommandWithHooks (C:\my-project\node_modules\#wdio\sync\build\wrapCommand.js:100:24)
at Browser.url (C:\my-project\node_modules\#wdio\sync\build\wrapCommand.js:67:44)
at MyPage.openImportPage (C:\my-project\src\pages\/myPage.js:32:17)
at forEach (C:\my-project\src\helpers\/helpers.js:60:21)
at Array.forEach (<anonymous>)
at Helpers.deleteWishLists (C:\my-project\src\helpers\/helpers.js:55:51)
at World.<anonymous> (C:\my-project\src\step_definitions\/config_steps.js:28:13)
at World.executeSync (C:\my-project\node_modules\#wdio\sync\build\index.js:38:22)
at World.executeSync (C:\my-project\node_modules\#wdio\sync\build\index.js:52:38)
at C:\my-project\node_modules\#wdio\sync\build\index.js:69:68
The first step of the fifth scenario is also executed in previous scenarios which succeeded normally.
It doesn't behave consistently - for example, when running for the second time in non headless mode all scenarios passed (all of a sudden).
Running in headless mode, sometimes all scenarios fail with that exception, sometimes only some fail - no rule to notice there.
It is very confusing. I assume it has nothing to do with my tests since sometimes they are all passing, but has to do with my setup or internet connection or webdriverIO framework and its standalone mode ...
Does anybody have clue why is this happening. Who is the trouble maker here?
I don't even know in which direction should I look to in order to investigate this.
Please help.
Thanks!
At the end the issue was with my internet connection.
Guys from wdio made small patch for it:
https://github.com/webdriverio/webdriverio/issues/6728

problem running simple demo example google-maps-services-js with Node

I have a problem running this simple demo example for google-maps-service with Node:
https://github.com/jpoehnelt/google-maps-services-js-demo
I am not sure what I am missing. When I run npm start, I get this error:
TypeError: Cannot read property 'elevation' of undefined
at D:\node_practice\google-maps-services-js-demo\index.js:14:35
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I am using nvm and my node version is 13.9.0. I tried it on two different machines (one windows with above node version, one ubuntu) and both got the same error.
it seems the response coming back is empty. your r.data is empty, which means results[0] is undefined, so is the reason you are getting Cannot read property 'elevation' of undefined.
Below is the actual exception coming back from the APIs
"You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account"
Get the instruction of getting an API key from here https://developers.google.com/maps/documentation/directions/get-api-key
and use the same with your code.

How to debug mystery ENOTFOUND?

I am getting random restarts on a PM2 managed nodejs cluster. The only symptom I get on the error log is of the following pattern - an ENOTFOUND on dns.js.
Error: getaddrinfo ENOTFOUND walkinto.inhttp walkinto.inhttp:80
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
Clearly the problem is a malformed server name - walkinto.inhttp is incorrect and it should be walkinto.in . The challenge is that this is not a host name hard coded in the code. There are many places in this fairly large code base that makes name resolution and it is of dynamic nature.
I have spent considerable time to pinpoint the root cause but so far have had no luck. I need help to print more log information from dns.js; probably a call stack 'may' would help to move forward.
Q1 : How to enable more detailed logging on nodejs core modules?
Q2 : What could cause a nodejs restart to happen for an ENOTFOUND? How to avoid a restart - This path is not desirable.
Q3: Are there any other smarter way to trouble shoot this problem?
Since there's no way for us to help you solve the issue without some code to go on, I'll answer your questions:
How to enable more detailed logging on nodejs core modules?
Run node with the inspect option and attach to the debugger with Chrome DevTools or another application. See these links:
https://nodejs.org/api/debugger.html
https://nodejs.org/en/docs/guides/debugging-getting-started/
What could cause a nodejs restart to happen for an ENOTFOUND? How to avoid a restart - This path is not desirable.
The Node runtime isn't restarting. The error you're seeing is generated from something similar to throw new Error(`getaddrinfo ${err}`), and any uncaught error from throw will crash the runtime.
The restart is happening because you run the app via PM2, and can be disabled by passing the --no-autorestart option to PM2. If you want to avoid the application from crashing, you should wrap whatever code that this could be generated from in a try/catch-block, and try to recover from the error.
Are there any other smarter way to trouble shoot this problem?
This is most likely not an issue with the dns stdlib module. If I understand correctly, you are performing name resolutions on dynamically generated data, and that is most likely your issue. Somewhere in the code you have one or more functions that are either not validating the generated data or are generating invalid data due to a bug. We can't help you solve that unfortunately, since you haven't provided any code to go on. Would be great if you could try to pinpoint what code might cause this and update the question with it.
I was getting this error in my request that was something like this:
var optionsSearch = {
host: 'https://mysite.sharepoint.com',
path: '_api/search/query?querytext="sharepoint"',
method: 'GET'
};
All did was removing the https:// leaving only mysite.sharepoint.com and it was fixed.

ErrorType: Argument to path.join must be string

i am working on phonegap application to send sms using third party plugin.but i am facing an exception "ErrorType: Argument to path.join must be string:360:15".
please tell me what the reason of this exception!
here is snapshot of error
Click here
before this exception i was facing missing of plugin.xml file exception. after add of plugin.xml i am facing this error now. let me help to debug this, i will be thank full of you in advance

Resources