Mongo Compass crashes after upgrading Ubuntu 20.04 to 22.04: FATAL gpu_data_manager_impl_private - mongodb-compass

After upgrading Ubuntu 20.04 Desktop to 22.04 Desktop mongodb-compass crashes after a fews seconds booting with:
mongo compass FATAL gpu_data_manager_impl_private.cc(894)] The display compositor is frequently crashing
It seems like there is an issue with chromium, but I was not able to find a clean fix for this.

The solution was quite simple:
Remove the old installation: sudo apt remove mongodb-compass
Reinstall MongoDB Compass:
Download the deb file from the official Download page
Install with cd ~/Download and sudo apt install ./mongodb-compass_*_amd64.deb like suggested here

I found that running mongodb-compass --no-sandbox worked for me on Kubuntu 22.04.1.
I saw this flag on another Electron app issue https://github.com/mifi/lossless-cut/issues/1025 It looks like a bug in Electron. I believe electron passes this flag to the chromium browser that it uses, however this won't run mongodb compass in a secure sandbox environment: https://chromium.googlesource.com/chromium/src/+/master/docs/design/sandbox.md
Needless to say, it works and I added the flag to my shortcut /usr/share/applications/mongodb-compass.desktop which now looks like this:
[Desktop Entry]
Name=MongoDB Compass
Comment=The MongoDB GUI
GenericName=MongoDB Compass
Exec=mongodb-compass %U --no-sandbox
Icon=mongodb-compass
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;

Related

WSL2 VSCode Will Not Load After Ubuntu upgrade - Worked fine for 1 year

Running Windows 11, WSL2, Ubuntu 20.04. Been developing with VSCode over a year. I regularly run apt update and apt upgrade without any problem. Today after running apt upgrade I can no longer open VSCode. I get the following error
node:internal/modules/cjs/loader:990
throw err;
^
Error: Cannot find module '\wsl.localhost\Ubuntu-20.04\mnt\c\Users\JimD\AppData\Local\Programs\Microsoft VS Code\Code.exe'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:987:15)
at Module._load (node:internal/modules/cjs/loader:832:27)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
That is the correct path to the VSCode exe, but I am not sure about the \wsl.localhost\Ubuntu-20.04 part
I rolled back my wsl to an month old backup and confirmed VSCode ran fine. Ran apt update and upgrade on that and get the same error.
Does anyone know how to fix this?
Starting from a functioning backup of the WSL image, I manually installed each packaged listed from apt list --upgradable. Turns out it is the upgrade from systemd-genie 2.3 to 2.4 that is causing the problem.
If I upgrade every other package, VSCode still loads. When I upgrade systemd-genie to 2.4 and restart my laptop, VSCode will not load giving the error in the original post.
edit /usr/lib/binfmt.d/WSLInterop.conf, change flag PF to F, reboot wsl seems able to let you run code again, but not sure whether any other side-effects exists.
My final solution was to just not use systemd. With the release of Windows 11, a new feature has been added to WSL to runs scripts on WSL startup. This feature is now also available to Windows 10 users if you install WSL from the Microsoft Store (requires KB5020030, which should be available under Optional Updates).
create the file /etc/wsl.conf and the following
[boot]
command = bash /etc/[path to startup script]
in my case I used the path "/etc/wsl-services-start.sh" This shell script contains only
service apache2 start
service mysql start
Starting apache2 and mysql was the only thing I needed systemd for, so this works fine for me.

mongodb-community not working on Apple M1

