question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'toString' of null when running mongodb 4.2

See original GitHub issue

Not sure if this is fixed in 0.7.0, as that version gives me another error (same as #46).

I am running version 0.6.2 in a docker container, which works fine when running mongodb 4.0 but not 4.2.

My dockerfile looks like the following:

FROM node:12-stretch

RUN apt-get install libkrb5-dev
RUN npm install run-rs@0.6.2 --unsafe-perm -g
CMD ["run-rs","--keep", "-q", "--version", "4.0.0", "--host", "mongo"]

And the output of my container is the following:

Downloading MongoDB 4.2.0
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  109M    0     0  16.0M      0  0:00:06  0:00:06 --:--:-- 17.8M
Copied MongoDB 4.2.0 to '/usr/local/lib/node_modules/run-rs/4.2.0'
Skipping purge
Running '/usr/local/lib/node_modules/run-rs/4.2.0/mongod' [ 27017, 27018, 27019 ]
Restarting replica set...
/usr/local/lib/node_modules/run-rs/node_modules/mongodb-topology-manager/lib/server.js:101
            .toString()
             ^

TypeError: Cannot read property 'toString' of null
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/run-rs/node_modules/mongodb-topology-manager/lib/server.js:101:14)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
codedavincicommented, Nov 23, 2020

@vkarpov15 I tested it and the link to download has changed, I forked the project to debug it and I fixed. I could send a pull a request. Btw I’ve been having the same issue with the version 4.4.1

1reaction
tayuruscommented, Aug 29, 2022

npm cache clean --force helped me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught: TypeError: Cannot read property 'toString' of null
You are getting an error because setti will be null if no matches are found. We can check for it like so. if...
Read more >
$toString (aggregation) — MongoDB Manual
Converts a value to a string. If the value cannot be converted to a string, $toString errors. If the value is null or...
Read more >
Mongoose v6.8.2: API docs
Mongoose.prototype.CastError(). Parameters. type «String» The name of the type. value «Any» The value that failed to cast.
Read more >
npm err! cannot read properties of undefined (reading 'name')
Solution 1: Clear Cache. First you need to clear your cache by this command: npm cache clear --force. Now, run npm install command....
Read more >
Node.js v19.3.0 Documentation
node:crypto module methods and properties ... The following, for instance, will throw the TypeError because there is no ... ifError(null); // OK assert....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found