Error: There are some read requests waitng on finished stream - javascript

I have working in selenium test cases. below is my code
browser.load('/sample/demo.html');
browser.sleep(2000);
element(By.id('upload')).sendKeys("D:\\files\\document.docx");
browser.compareScreen(element(By.tagName('body')), 'image1');
By adding the above code, i can get the files properly. But i have facing the below error
Error: There are some read requests waitng on finished stream
Stack:
Error: There are some read requests waitng on finished stream
at module.exports.ChunkStream._end (node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:100:7)
at module.exports.ChunkStream.end (node_modules\pngjs-image\node_modules\pngjs\lib\chunkstream.js:86:10)
at Inflate.onend (_stream_readable.js:595:10)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at Inflate.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Message:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL
I have tried to update the pngjs version to 3.3 above using npm install pngjs --save but still same issue occurs.
Any one can suggest how to resolve this error. I couldn't get the details about this issue properly.

Related

Node.js "TypeError: process.nextTick is not a function"?

Is hosting a discord.js bot. The bot's function is using fs.watchFile and fs.readFile to monitoring changes in a text files and send Discord embed that summarises the data entries within a target.txt file. However, the bot always crash after running for a few hours and throwing process.nextTick error:
C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\websocket.js:1035
process.nextTick(resume, websocket._socket);
TypeError: process.nextTick is not a function
at Receiver.receiverOnConclude (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\websocket.js:1035:11)
at Receiver.emit (node:events:526:28)
at Receiver.controlMessage (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\receiver.js:576:14)
at Receiver.getData (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\receiver.js:423:42)
at Receiver.startLoop (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\receiver.js:148:22)
at Receiver._write (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\receiver.js:83:10)
at writeOrBuffer (node:internal/streams/writable:389:12)
at _write (node:internal/streams/writable:330:10)
at Receiver.Writable.write (node:internal/streams/writable:334:10)
at TLSSocket.socketOnData (C:\Users\Administrator\Desktop\Bot\node_modules\ws\lib\websocket.js:1187:35)
All these code is working except getting the process.nextTick's TypeError every few hours, unsure which part caused the error...or can the error be bypass by monkey patching?
Did not find a way to fix the discord.js script from getting that process.nextTick error but pm2 npm package can at least prevent script from stopping.
https://pm2.keymetrics.io/
How to use pm2 to autorestart my discord bot

error Failed to run jetifier. while going to run react native app on mobile

I'm unable to run my react native app on my physical device. It was working fine todays morning also.
error Failed to run jetifier.
Error: Command failed: C:\Users\Ashish Nath\Desktop\react native\AwesomeProject\node_modules#react-native-community\cli-platform-android\node_modules\jetifier\bin\jetify
at makeError (C:\Users\Ashish Nath\Desktop\react native\AwesomeProject\node_modules#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\Ashish Nath\Desktop\react native\AwesomeProject\node_modules#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.runAndroid [as func] (C:\Users\Ashish Nath\Desktop\react native\AwesomeProject\node_modules#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:104:7)
at async Command.handleAction (C:\Users\Ashish Nath\Desktop\react native\AwesomeProject\node_modules#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.

Trying to load webpage using OpenUrl package in nodejs using setInterval

I am new to NodeJS, I have a microservice running which I want to open a webpage without a browser, to make client side api requests every 20 seconds. I am attempting to use the package openurl
const openPage = require("openurl");
function openUpPage(url){
openPage.open(url);
}
setInterval(function() { openUpPage("myURl") }, 20000);
However I now keep getting the error:
events.js:183
throw er; // Unhandled 'error' event
Error: spawn xdg-open ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (
internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

stdin.write throws Error: write EPIPE

I'm getting this error when openssl child proccess is trying to write() to local directory.
Connection is closed before write() is called. It isn't connected with the ssl, because I can't even launch example code from nodejs documentation.
What am I missing? Some kind of special rights for nodejs?
Please, can anyone give me a real example how to use childProccess.stdin.write()?
events.js:85
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:746:11)
at Socket._writeGeneric (net.js:690:26)
at Socket._write (net.js:709:8)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at Socket.Writable.write (_stream_writable.js:217:11)
at Socket.write (net.js:634:40)
at signManifest (...\node_modules\passbook\lib\pass.js:360:14)
It appeared that i've installed openssl in a wrong way. An error (wrong openssl directory) while execFile(openssl) emitted 'close' event, so write threw EPIPE.
Be careful and add a lot of proper error handlers :)

Finding the source of a CERT_UNTRUSTED error in node on heroku

We run a node app on heroku. The app makes outgoing https connections to many services, but we can't reproduce our problem with any of these services. We are occasionally (6 times in the last 30 minutes) seeing this error appear and having a hard time tracking it down:
Error: CERT_UNTRUSTED
at SecurePair.<anonymous> (tls.js:1381:32)
at SecurePair.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:980:10)
at CleartextStream.read [as _read] (tls.js:472:13)
at CleartextStream.Readable.read (_stream_readable.js:341:10)
at EncryptedStream.write [as _write] (tls.js:369:25)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at EncryptedStream.Writable.write (_stream_writable.js:183:11)
at write (_stream_readable.js:602:24)
at flow (_stream_readable.js:611:7)
at Socket.pipeOnReadable (_stream_readable.js:643:5)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at Socket.Readable.push (_stream_readable.js:128:10)
at TCP.onread (net.js:529:21)
at TCP.onread (/app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31)
The only hint about files is the newrelic module at the bottom, which I assume would be in any stacktrace. Does anyone have advice for figuring out where this error is coming from?
If you are using node 0.10.34, this could be the issue
https://github.com/joyent/node/issues/8894
Recommend using v0.10.33 for now.

Categories