Skip to content

ERR_INTERNAL_ASSERTION #50895

@slendertaker

Description

@slendertaker

Version

v20.9.0

Platform

Windows

Subsystem

No response

What steps will reproduce the bug?

const Imap = require('imap');

async function checkEmail(index, logColor, email, emailPass) {
let emailStatus;
let emailStatusCount;

console.log(logColor(`[${index}]`, 'Checking email'));

do {
    try {
        let imapConfig = {
            user: email,
            password: emailPass,
            host: 'imap.outlook.com',
            port: 993,
            tls: true,
        };

        const imap = new Imap(imapConfig);

        function openInbox(cb) {
            imap.openBox('INBOX', true, cb);
        }

        imap.connect();

        await new Promise((resolve, reject) => {
            imap.once('ready', () => {
                openInbox((err) => {
                    if (err) {
                        emailStatus = 'Blocked';
                        // console.error(logColor(`[${index}]`, 'Failed login IMAP!'));
                        imap.end();
                        resolve();
                    } else {
                        emailStatus = 'Successful';
                        console.log(logColor(`[${index}]`, 'Success login IMAP!'));
                        imap.end();
                        resolve();
                    }
                });
            });

            imap.once('error', (err) => {
                emailStatus = 'Error';
                // console.error(logColor(`[${index}]`, 'Login email failed, retrying'));
                imap.end();
                reject(err);
            });
        });
    } catch (error) {
        // console.error(logColor(`[${index}]`, 'Error processing account for:', error));
        emailStatus = 'Error';
    }

    emailStatusCount++;
} while(emailStatus !== 'Successful' && emailStatusCount <= 10)

return emailStatus;

}

module.exports = { checkEmail };

How often does it reproduce? Is there a required condition?

around 5/100

What is the expected behavior? Why is that the expected behavior?

Login to imap

What do you see instead?

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:406:5)
at assert (node:internal/assert:14:11)
at internalConnectMultiple (node:net:1118:3)
at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7) {

code: 'ERR_INTERNAL_ASSERTION'
} uncaughtException

Additional information

Error [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues

at new NodeError (node:internal/errors:406:5)
at assert (node:internal/assert:14:11)
at internalConnectMultiple (node:net:1118:3)
at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
at listOnTimeout (node:internal/timers:575:11)
at process.processTimers (node:internal/timers:514:7) {

code: 'ERR_INTERNAL_ASSERTION'
} uncaughtException

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions