Warn I get error. Help urgently [ It happened in an instant ]

This error came when there was nothing at a time. and continuously at the same degree .this is not the norm.

%2C%2C4

No more command in my bot, but this error appeared.

Could you help. My Project Name: Corwin.

can you please make your project public? i cannot take a look unless you do, thank you!

Hey there,

Here’s a few tips to reduce memory usage:

  • Stop all the processes relating to Node.js by executing this command inside the Console of the app: killall node
  • Remove unnecessary or unwanted modules from the package.json and restart the app.
  • Use return statements to return a value and entirely end a function.

Helpful links

Happy Glitching!

to extend chroventer’s suggestion, try the following command:
npm exit; exit 0
apt may have something to do with this…
image
definitely will curse you if you run killall node, but thankfully npm exit; exit 0 does not output that

Hey @Jonyk56 , @chroventer and @cori still the same problem.


        _sockname: null,

        _pendingData: null,

        _pendingEncoding: '',

        server: undefined,

        _server: null,

        ssl: null,

        _requestCert: true,

        _rejectUnauthorized: true,

        parser: null,

        _httpMessage: [Circular],

        write: [Function: writeAfterFIN],

        [Symbol(res)]: [TLSWrap],

        [Symbol(asyncId)]: 548528,

        [Symbol(lastWriteQueueSize)]: 441,

        [Symbol(timeout)]: null,

        [Symbol(kBytesRead)]: 0,

        [Symbol(kBytesWritten)]: 441,

        [Symbol(connect-options)]: [Object] },

     connection:

      TLSSocket {

        _tlsOptions: [Object],

        _secureEstablished: true,

        _securePending: false,

        _newSessionPending: false,

        _controlReleased: true,

        _SNICallback: null,

        servername: 'discordapp.com',

        alpnProtocol: false,

        authorized: true,

        authorizationError: null,

        encrypted: true,

        _events: [Object],

        _eventsCount: 8,

        connecting: false,

        _hadError: true,

        _handle: null,

        _parent: null,

        _host: 'discordapp.com',

        _readableState: [ReadableState],

        readable: false,

        _maxListeners: undefined,

        _writableState: [WritableState],

        writable: false,

        allowHalfOpen: false,

        _sockname: null,

        _pendingData: null,

        _pendingEncoding: '',

        server: undefined,

        _server: null,

        ssl: null,

        _requestCert: true,

        _rejectUnauthorized: true,

        parser: null,

        _httpMessage: [Circular],

        write: [Function: writeAfterFIN],

        [Symbol(res)]: [TLSWrap],

        [Symbol(asyncId)]: 548528,

        [Symbol(lastWriteQueueSize)]: 441,

        [Symbol(timeout)]: null,

        [Symbol(kBytesRead)]: 0,

        [Symbol(kBytesWritten)]: 441,

        [Symbol(connect-options)]: [Object] },

     _header:

      'PATCH /api/v7/channels/595201959066337291 HTTP/1.1\r\nHost: discordapp.com\r\nAuthorization: Bot NTA3ODc1MDAyNTM2OTUxODA4.XSd7BA.mOVl6m_EFMLjWfAW1ckn6Z0dNE4\r\nUser-Agent: DiscordBot (https://github.com/discordjs/discord.js, 11.5.1) Node.js/v10.15.3\r\nContent-Type: application/json\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nContent-Length: 86\r\n\r\n',

     _onPendingData: [Function: noopPendingOutput],

     agent:

      Agent {

        _events: [Object],

        _eventsCount: 1,

        _maxListeners: undefined,

        defaultPort: 443,

        protocol: 'https:',

        options: [Object],

        requests: {},

        sockets: [Object],

        freeSockets: {},

        keepAliveMsecs: 1000,

        keepAlive: true,

        maxSockets: Infinity,

        maxFreeSockets: 256,

        maxCachedSessions: 100,

        _sessionCache: [Object] },

     socketPath: undefined,

     timeout: undefined,

     method: 'PATCH',

     path: '/api/v7/channels/595201959066337291',

     _ended: false,

     res: null,

     aborted: undefined,

     timeoutCb: null,

     upgradeOrConnect: false,

     parser: null,

     maxHeadersCount: null,

     [Symbol(isCorked)]: false,

     [Symbol(outHeadersKey)]:

      [Object: null prototype] {

        host: [Array],

        authorization: [Array],

        'user-agent': [Array],

        'content-type': [Array],

        'accept-encoding': [Array] } } }

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead``



How do I solve?

i have to say one word, and that is HELL NO, if i can remember properly, there is another way, but it requires having staff reset the project to its exact original, not the first version, but the true first

No warning in the bot, but does not respond to messages. responds when you enter the project. uptime bot on the robot.

ok, thank you for that, ima go and figure out the source languages of nodejs, and give you a reset, as nodejs/npm i directly linked to each other