I've installed mongodb-community version 5.0 using brew, following this post's answer for M1 Apple Silicon Macs: How to install Mongodb on Apple M1 chip
Everything works fine, until the 6th step.
After running "mongo" in my terminal, I get the following errors.
I searched over stackoverflow and suspected that perhaps the mongodb service is not running, but the command "brew services list" gives the
following output.
Running "mongod" gives the following error.
Yet, checking "mongo --version" gives a clear indication of installation.
I have also uninstalled mongodb various times, started afresh with the whole procedure.
I'm so frustrated at this point. It would be really helpful if someone could let me know what's wrong in this process/how I could fix it.
PS: This is one of my first posts and I'm sorry if it is not structured well or does not follow a community guideline. I can try to edit the post if any rule is violated.
Thank you.
This solution worked for me
Read-only file system when attempting mkdir /data/db on Mac
rom the official docs https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
Install homebrew and run the following commands
sudo chown -R $(whoami) $(brew --prefix)/*
then
brew tap mongodb/brew
then
brew install mongodb-community#4.2
and
brew services start mongodb-community
or
mongod --config /usr/local/etc/mongod.conf
then
ps aux | grep -v grep | grep mongod
and
mongo
to verify you can run show dbs in the mongo shell
Please follow this step for reinstalling mongodb, it works for me:
1st: run this command (Prerequisites)
xcode-select --install
\\note: Homebrew requires the Xcode commandline tools
2nd: install Homebrew for M1 chip (Prerequisites)
3rd: run this command to get Homebrew formula that work with mongodb
brew tap mongodb/brew
4th: run this command to get mongodb version 5
brew install mongodb-community#5.0
5th: run this command to run mongodb in the background
brew services start mongodb-community#5.0
// I notice that if I don't run this command I cannot connect to the server and receive the same error message like you
6th: just run mongo and enjoy. I hope it works.

How do I download MongoDB Server on M1 Mac?

I've tried probably 10 different sites looking how to download MongoDB on M1 Mac. And I would like to put this here for anyone who wants to make a step-by-step guide to get MongoDB working on M1 Macs. Feel free to edit this and provide your steps.
For example if I run the following command (brew install mongodb-community#4.4), the following error occurs:
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
And then I try rerunning in ARM. And it installs successfully. Then I run mongod and get zsh: command not found: mongod. How is this possible?? It's weird because mongo command works just as expected. So mongodb-community is downloaded but I can't access the mongod command.
Does anyone know why? I've tried changing the path but mongod isn't anywhere local...
-- Starting from Rosetta Terminal:

Mongo command not found on Mac using zsh?

I installed Mongo Db via the official site. I also created the below folder
~/data/db
I added the mongo files in the location as follows :
/usr/local/mongodb
Im using zsh so setting the environment variables as suggested in the bash_profile doesnt work for me.
My .zshrc file looks as follows
export PATH=$HOME/bin:/usr/local/bin:$PATH
export MONGO_PATH=/usr/local/mongodb
export PATH=MONGO_PATH/bin:$PATH
I also ran the source command as follows :
source ~/.zshrc
However even after trying variations of various answers, I still get :
zsh: command not found: mongo
What am I missing here?
I have the same problem when I try to install Mongo with official doc
This instruction help me to run MongoDB on MacOS Mojave 10.14.6
Try mongod --version
If there is no Mongodb installed try enter brew install mongodb
After this check installation again with mongod --version
Then use brew services start mongodb to run MongoDB on startup
Try brew install mongodb-community-shell.
My case:
I did try brew services start mongodb to solve it, but face this issue:
Error: No available formula with the name "mongodb". Did you mean mongosh or monetdb?
Here is a recommendation on how to solve it where brew install mongodb-community-shell mentioed as part install of the latest Mongo shell: https://developpaper.com/fix-mac-brew-installation-mongodb-error-no-available-formula-with-the-name-mongodb/
this one worked for me.in new macbook or air we cant find .zhrc or bash
in new mac its .zprofile. so change the path in .zprofile
export PATH=/opt/homebrew/bin:$PATH
brew install mongodb-community-shell
you can try it it work for me because when downloading mongodb it lacks the shell so when typing mongo in terminal it won't work

Mongo Setting Path

I am currently running macOS Sierra (latest version) and I have zshell installed. I have tried to follow the steps to install MongoDB Community Edition Manually by using the following commands after downloading the binaries from the MongoDB Download Center.
tar -zxvf mongodb-osx-ssl-x86_64-3.6.2.tgz
mkdir -p mongodb
cp -R -n mongodb-osx-ssl-x86_64-3.6.2/ mongodb
export PATH=mongodb-install-directory/bin:$PATH
On step 4, my mongodb install directory path is in /Users/(my username)/mongodb. Therefore, I have run the following command:
export PATH=/Users/(my username)/mongodb/bin:$PATH
From the (my username) directory, I tried to run mongod and got the message zsh: command not found: mongod. However, when I go into /Users/(my username)/mongodb/bin and run ./mongod, everything works except for my data path not being set.
From here, I have tried to set the db path by running the following command:
./mongod --dbpath /Users/(my username)/mongodb/data/db
Then I ran ./mongod and the data path was not found. What am I doing wrong? I even tried to install MongoDB Community Edition with Homebrew and the same errors popped up.
I am not sure if this would make a difference, but I have installed vagrant in the past and I was able to use MongoDB.
I suggest re-install MongoDB once again, use brew
brew update
brew install mongodb