- Common Loki Misconfigurations
- Iterating Through a List in Ink
- Debugging Misconfigured Container Networks
- Minimum Viable EC2 in Terraform
- Storylets in Ink
- Interactive Fiction Tooling Overview
- In-Place Resizing for Digitalocean Droplets
- Unity Demonstrates the Importance of FOSS
- Target Labels in Prometheus
- My View of AI is the Same
- Verify DNS Ownership with TXT Records
- Sane Droplet Defaults
- Editing Made Easy with Vim
- Gatsby Gotchas
- Concatinating Default AWS Tags in Terraform
- Easily Updating the Default Github Branch
- Lifetimes in Rust
- Checking for Bad Links
- Maybe TypeScript and React is Bad
- Static Asset Management in React
- Bundler Down Time
- Using React Context for Localization
- JS Implementation of a Sticky Footer
- Custom Aliases
- Trying Out the 7drl Challenge
- Trash Opinions
- Building Your First Program in Rust
- Fixing mongod reports errors related to opening a socket
- Improving Open Source Maintenance
- Technical Interviewing Tips
- Housekeeping Note
- Dynamic Programming Basics
- The Oddity of Naming Conventions in Programming Languages
- An Experiment Using Machine Learning, Part 3
- Debugging with grep
- An Experiment Using Machine Learning, Part 2
- An Experiment Using Machine Learning, Part 1
- The Value of while
- National Day of Civic Hacking
- OpenAI and the Future of Humanity
- Creating a Whiteboard App in Django
- Creating Meaningful, Organized Information
- Towards A Critique of Social Media Feeds
- Setting up Routes in Django
- Developing a Messaging Component for Code for SF
- Dream Stream 2.0
- Keyed Collections in Javascript: Maps and Sets
- Blog Soft Relaunch
- Scraping with Puppeteer
- Looking Ahead to Dream Stream 2.0
- Solving West of Loathing's Soupstock Lode Puzzle
- Installing Ubuntu
- Interview with David Jickling Evaluation
- Compare Text Evaluation
- Dream Stream Evaluation
Fixing mongod reports errors related to opening a socket
tl;dr If you get a complaint about the socket already in use try running the mongo
shell twice.
For the past 24 hours I have been trying to fix a MongoDB error where anytime I attempted a connection Mongo would complain that the socket is already in use.
This is a common enough problem that it is covered in the Troubleshoot Ubuntu Installation section of the MongoDB documentation.
Unfortunately the recommendation to shut down the existing process and try again wouldn’t work for me. I would kill the process in terminal, but the same complaint would happen when I started everything up again. Changing to a new port wasn’t an option for me either. I was trying to run a complex application where the built-in assumption was that you were running MongoDB on the default 27017 port.
A fresh install of MongoDB didn’t fix anything, and all the various suggestions I found on Stack Overflow and Stack Overflow clone boards also didn’t fix anything either.
However I did accidentally fix the problem, and I’m here to share what I did. After running service mongod start
I ran the mongo
shell twice. The first time I ran it I received the error message with the web socket complaint. However the second time the problem just went away.
I was hoping by the time I got through this troubleshooting session I would be able to write some in-depth technical explanation about the inner workings of MongoDB. Unfortunately my actual solution was a fix that doesn’t make any sense to me. Still, since I hadn’t come across this suggestion in all my troubleshooting research, I decided it would be in the public interest to share this information in case it might help someone else that was similarly stuck.