Error: write EPIPE node8 - javascript

This is https://github.com/mapbox/ecs-watchbot/pull/205/files#diff-644d8ede25bb88427ccf4229d03bba1bR19 breaking the test with
[worker] waitFor, exit 0
events.js:183
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at _errnoException (util.js:992:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)
Here, when run locally npm run test this fails.

Related

React js Project - node:events: throw er; //Unhandled 'error' event

node:events:491
throw er; // Unhandled 'error' event
^
TypeError: Cannot set property closed of #<Readable> which has only a getter
at FsReadStream.close (/app/node_modules/memfs/lib/volume.js:2047:17)
at FsReadStream._destroy (/app/node_modules/memfs/lib/volume.js:2032:10)
at _destroy (node:internal/streams/destroy:109:10)
at class_1.destroy (node:internal/streams/destroy:71:5)
at class_1.<anonymous> (/app/node_modules/memfs/lib/volume.js:1962:22)
at class_1.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on class_1 instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v18.9.0
I double checked try catch block all over the project where promises used.
Added Error Bounderies to solve this issue but still my server crashed on this error.
I have faced the same issue.
nmp i memfs#latest
Resolved my issue.

got packets out of order. Expected 3 but received 0

server is crashing automatically and showing this error. can you guys please me to get out from this problem>>>>
Warning: got packets out of order. Expected 3 but received 0
node:events:368
throw er; // Unhandled 'error' event
^
Error: The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.
at Connection.protocolError (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:394:17)
at Connection.handlePacket (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:445:14)
at PacketParser.onPacket (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:85:12)
at PacketParser.executeStart (/home/abroadinquiry/server/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket. (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:92:25)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
Emitted 'error' event on Connection instance at:
at Connection.protocolError (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:397:10)
at Connection.handlePacket (/home/abroadinquiry/server/node_modules/mysql2/lib/connection.js:445:14)
[... lines matching original stack trace ...]
at TCP.onStreamRead (node:internal/stream_base_commons:199:23) {
fatal: true,
code: 4031

Unhandled exception in express

im getting the following error issue throw er; // Unhandled 'error' event
Here is my Controler.js
const router = require('express').Router();
router.post('/api/sendMail', async (req,res) => {
console.log("yes")
});
module.exports = router;
Here is my index.js
const cont = require('./controllers/Controler');
app.use(cont);
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::5000
at Server.setupListenHandle [as _listen2] (net.js:1286:14)
at listenInCluster (net.js:1334:12)
at Server.listen (net.js:1421:7)
at Function.listen (/Users/user/folder/node_modules/express/lib/application.js:618:24)
at Object.<anonymous> (/Users/user/folder/server.js:24:5)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
Emitted 'error' event at:
at emitErrorNT (net.js:1313:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
Im not sure what im missing but im gettng unhandled error isssue.
It seems like something already uses 5000 port.
If you use *nix based OS, you can get list of processes like this:
netstat -tulpn | grep 5000
and then, kill particular process:
kill -9 PID
Use try/catch:
try {
app.use(cont);
} catch(er) {
console.log(er);
}
Also note that port 5000 is already in use (EADDRINUSE) - try changing your port to something else.
Try running your app using a different port or kill the process in the current port 5000
To kill a task in windows
//get process running in port 5000
netstat -ano | findstr :5000
//enter your pid and force kill
//replace <pID> with your process id
taskkill /PID <pID> /F

Running test of hyperledger fabric-sdk-node

I'm trying to run test of the hyperledger fabric client node but I have some issues. Indeed, when I run the command gulp test I have lots of errors which look like this:
not ok 586 Error: SERVICE_UNAVAILABLE at ClientDuplexStream.<anonymous> (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_
modules\fabric-client\lib\Orderer.js:9:4530) at emitOne (events.js:96:13) at ClientDuplexStream.emit (events.js:188:7) at ClientDuplexStream.
_emitStatusIfDone (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\src\client.js:204:12) at ClientD
uplexStream._readsDone (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\src\client.js:169:8) at rea
dCallback (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\src\client.js:229:12)
---
operator: fail
at: Client.newDefaultKeyValueStore.then.then.then.then.then.then (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\test\int
egration\e2e\create-channel.js:211:5)
stack: |-
Error: Error: SERVICE_UNAVAILABLE
at ClientDuplexStream.<anonymous> (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\fabric-client\lib\Or
derer.js:9:4530)
at emitOne (events.js:96:13)
at ClientDuplexStream.emit (events.js:188:7)
at ClientDuplexStream._emitStatusIfDone (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\
src\client.js:204:12)
at ClientDuplexStream._readsDone (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\src\cli
ent.js:169:8)
at readCallback (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\grpc\src\node\src\client.js:229:12)
at Test.assert [as _assert] (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\tape\lib\test.js:212:54)
at Test.bound [as _assert] (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\tape\lib\test.js:64:32)
at Test.fail (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\tape\lib\test.js:277:10)
at Test.bound [as fail] (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\node_modules\tape\lib\test.js:64:32)
at Client.newDefaultKeyValueStore.then.then.then.then.then.then (C:\Users\A671975\go\src\github.com\hyperledger\fabric-sdk-node\tes
t\integration\e2e\create-channel.js:211:5)
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
I think this is due to an error of connexion between the tests and the containers but I don't understand what I have to do in order to solve it. So if someone had this error before, please share the solution ;) Thanks !

DeprecationWarning: Calling an asynchronous function without callback is deprecated, where to find it?

So i keep getting this error which redirects me to node_modules and I'm not sure if I would check there.. Everything was fine until node.js version update yesterday.
The error with trace:
node --trace-deprecation tradeBot.js
(node:10062) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
at maybeCallback (fs.js:95:42)
at Object.fs.writeFile (fs.js:1191:14)
at FileStorage.saveFile.FileStorage.writeFile (/****/node_modules/file-manager/index.js:68:5)
at SteamUser._handlers.(anonymous function) (/****/node_modules/steam-user/components/logon.js:252:18)
at SteamUser._handleMessage (/****/node_modules/steam-user/components/messages.js:200:29)
at emitThree (events.js:116:13)
at CMClient.emit (events.js:194:7)
at CMClient._netMsgReceived (/****/node_modules/steam-client/lib/cm_client.js:278:8)
at CMClient.handlers.(anonymous function) (/****/node_modules/steam-client/lib/cm_client.js:386:8)
at CMClient._netMsgReceived (/****/node_modules/steam-client/lib/cm_client.js:260:24)
at emitOne (events.js:96:13)
at TCPConnection.emit (events.js:188:7)
at TCPConnection._readPacket (/****/node_modules/steam-client/lib/tcp_connection.js:73:7)
at emitNone (events.js:86:13)
at TCPConnection.emit (events.js:185:7)
at emitReadable_ (_stream_readable.js:432:10)

Categories