ok… run this(WITH NO UPTIME ROBOT):
npm run start; apt install sigal; refresh; exit -0


    at Server.setupListenHandle [as _listen2] (net.js:1270:14)

    at listenInCluster (net.js:1318:12)

    at Server.listen (net.js:1405:7)

    at Function.listen (/rbd/pnpm-volume/baed62d8-1664-4484-8ec2-c50664ccc242/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/application.js:618:24)

    at module.exports (./util/dashboard.js:413:21)

    at module.exports (./events/ready.js:14:36)

    at process._tickCallback (internal/process/next_tick.js:68:7)```

bot restarts constantly.

@hamzaeser
If you would like to invite me to your project I can take a closer look at this and hopefully solve any problems you are having right now.

hey @cori

This error came when there was nothing at a time. and continuously at the same degree .this is not the norm.

%2C%2C4

No more command in my bot, but this error appeared.

Could you help. My Project Name: Corwin.

@hamzaeser when I look at that project I’m not seeing any CPU or Memory constraints, which tells me that this is an intermittent issue most likely related to some command or process that your bot is performing. I’d suggest adding some console.log() statements to your bot’s commands and events to see which one(s) are causing problems. Another option is to disable commands or events one at a time to see which ones cause the issue.

Once you’ve found which commands or events are problematic you can look more closely at the code for that event or command to see why it’s leaking memory or CPU.

These kinds of problems are difficult to troubleshoot and can be very frustrating, but with some patience you should be able to sort it out. If you find the related command/event but aren’t sure what’s making it slow post that information back here and perhaps someone will be able to offer some suggestions.

Good luck!

Hey @cori , @Callum-OKane and @Jonyk56

    _sockname: null,

    _pendingData: null,

    _pendingEncoding: '',

    server: undefined,

    _server: null,

    ssl: null,

    _requestCert: true,

    _rejectUnauthorized: true,

    parser: null,

    _httpMessage: [Circular],

    write: [Function: writeAfterFIN],

    [Symbol(res)]: [TLSWrap],

    [Symbol(asyncId)]: 548528,

    [Symbol(lastWriteQueueSize)]: 441,

    [Symbol(timeout)]: null,

    [Symbol(kBytesRead)]: 0,

    [Symbol(kBytesWritten)]: 441,

    [Symbol(connect-options)]: [Object] },

 connection:

  TLSSocket {

    _tlsOptions: [Object],

    _secureEstablished: true,

    _securePending: false,

    _newSessionPending: false,

    _controlReleased: true,

    _SNICallback: null,

    servername: 'discordapp.com',

    alpnProtocol: false,

    authorized: true,

    authorizationError: null,

    encrypted: true,

    _events: [Object],

    _eventsCount: 8,

    connecting: false,

    _hadError: true,

    _handle: null,

    _parent: null,

    _host: 'discordapp.com',

    _readableState: [ReadableState],

    readable: false,

    _maxListeners: undefined,

    _writableState: [WritableState],

    writable: false,

    allowHalfOpen: false,

    _sockname: null,

    _pendingData: null,

    _pendingEncoding: '',

    server: undefined,

    _server: null,

    ssl: null,

    _requestCert: true,

    _rejectUnauthorized: true,

    parser: null,

    _httpMessage: [Circular],

    write: [Function: writeAfterFIN],

    [Symbol(res)]: [TLSWrap],

    [Symbol(asyncId)]: 548528,

    [Symbol(lastWriteQueueSize)]: 441,

    [Symbol(timeout)]: null,

    [Symbol(kBytesRead)]: 0,

    [Symbol(kBytesWritten)]: 441,

    [Symbol(connect-options)]: [Object] },

 _header:

  'PATCH /api/v7/channels/595201959066337291 HTTP/1.1\r\nHost: discordapp.com\r\nAuthorization: Bot NTA3ODc1MDAyNTM2OTUxODA4.XSd7BA.mOVl6m_EFMLjWfAW1ckn6Z0dNE4\r\nUser-Agent: DiscordBot (https://github.com/discordjs/discord.js, 11.5.1) Node.js/v10.15.3\r\nContent-Type: application/json\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nContent-Length: 86\r\n\r\n',

 _onPendingData: [Function: noopPendingOutput],

 agent:

  Agent {

    _events: [Object],

    _eventsCount: 1,

    _maxListeners: undefined,

    defaultPort: 443,

    protocol: 'https:',

    options: [Object],

    requests: {},

    sockets: [Object],

    freeSockets: {},

    keepAliveMsecs: 1000,

    keepAlive: true,

    maxSockets: Infinity,

    maxFreeSockets: 256,

    maxCachedSessions: 100,

    _sessionCache: [Object] },

 socketPath: undefined,

 timeout: undefined,

 method: 'PATCH',

 path: '/api/v7/channels/595201959066337291',

 _ended: false,

 res: null,

 aborted: undefined,

 timeoutCb: null,

 upgradeOrConnect: false,

 parser: null,

 maxHeadersCount: null,

 [Symbol(isCorked)]: false,

 [Symbol(outHeadersKey)]:

  [Object: null prototype] {

    host: [Array],

    authorization: [Array],

    'user-agent': [Array],

    'content-type': [Array],

    'accept-encoding': [Array] } } }

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead

(node:615) DeprecationWarning: Collection#find: pass a function instead``

constantly writes this and is constantly multiplying cpu for typing.

How do I solve?

@hamzaeser can you capture the complete messages from one error cycle - what you’re posting appear to be only part of the message, so it’s not enough for anyone to offer any feedback on, and I’ve never seen those errors when looking at your project.

From what I can see, the first part looks like Node’s representation of a JavaScript object - possibly the Express Request or Response object, which means that you may be logging one of those objects somewhere. Look for code like console.log(req) or console.log(request) (or res, resp, or response) and comment that line out and that portion of those messages should go away.

In my experience the DeprecationWarnings are baked into the discord.js code, so someone working on that package needs to fix those at some point - there’s no sustainable way for you to fix that. Luckily those are just warnings and you can ignore them for now.

I doubt that any of that has to do with the CPU, although I could be wrong. My previous advice still stands with respect to that issue - you need to figure out what code is causing that, and the process of elimination is your best bet for that.