Error: Permission denied # rb_sysopen - /Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist - mongodb

Getting the above error when I try to install Mongo with homebrew from terminal. I've seen a lot of people with this same issue but none of the past recs have worked for me. I'm on an M1 Macbook Pro. Any help?

I run into the similar problem on M1 Mac PRO. I guess that your MongoDB is up and running. so if you run
$brew services start MySQL/MongoDB
System fails to grab the service (since it starts already) and returns the the error.
My solution is to uninstall MySQL. install it again. And restart the machine.
Once restarting the machine, check whether MySQL is running by
$mysqld
The system shown that SQL is up and running. then do
$mysql -uroot

Related

Error when start the postgres service with homebrew using Mac OS

I installed postgresql 10 with the classic command:
brew install postgresql#10
Then I started the service:
brew services start postgresql#10
The output says:
Successfully started postgresql#10 (label: homebrew.mxcl.postgresql#10)
but when I run this command:
brew services
This is what I get:
Name Status User Plist
cassandra stopped
postgresql stopped
postgresql#10 error username /opt/homebrew/opt/postgresql#10/homebrew.mxcl.postgresql#10.plist
It seems that the service in not running correctly. Previously I had another version of Posgresql. It was the version 10 again but installed with the installer offered but the postgresql's webpage. However I should have removed it.
I check with this command to see used ports:
lsof -nP +c 15 | grep LISTEN
and I don't have services using the port 5432 (the default port used by postgresql).
I shared the procedure to investigate further and maybe solve the problem.
Check the file /opt/homebrew/opt/postgresql#10/homebrew.mxcl.postgresql#10.plist. This path is given by the brew services command.
Open the file and see where the log is written. In my case:
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/postgresql#10.log</string>
Look at the log. I my case I saw that there was a file locked, probably by the previous instance of postgresql that didn't release the lock. The restart of my Mac solved the issue.

Cannot complete pgadmin4 setup. Apache web server

I've got problem with completing pgadmin4 installation thru sudo /usr/pgadmin4/bin/setup-web.sh command.
During this process instalator does not recognizing that Apache is running and asks me if I want to start it:
The Apache web server is not running. We can enable and start the web server for you to finish pgAdmin 4 installation. Continue (y/n)? y
Then it just spits some errors:
Too few arguments.
Error enabling . Please check the systemd logs
Too few arguments.
Error starting . Please check the systemd logs
So far I havn't found where the logs are stored.
About my apache, I am quite sure that my server is running, because I can connect to it through browser, phpmyadmin is working properly, and service apache2 status returns * apache2 is running. By my understanding apache2 is just fancy word for httpd service, and there is no other service called simply apache.
PostgreSQL seems to work properly from command line, haven't tested if I can connect to it yet, but this shouldn't be the case right?
I am using
**PostgreSQL:** 12.5 (Ubuntu 12.5-0ubuntu0.20.04.1)
**Ubuntu:** Ubuntu 20.04 LTS
**Server:** Apache/2.4.41 (Ubuntu)
I had the same issue for Debian 10 and Ubuntu 20. The /usr/pgadmin4/bin/setup-web.sh script is using 'uname -a' which doesn't contain "Debian" identifier in the return string. Updating this to read /proc/version will allow APACHE to be specified as the Debian variant of apache2.
Change:
UNAME=$(uname -a)
To:
UNAME=$(cat /proc/version)
I had a similar problem with Ubuntu running inside WSL 2. Managed to resolve it by modifying the /usr/pgadmin4/bin/setup-web.sh script. I moved these lines outside of the conditional:
IS_DEBIAN=1
APACHE=apache2
This allowed the installation to progress beyond the Too few arguments. error. There was still an error however:
System has not been booted with systemd as init system (PID 1). Can't operate.
Error restarting apache2. Please check the systemd logs
I resolved this by running:
sudo service apache2 restart
After this I tried bringing up the admin page by visiting http://127.0.0.1/pgadmin4 from the Windows host. This still didn't work, and had to connect using the Ubuntu machine's ip address (you can find it out via ifconfig) which finally allowed me to see the login page.

After upgrading GitLab, two different psql/postgres versions

