Mongoose with node js (using express js) crashes when getting a get route

I’m getting a very weird error in my server running with mongoose and express in node js, the error occurs on a specific route that don’t even interact with the mongodb database, So this is the route that causes the crash:
router.get(“/test”, (req, res) => {
res.json({ message: “test” });
});

Note that every other routes works just fine, even the one that interacts with the database, and here is the error log:


          
            heartbeatFrequencyMS: 10000,
            loadBalanced: false,
            localThresholdMS: 15,
            maxConnecting: 2,
            maxIdleTimeMS: 0,
            maxPoolSize: 100,
            minPoolSize: 0,
            minHeartbeatFrequencyMS: 500,
            monitorCommands: false,
            noDelay: true,
            pkFactory: [Object],
            raw: false,
            readPreference: [ReadPreference],
            retryReads: true,
            retryWrites: true,
            serverSelectionTimeoutMS: 30000,
            socketTimeoutMS: 0,
            srvMaxHosts: 0,
            srvServiceName: 'mongodb',
            waitQueueTimeoutMS: 0,
            zlibCompressionLevel: 0,
            userSpecifiedAuthSource: false,
            userSpecifiedReplicaSet: false,
            srvHost: 'cluster0.e6hybnh.mongodb.net',
            tls: true,
            mongoLoggerOptions: [Object],
            metadata: [Object],
            replicaSet: 'atlas-x9khi6-shard-0',
            [Symbol(@@mdb.enableMongoLogger)]: false
          }
        }
      },
      Promise: [Function: Promise],
      modelName: 'ruangan',
      _closed: false,
      opts: {
        autoIndex: true,
        autoCreate: true,
        schemaUserProvidedOptions: {},
        capped: false,
        Promise: undefined,
        '$wasForceClosed': undefined
      },
      name: 'ruangan',
      collectionName: 'ruangan',
      conn: <ref *3> NativeConnection {
        base: <ref *1> Mongoose {
          connections: [ [Circular *3] ],
          nextConnectionId: 1,
          models: <ref *4> {
            ruangan: [Circular *2],
            kelas: [Function],
            user: [Function]
          },
          events: EventEmitter {
            _events: [Object: null prototype] {},
            _eventsCount: 0,
            _maxListeners: undefined,
            [Symbol(kCapture)]: false
          },
          __driver: {
            Collection: [Function: NativeCollection],
            Connection: [Function]
          },
          options: {
            pluralization: true,
            autoIndex: true,
            autoCreate: true,
            [Symbol(mongoose:default)]: true
          },
          _pluralize: [Function: pluralize],
          Schema: [Function: Schema] {
            reserved: [Object: null prototype],
            Types: [Object],
            ObjectId: [Function]
          },
          model: [Function (anonymous)],
          plugins: [ [Array], [Array], [Array], [Array] ],
          default: [Circular *1],
          mongoose: [Circular *1],
          cast: [Function: cast],
          STATES: [Object: null prototype] {
            '0': 'disconnected',
            '1': 'connected',
            '2': 'connecting',
            '3': 'disconnecting',
            '99': 'uninitialized',
            disconnected: 0,
            connected: 1,
            connecting: 2,
            disconnecting: 3,
            uninitialized: 99
          },
          setDriver: [Function: setDriver],
          set: [Function (anonymous)],
          get: [Function (anonymous)],
          createConnection: [Function (anonymous)],
          connect: [AsyncFunction: connect],
          disconnect: [AsyncFunction: disconnect],
          startSession: [Function (anonymous)],
          pluralize: [Function (anonymous)],
          deleteModel: [Function (anonymous)],
          modelNames: [Function (anonymous)],
          plugin: [Function (anonymous)],
          version: '8.0.3',
          Mongoose: [Function: Mongoose],
          SchemaType: [Function: SchemaType] {
            cast: [Function: cast],
            set: [Function: set],
            get: [Function (anonymous)],
            _isRef: [Function (anonymous)],
            checkRequired: [Function (anonymous)],
            CastError: [class CastError extends MongooseError],
            ValidatorError: [class ValidatorError extends MongooseError]
          },
          SchemaTypes: {
            Array: [Function],
            BigInt: [Function],
            Boolean: [Function],
            Buffer: [Function],
            Date: [Function],
            Decimal: [Function],
            Decimal128: [Function],
            DocumentArray: [Function],
            Map: [Function],
            Mixed: [Function],
            Number: [Function],
            ObjectId: [Function],
            String: [Function],
            Subdocument: [Function],
            UUID: [Function],
            Oid: [Function],
            Object: [Function],
            Bool: [Function],
            ObjectID: [Function]
          },
          VirtualType: [Function: VirtualType],
          Types: {
            Array: [Function: MongooseArray],
            Buffer: [Function],
            Embedded: [Function],
            Document: [Function],
            DocumentArray: [Function: MongooseDocumentArray],
            Decimal128: [class Decimal128 extends BSONValue],
            ObjectId: [Function],
            Map: [class MongooseMap extends Map],
            Subdocument: [Function: Subdocument],
            UUID: [class UUID extends Binary]
          },
          Query: [Function: Query] { base: [Object], 'use$geoWithin': true },
          Model: [Function: Model] {
            exists: [Function: exists],
            discriminator: [Function (anonymous)],
            _events: undefined,
            _eventsCount: 0,
            _maxListeners: undefined,
            setMaxListeners: [Function: setMaxListeners],
            getMaxListeners: [Function: getMaxListeners],
            emit: [Function: emit],
            addListener: [Function: addListener],
            on: [Function: addListener],
            prependListener: [Function: prependListener],
            once: [Function: once],
            prependOnceListener: [Function: prependOnceListener],
            removeListener: [Function: removeListener],
            off: [Function: removeListener],
            removeAllListeners: [Function: removeAllListeners],
            listeners: [Function: listeners],
            rawListeners: [Function: rawListeners],
            listenerCount: [Function: listenerCount],
            eventNames: [Function: eventNames],
            init: [Function: init],
            createCollection: [AsyncFunction: createCollection],
            syncIndexes: [AsyncFunction: syncIndexes],
            diffIndexes: [AsyncFunction: diffIndexes],
            cleanIndexes: [AsyncFunction: cleanIndexes],
            listIndexes: [AsyncFunction: listIndexes],
            ensureIndexes: [AsyncFunction: ensureIndexes],
            createIndexes: [AsyncFunction: createIndexes],
            translateAliases: [Function: translateAliases],
            deleteOne: [Function: deleteOne],
            deleteMany: [Function: deleteMany],
            find: [Function: find],
            findById: [Function: findById],
            findOne: [Function: findOne],
            estimatedDocumentCount: [Function: estimatedDocumentCount],
            countDocuments: [Function: countDocuments],
            distinct: [Function: distinct],
            where: [Function: where],
            '$where': [Function: $where],
            findOneAndUpdate: [Function (anonymous)],
            findByIdAndUpdate: [Function (anonymous)],
            findOneAndDelete: [Function (anonymous)],
            findByIdAndDelete: [Function (anonymous)],
            findOneAndReplace: [Function (anonymous)],
            create: [AsyncFunction: create],
            watch: [Function (anonymous)],
            startSession: [Function (anonymous)],
            insertMany: [AsyncFunction: insertMany],
            '$__insertMany': [Function (anonymous)],
            bulkWrite: [AsyncFunction: bulkWrite],
            bulkSave: [AsyncFunction: bulkSave],
            applyDefaults: [Function: applyDefaults],
            castObject: [Function: castObject],
            buildBulkWriteOperations: [Function: buildBulkWriteOperations],
            hydrate: [Function (anonymous)],
            updateMany: [Function: updateMany],
            updateOne: [Function: updateOne],
            replaceOne: [Function: replaceOne],
            aggregate: [Function: aggregate],
            validate: [AsyncFunction: validate],
            populate: [AsyncFunction: populate],
            compile: [Function: compile],
            __subclass: [Function: subclass],
            inspect: [Function (anonymous)],
            [Symbol(nodejs.util.inspect.custom)]: [Function (anonymous)]
          },
          Document: [Function: Document] {
            _events: undefined,
            _eventsCount: 0,
            _maxListeners: undefined,
            setMaxListeners: [Function: setMaxListeners],
            getMaxListeners: [Function: getMaxListeners],
            emit: [Function: emit],
            addListener: [Function: addListener],
            on: [Function: addListener],
            prependListener: [Function: prependListener],
            once: [Function: once],
            prependOnceListener: [Function: prependOnceListener],
            removeListener: [Function: removeListener],
            off: [Function: removeListener],
            removeAllListeners: [Function: removeAllListeners],
            listeners: [Function: listeners],
            rawListeners: [Function: rawListeners],
            listenerCount: [Function: listenerCount],
            eventNames: [Function: eventNames],
            ValidationError: [class ValidationError extends MongooseError]
          },
          ObjectId: [Function: SchemaObjectId] {
            schemaName: 'ObjectId',
            defaultOptions: {},
            get: [Function (anonymous)],
            set: [Function: set],
            setters: [],
            _checkRequired: [Function (anonymous)],
            _cast: [Function: castObjectId],
            cast: [Function: cast],
            _defaultCaster: [Function (anonymous)],
            checkRequired: [Function (anonymous)]
          },
          isValidObjectId: [Function (anonymous)],
          isObjectIdOrHexString: [Function (anonymous)],
          syncIndexes: [Function (anonymous)],
          Decimal128: [Function: SchemaDecimal128] {
            schemaName: 'Decimal128',
            defaultOptions: {},
            _cast: [Function: castDecimal128],
            set: [Function: set],
            setters: [],
            get: [Function (anonymous)],
            cast: [Function: cast],
            _defaultCaster: [Function (anonymous)],
            _checkRequired: [Function (anonymous)],
            checkRequired: [Function (anonymous)]
          },
          Mixed: [Function: SchemaMixed] {
            schemaName: 'Mixed',
            defaultOptions: {},
            get: [Function (anonymous)],
            set: [Function: set],
            setters: []
          },
          Date: [Function: SchemaDate] {
            schemaName: 'Date',
            defaultOptions: {},
            _cast: [Function: castDate],
            set: [Function: set],
            setters: [],
            get: [Function (anonymous)],
            cast: [Function: cast],
            _defaultCaster: [Function (anonymous)],
            _checkRequired: [Function (anonymous)],
            checkRequired: [Function (anonymous)]
          },
          Number: [Function: SchemaNumber] {
            get: [Function (anonymous)],
            set: [Function: set],
            setters: [],
            _cast: [Function: castNumber],
            cast: [Function: cast],
            _defaultCaster: [Function (anonymous)],
            schemaName: 'Number',
            defaultOptions: {},
            _checkRequired: [Function (anonymous)],
            checkRequired: [Function (anonymous)]
          },
          Error: [class MongooseError extends Error] {
            messages: [Object],
            Messages: [Object],
            DocumentNotFoundError: [class DocumentNotFoundError extends MongooseError],
            CastError: [class CastError extends MongooseError],
            ValidationError: [class ValidationError extends MongooseError],
            ValidatorError: [class ValidatorError extends MongooseError],
            VersionError: [class VersionError extends MongooseError],
            ParallelSaveError: [class ParallelSaveError extends MongooseError],
            OverwriteModelError: [class OverwriteModelError extends MongooseError],
            MissingSchemaError: [class MissingSchemaError extends MongooseError],
            MongooseServerSelectionError: [class MongooseServerSelectionError extends MongooseError],
            DivergentArrayError: [class DivergentArrayError extends MongooseError],
            StrictModeError: [class StrictModeError extends MongooseError],
            StrictPopulateError: [class StrictPopulateError extends MongooseError]
          },
          MongooseError: [class MongooseError extends Error] {
            messages: [Object],
            Messages: [Object],
            DocumentNotFoundError: [class DocumentNotFoundError extends MongooseError],
            CastError: [class CastError extends MongooseError],
            ValidationError: [class ValidationError extends MongooseError],
            ValidatorError: [class ValidatorError extends MongooseError],
            VersionError: [class VersionError extends MongooseError],
            ParallelSaveError: [class ParallelSaveError extends MongooseError],
            OverwriteModelError: [class OverwriteModelError extends MongooseError],
            MissingSchemaError: [class MissingSchemaError extends MongooseError],
            MongooseServerSelectionError: [class MongooseServerSelectionError extends MongooseError],
            DivergentArrayError: [class DivergentArrayError extends MongooseError],
            StrictModeError: [class StrictModeError extends MongooseError],
            StrictPopulateError: [class StrictPopulateError extends MongooseError]
          },
          now: [Function: now],
          CastError: [class CastError extends MongooseError],
          SchemaTypeOptions: [class SchemaTypeOptions],
          mongo: {
            BSON: [Getter],
            Binary: [Getter],
            BSONRegExp: [Getter],
            BSONSymbol: [Getter],
            BSONType: [Getter],
            Code: [Getter],
            DBRef: [Getter],
            Decimal128: [Getter],
            Double: [Getter],
            Int32: [Getter],
            Long: [Getter],
            MaxKey: [Getter],
            MinKey: [Getter],
            ObjectId: [Getter],
            Timestamp: [Getter],
            UUID: [Getter],
            MongoBulkWriteError: [Getter],
            ClientEncryption: [Getter],
            ChangeStreamCursor: [Getter],
            MongoAPIError: [Getter],
            MongoAWSError: [Getter],
            MongoAzureError: [Getter],
            MongoBatchReExecutionError: [Getter],
            MongoChangeStreamError: [Getter],
            MongoCompatibilityError: [Getter],
            MongoCursorExhaustedError: [Getter],
            MongoCursorInUseError: [Getter],
            MongoDecompressionError: [Getter],
            MongoDriverError: [Getter],
            MongoError: [Getter],
            MongoExpiredSessionError: [Getter],
            MongoGridFSChunkError: [Getter],
            MongoGridFSStreamError: [Getter],
            MongoInvalidArgumentError: [Getter],
            MongoKerberosError: [Getter],
            MongoMissingCredentialsError: [Getter],
            MongoMissingDependencyError: [Getter],
            MongoNetworkError: [Getter],
            MongoNetworkTimeoutError: [Getter],
            MongoNotConnectedError: [Getter],
            MongoParseError: [Getter],
            MongoRuntimeError: [Getter],
            MongoServerClosedError: [Getter],
            MongoServerError: [Getter],
            MongoServerSelectionError: [Getter],
            MongoSystemError: [Getter],
            MongoTailableCursorError: [Getter],
            MongoTopologyClosedError: [Getter],
            MongoTransactionError: [Getter],
            MongoUnexpectedServerResponseError: [Getter],
            MongoWriteConcernError: [Getter],
            AbstractCursor: [Getter],
            Admin: [Getter],
            AggregationCursor: [Getter],
            CancellationToken: [Getter],
            ChangeStream: [Getter],
            ClientSession: [Getter],
            Collection: [Getter],
            Db: [Getter],
            FindCursor: [Getter],
            GridFSBucket: [Getter],
            GridFSBucketReadStream: [Getter],
            GridFSBucketWriteStream: [Getter],
            ListCollectionsCursor: [Getter],
            ListIndexesCursor: [Getter],
            MongoClient: [Getter],
            OrderedBulkOperation: [Getter],
            UnorderedBulkOperation: [Getter],
            BatchType: [Getter],
            AutoEncryptionLoggerLevel: [Getter],
            GSSAPICanonicalizationValue: [Getter],
            AuthMechanism: [Getter],
            Compressor: [Getter],
            CURSOR_FLAGS: [Getter],
            MongoErrorLabel: [Getter],
            ExplainVerbosity: [Getter],
            ServerApiVersion: [Getter],
            ReturnDocument: [Getter],
            ProfilingLevel: [Getter],
            ReadConcernLevel: [Getter],
            ReadPreferenceMode: [Getter],
            ServerType: [Getter],
            TopologyType: [Getter],
            ReadConcern: [Getter],
            ReadPreference: [Getter],
            WriteConcern: [Getter],
            CommandFailedEvent: [Getter],
            CommandStartedEvent: [Getter],
            CommandSucceededEvent: [Getter],
            ConnectionCheckedInEvent: [Getter],
            ConnectionCheckedOutEvent: [Getter],
            ConnectionCheckOutFailedEvent: [Getter],
            ConnectionCheckOutStartedEvent: [Getter],
            ConnectionClosedEvent: [Getter],
            ConnectionCreatedEvent: [Getter],
            ConnectionPoolClearedEvent: [Getter],
            ConnectionPoolClosedEvent: [Getter],
            ConnectionPoolCreatedEvent: [Getter],
            ConnectionPoolMonitoringEvent: [Getter],
            ConnectionPoolReadyEvent: [Getter],
            ConnectionReadyEvent: [Getter],
            ServerClosedEvent: [Getter],
            ServerDescriptionChangedEvent: [Getter],
            ServerHeartbeatFailedEvent: [Getter],
            ServerHeartbeatStartedEvent: [Getter],
            ServerHeartbeatSucceededEvent: [Getter],
            ServerOpeningEvent: [Getter],
            TopologyClosedEvent: [Getter],
            TopologyDescriptionChangedEvent: [Getter],
            TopologyOpeningEvent: [Getter],
            SrvPollingEvent: [Getter],
            MongoCryptAzureKMSRequestError: [Getter],
            MongoCryptCreateDataKeyError: [Getter],
            MongoCryptCreateEncryptedCollectionError: [Getter],
            MongoCryptError: [Getter],
            MongoCryptInvalidArgumentError: [Getter],
            MongoCryptKMSRequestNetworkTimeoutError: [Getter]
          },
          mquery: [Function: Query] {
            permissions: [Object],
            _isPermitted: [Function (anonymous)],
            canMerge: [Function (anonymous)],
            setGlobalTraceFunction: [Function (anonymous)],
            utils: [Object],
            env: [Object],
            Collection: [class NodeCollection extends Collection],
            BaseCollection: [Function]
          },
          sanitizeFilter: [Function: sanitizeFilter],
          trusted: [Function: trusted],
          skipMiddlewareFunction: [Function: skipWrappedFunction],
          overwriteMiddlewareResult: [Function: overwriteResult]
        },
        collections: {
          ruangan: [Circular *6],
          kelas: Collection {
            collection: [Collection],
            Promise: [Function: Promise],
            modelName: 'kelas',
            _closed: false,
            opts: [Object],
            name: 'kelas',
            collectionName: 'kelas',
            conn: [Circular *3],
            queue: [],
            buffer: false,
            emitter: [EventEmitter]
          },
          user: Collection {
            collection: [Collection],
            Promise: [Function: Promise],
            modelName: 'user',
            _closed: false,
            opts: [Object],
            name: 'user',
            collectionName: 'user',
            conn: [Circular *3],
            queue: [],
            buffer: false,
            emitter: [EventEmitter]
          }
        },
        models: <ref *4> {
          ruangan: [Circular *2],
          kelas: [Function: model] {
            hooks: [Kareem],
            base: [Mongoose],
            modelName: 'kelas',
            model: [Function: model],
            db: [Circular *3],
            discriminators: undefined,
            events: [EventEmitter],
            '$appliedMethods': true,
            '$appliedHooks': true,
            _middleware: [Kareem],
            '$__insertMany': [Function (anonymous)],
            schema: [Schema],
            collection: [Collection],
            '$__collection': [Collection],
            Query: [Function],
            '$init': [Promise],
            '$caught': true,
            [Symbol(mongoose#Model)]: true
          },
          user: [Function: model] {
            hooks: [Kareem],
            base: [Mongoose],
            modelName: 'user',
            model: [Function: model],
            db: [Circular *3],
            discriminators: undefined,
            events: [EventEmitter],
            '$appliedMethods': true,
            '$appliedHooks': true,
            _middleware: [Kareem],
            '$__insertMany': [Function (anonymous)],
            schema: [Schema],
            collection: [Collection],
            '$__collection': [Collection],
            Query: [Function],
            '$init': [Promise],
            '$caught': true,
            [Symbol(mongoose#Model)]: true
          }
        },
        config: {},
        replica: false,
        options: null,
        otherDbs: [],
        relatedDbs: {},
        states: [Object: null prototype] {
          '0': 'disconnected',
          '1': 'connected',
          '2': 'connecting',
          '3': 'disconnecting',
          '99': 'uninitialized',
          disconnected: 0,
          connected: 1,
          connecting: 2,
          disconnecting: 3,
          uninitialized: 99
        },
        _readyState: 1,
        _closeCalled: undefined,
        _hasOpened: true,
        plugins: [],
        id: 0,
        _queue: [],
        _listening: false,
        _connectionOptions: { driverInfo: { name: 'Mongoose', version: '8.0.3' } },
        _connectionString: 'mongodb+srv://arazi916:KB2RFpIpQBTy5ucJ@cluster0.e6hybnh.mongodb.net/protoskrip',
        client: <ref *5> MongoClient {
          _events: [Object: null prototype] {
            topologyDescriptionChanged: [Function (anonymous)]
          },
          _eventsCount: 1,
          _maxListeners: 0,
          mongoLogger: MongoLogger {
            error: [Function: bound log],
            warn: [Function: bound log],
            info: [Function: bound log],
            debug: [Function: bound log],
            trace: [Function: bound log],
            componentSeverities: [Object],
            maxDocumentLength: 1000,
            logDestination: [Object]
          },
          s: {
            url: 'mongodb+srv://arazi916:KB2RFpIpQBTy5ucJ@cluster0.e6hybnh.mongodb.net/protoskrip',
            bsonOptions: [Object],
            namespace: [MongoDBNamespace],
            hasBeenClosed: false,
            sessionPool: [ServerSessionPool],
            activeSessions: Set(0) {},
            options: [Getter],
            readConcern: [Getter],
            writeConcern: [Getter],
            readPreference: [Getter],
            isMongoClient: [Getter]
          },
          connectionLock: undefined,
          topology: Topology {
            _events: [Object: null prototype],
            _eventsCount: 26,
            _maxListeners: undefined,
            client: [Circular *5],
            selectServerAsync: [Function (anonymous)],
            s: [Object],
            [Symbol(kCapture)]: false,
            [Symbol(waitQueue)]: [List]
          },
          [Symbol(kCapture)]: false,
          [Symbol(options)]: [Object: null prototype] {
            hosts: [Array],
            credentials: [MongoCredentials],
            compressors: [Array],
            connectTimeoutMS: 30000,
            dbName: 'protoskrip',
            directConnection: false,
            driverInfo: [Object],
            enableUtf8Validation: true,
            forceServerObjectId: false,
            heartbeatFrequencyMS: 10000,
            loadBalanced: false,
            localThresholdMS: 15,
            maxConnecting: 2,
            maxIdleTimeMS: 0,
            maxPoolSize: 100,
            minPoolSize: 0,
            minHeartbeatFrequencyMS: 500,
            monitorCommands: false,
            noDelay: true,
            pkFactory: [Object],
            raw: false,
            readPreference: [ReadPreference],
            retryReads: true,
            retryWrites: true,
            serverSelectionTimeoutMS: 30000,
            socketTimeoutMS: 0,
            srvMaxHosts: 0,
            srvServiceName: 'mongodb',
            waitQueueTimeoutMS: 0,
            zlibCompressionLevel: 0,
            userSpecifiedAuthSource: false,
            userSpecifiedReplicaSet: false,
            srvHost: 'cluster0.e6hybnh.mongodb.net',
            tls: true,
            mongoLoggerOptions: [Object],
            metadata: [Object],
            replicaSet: 'atlas-x9khi6-shard-0',
            [Symbol(@@mdb.enableMongoLogger)]: false
          }
        },
        '$initialConnection': Promise { [Circular *3] },
        db: Db {
          s: {
            options: [Object],
            readPreference: [ReadPreference],
            bsonOptions: [Object],
            pkFactory: [Object],
            readConcern: undefined,
            writeConcern: undefined,
            namespace: [MongoDBNamespace]
          },
          client: <ref *5> MongoClient {
            _events: [Object: null prototype],
            _eventsCount: 1,
            _maxListeners: 0,
            mongoLogger: [MongoLogger],
            s: [Object],
            connectionLock: undefined,
            topology: [Topology],
            [Symbol(kCapture)]: false,
            [Symbol(options)]: [Object: null prototype]
          }
        },
        host: 'ac-4oilfjv-shard-00-02.e6hybnh.mongodb.net',
        port: 27017,
        name: 'protoskrip'
      },
      queue: [],
      buffer: false,
      emitter: EventEmitter {
        _events: [Object: null prototype] {},
        _eventsCount: 0,
        _maxListeners: undefined,
        [Symbol(kCapture)]: false
      }
    },
    Query: [Function (anonymous)] {
      base: {
        toConstructor: [Function: toConstructor],
        setOptions: [Function (anonymous)],
        collection: [Function: collection],
        collation: [Function (anonymous)],
        '$where': [Function (anonymous)],
        where: [Function (anonymous)],
        equals: [Function: equals],
        eq: [Function: eq],
        or: [Function: or],
        nor: [Function: nor],
        and: [Function: and],
        gt: [Function (anonymous)],
        gte: [Function (anonymous)],
        lt: [Function (anonymous)],
        lte: [Function (anonymous)],
        ne: [Function (anonymous)],
        in: [Function (anonymous)],
        nin: [Function (anonymous)],
        all: [Function (anonymous)],
        regex: [Function (anonymous)],
        size: [Function (anonymous)],
        maxDistance: [Function (anonymous)],
        minDistance: [Function (anonymous)],
        mod: [Function (anonymous)],
        exists: [Function (anonymous)],
        elemMatch: [Function (anonymous)],
        within: [Function: within],
        box: [Function (anonymous)],
        polygon: [Function (anonymous)],
        circle: [Function (anonymous)],
        near: [Function: near],
        intersects: [Function: intersects],
        geometry: [Function: geometry],
        select: [Function: select],
        slice: [Function (anonymous)],
        sort: [Function (anonymous)],
        limit: [Function (anonymous)],
        skip: [Function (anonymous)],
        batchSize: [Function (anonymous)],
        comment: [Function (anonymous)],
        maxTimeMS: [Function (anonymous)],
        maxTime: [Function (anonymous)],
        hint: [Function (anonymous)],
        j: [Function: j],
        slaveOk: [Function (anonymous)],
        setReadPreference: [Function (anonymous)],
        read: [Function (anonymous)],
        r: [Function (anonymous)],
        readConcern: [Function (anonymous)],
        tailable: [Function (anonymous)],
        w: [Function: writeConcern],
        writeConcern: [Function: writeConcern],
        wTimeout: [Function: wtimeout],
        wtimeout: [Function: wtimeout],
        merge: [Function (anonymous)],
        find: [Function (anonymous)],
        _find: [AsyncFunction: _find],
        cursor: [Function (anonymous)],
        findOne: [Function (anonymous)],
        _findOne: [AsyncFunction: _findOne],
        count: [Function (anonymous)],
        _count: [AsyncFunction: _count],
        distinct: [Function (anonymous)],
        _distinct: [AsyncFunction: _distinct],
        updateMany: [Function: updateMany],
        _updateMany: [AsyncFunction (anonymous)],
        updateOne: [Function: updateOne],
        _updateOne: [AsyncFunction (anonymous)],
        replaceOne: [Function: replaceOne],
        _replaceOne: [AsyncFunction (anonymous)],
        deleteOne: [Function (anonymous)],
        _deleteOne: [AsyncFunction (anonymous)],
        deleteMany: [Function (anonymous)],
        _deleteMany: [AsyncFunction (anonymous)],
        findOneAndUpdate: [Function (anonymous)],
        _findOneAndUpdate: [AsyncFunction (anonymous)],
        findOneAndDelete: [Function (anonymous)],
        findOneAndRemove: [Function (anonymous)],
        _findOneAndRemove: [AsyncFunction (anonymous)],
        setTraceFunction: [Function (anonymous)],
        exec: [AsyncFunction: exec],
        then: [AsyncFunction (anonymous)],
        selected: [Function: selected],
        selectedInclusively: [Function: selectedInclusively],
        selectedExclusively: [Function: selectedExclusively],
        _mergeUpdate: [Function (anonymous)],
        _optionsForExec: [Function (anonymous)],
        _fieldsForExec: [Function (anonymous)],
        _updateForExec: [Function (anonymous)],
        _ensurePath: [Function (anonymous)],
        _validate: [Function (anonymous)]
      }
    },
    '$init': Promise { undefined, catch: [Function (anonymous)] },
    '$caught': true,
    [Symbol(mongoose#Model)]: true
  }
}

It never happens to me before so i don’t know how to fix it, and the error log doesn’t really help me to fix this crash, by the way i’m using the latest version of mongoose and node js, anyone know how to fix it? (I cropped the crash log a bit since it’s very long and i can’t type more than a certain number of character to post it)

2 Likes

Hi @Ahmad_Razi,

Welcome to the MongoDB Community!

Apologies for the late response. Would you be able to resolve it? If not, could you please share the specific Node.js version and the Mongoose version you are using? Additionally, the stack trace of the application server would be helpful for debugging. Please also provide the full code snippet.

Could you confirm where you are obtaining this error log and where your database is hosted? Is it MongoDB Atlas, MongoDB on-premises, or locally?

Look forward to hearing from you.

Regards,
Kushagra

1 Like