We recently did a GitLab upgrade from 11.x up to 12.9.2. It all went well; however, when I do gitlab-ctl pg-upgrade it shows the DB being 10.12. But when I do gitlab-rake gitlab:env:info it shows 10.7.
If I drop into gitlab-rails dbconsole it shows:
psql (10.12, server 10.7)
I didn't originally set this server or instance up. Any idea why it would be showing two different versions (does 10.12 mean the client is 10.12, the server is still 10.7?) Ideally the server would be 10.12.
Thanks for any help.
Answered my own question after further digging.
I ran a stat on /opt/gitlab/embedded/postgresql/10/bin/postgres and it showed that it was indeed changed when we did the upgrade.
Then I ran an lsof and saw that the postgres process had this binary open with a (deleted) marker, meaning it had the previous file still open in memory.
I ran a gitlab-ctl stop and a gitlab-ctl start and now it's showing properly when I do gitlab-rails dbconsole.
Should've done all that first!

Stuck in starting meteor

This is really frustrating me. I have a DO VPS with ubuntu 14.04 (64) installed.
I installed VestaCP as control panel on that and have hosted some PHP based personal project.
I also installed meteor on it but never used, now when I am trying to create a project and run it ('meteor create rt' then 'cd rt' then 'meteor')
It is giving the following error :
[[[[[ /home/admin/code/rt ]]]]]
=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
root#RD:/home/admin/code/rt#
Could anyone please help? Please ask me for more informations if required.
**** EDIT ****
I created a fresh DigitalOcean server and it is giving the same error on that. Some issue with Digital Ocean? File System of Digital Ocean? I am confused. I am trying it on different flavours of Linux and same result. All are fresh linux installations.
I finally got the solution. Posting it here for others.
This was the problem as a few environment variables which mongodb looks for while starting was not set
Set the variables LC_ALL and LANG and it works fine (mostly setting LC_ALL will do)
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
This solution is for Ubuntu 12.04 +
Other variants may require similar work.
Unexpected mongo exit code 1 is still an uncaught exception as far as i think.
You can try by updating your c/c++ compilers uptodate. Have a look here.
It says :
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.6
sudo apt-get install g++-4.6
All the best!
So we have narrowed the issue down to meteor's mongo installation on your box (though I think we were pretty sure of this all along). Let's attempt to debug that a bit. The way I have done this in the past is to try to open meteor's mongo with the mongod provided by meteor. You will perform these procedures without running the meteor server. This should give you the warning that is causing Mongo to exit. First you need to find this. In my instance installed on Mint (which should be similar to Ubuntu) it is at:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod
You can look at that location on your Ubuntu box or you can run something like this to get the location:
find ~/.meteor/ -name mongod
Once you find the location then go to the directory of your meteor project you are attempting to run and in that directory you should find this location:
<your meteor project>/.meteor/local
cd into that directory and run the following command:
~/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/mongodb/bin/mongod --dbpath ./
From there you can analyze the output (or update the question so we can see the output) and this should show you the mongo error you are receiving on startup and allow you to fix it.
I've got the same issues trying to start a meteor app and exactly the mongodb server is being terminated in an unexpectly manner. Generally the virtual linux server from some dealers like the one you mentioned are coming without a swap partition (check in /etc/fstab file) so if you have not enough memory to allocate MongoDB server then meteor app can't be started. You can create a swap partition or instal swapspace
sudo apt-get install swapspace
After that I was able to start the meteor app... Just be patient as swap memory is not as faster as RAM.
Since due some "smart" StackExchange policy I cannot up-vote or comment to working solution...)
Quoted answer works also on Digital Ocean on CentOS 7 x64 vmlinuz-3.10.0-123.8.1.el7.x86_64
first, type locale command and see the output, you will see that it will say something about LC_ALL not set.
Now, add these two lines in /etc/environment and it worked.
I changed the locale setting to match my needs.
Fixed on my Debian 8 with the following bash command, (use sudo if needed)
localedef -i en_US -f UTF-8 en_US.UTF-8

mongo db testing error

I came to know about Mongo db. So I installed it on ubuntu 11.04. To check whether it is installed or not I checked it in software center and it was there. So for test I made command in terminal as
$mongo
but it is something like this
Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79.
so can someone tell me how to solve this problem.
Your mongod is not running. Check the process list using "ps" and restart the mongod service if it is not started.