Permission denied to create /opt/ejson/keys - simplejson

I'm trying to use Shopify ejson https://github.com/Shopify/ejson
When I run:
mkdir -p /opt/ejson/keys
I get permission denied.

I found an answer in this Github issue: https://github.com/Shopify/ejson/issues/80
sudo chown -R $(whoami) /opt/ejson
But would rather not have to use sudo

Related

Installing Apache Solr: Permission Denied

I am using iMac to run Apache Solr in command line. done the following:
wget https://apache.mirrors.nublue.co.uk/lucene/solr/8.5.1/solr-8.5.1-src.tgz
tar -xzf solr-8.5.1-src.tgz
cd to /solr
i then typed : bin/solr start and got permissions denied.
I tried sudo bin/solr start -force
and got :password: type password
after typing the password i get sudo: bin/solr command not found
I read that I need to change the solr home directory for better installation as it is denying root access probably?
Appreciate any suggestion to get Solr starting
Thanks
Paul
I think you need to download the binaries instead of the source files, then run:
cd solr/bin
solr create -c yourCore
solr start -p 8983
change the permission to to bin folder
something like:
sudo chmod -R 777 bin
You should download and install the version without scr at the end:
https://apache.mirrors.nublue.co.uk/lucene/solr/8.5.1/solr-8.5.1.tgz

the folder session cannot be handled because you do not hava permission to read it in ubuntu

i'm trying to delete the folder it showing the above error in ubuntu
try this
sudo chmod -R 777 foldername
or
sudo chmod -R 777 filename
if you give permission to all folder or all file then
sudo chmod -R 777 *

mongo db (mongodb.service) failed, status 14

I am experiencing the following problem using mongodb.
This is the error, when I check the status:
Screenshot of the error (mongodb.service, status 14)
Screenshot of code in the mongod.config file
Screenshot of the log file
I have tried uninstalling mongodb following every step from the website and install everything again and when I check the status I still get the same error. I have posted the screenshot of the error.
I am using MacBook pro if this matters.
Would really appreciate, if someone can help me fix this.
By changing the owner to monogdb user of
/var/lib/mongodb and /tmp/mongodb-27017.lock has worked for me.
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock
It seems from the log you have a unclean shutdown before. Or, it could also indicates that mongod is already running.
First, make sure mongod is not running already
ps aux | grep mongod
If it's not, remove the file:
rm /tmp/mongodb-27017.sock
Then try systemctl start mongod to start MongoDB again.
After rebooting in the command line,it fixed to problem,don’t know why after stopping mongo and uninstalling and installing it didn’t fix the problem, but after reboot everything is working fine.
This worked for me on Ubuntu 18.04
Go to the TMP directory: cd /tmp
Check if you have the mongodb sock file: ls *.sock
Change the user:group permission: chown mongodb:mongodb <YOUR_SOCK>
Start MongoDB: sudo service mongod start
Check the MongoDB status: sudo service mongod status
If this does not work you can try
sudo reboot
Please see here : https://medium.com/#gabrielpires/mongodb-ubuntu-16-04-code-exited-status-14-aws-lightsail-problem-417ffc78cb11
I had a similar issue and even though the permissions were all okay, the service failed to start. I had a look at the mongodb log
sudo tail -40 /var/log/mongodb/mongod.log
It said that the database was shutdown unexpectedly and needed to be repaired. I ran
sudo mongod --repair --config /etc/mongod.conf
This fixed the database, but now changed the permissions. You will need to do the chown steps again.
sudo chown -R mongodb:mongodb /var/lib/mongodb
sudo chown mongodb:mongodb /tmp/mongodb-27017.sock
Start the mongod service. It would be up & running now.
Same happended with CentOS Stream 8
the user for mongodb service is mongo and group is also mongo
sudo chown mongod:mongod /tmp/mongodb-27017.sock
Resolved, after checking the logfile, showing mongodb-27017.sock failed to start.
I have a similar issue. Was a SELinux blocking the normal execution.
So, I did:
# ausearch -c 'mongod' --raw | audit2allow -M my-mongod
# semodule -X 300 -i my-mongod.pp
and then:
$ sudo systemctl start mongod
and check:
sudo systemctl status mongod
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock

PostgreSQL installation failed on Ubuntu 14.04

I recently uninstalled postgresql from my computer. I tried to install it again but I faced some problems. I tried to fully uninstall it again like this:
I found al the packages related to postgres:
$ dpkg -l | grep postgres
Them I removed all the packages and related folders :
$ sudo apt-get --purge remove postgresql postgresql-9.3 postgresql-client-9.3 postgresql-client-common postgresql-common postgresql-contrib-9.3
$ sudo rm -rf /var/lib/postgresql/
$ sudo rm -rf /var/log/postgresql/
$ sudo rm -rf /etc/postgresql/
I've tried to install it again, but after the installation I can't access postgres user.
$ sudo apt-get install postgresql postgresql-contrib
$ sudo -i -u postgres
sudo: unable to change directory to /home/postgres: No such file or directory
If I access root I can access postgres but this is what happens:
$ sudo su -
$ su - postgres
No directory, logging in with HOME=/
postgres#rafael-pc:/$ psql
psql (9.3.9)
Type "help" for help.
postgres=# \q
could not save history to file "/home/postgres/.psql_history": No such file or directory
I have no idea what is happening. I've tried to uninstall it many times but I always have some kind of error when I install it back.
Just a guess here, but it sure looks to me like the problem is that there isn't a /home/postgres directory. I'm not sure what may have happened in your uninstall process to remove that, but it looks like that's the cause of the error in both of the steps you list.
Can you try this (or some approximation of these steps, which create that directory and make sure it's owned by the postgres user)?
# sudo mkdir /home/postgres
# sudo chown postgres /home/postgres

Homebrew install permissions issue

I have a standard homebrew install inside of usr/local/
When I try:
Larson-2:~ larson$ brew install postgresql
Error: Cannot write to /usr/local/Cellar
And when I use sudo:
Larson-2:~ larson$ sudo brew install postgresql
Cowardly refusing to `sudo brew install'
What am I doing wrong?
You somehow have limited permissions to /usr/local/Cellar. Brew doesn't like to install with sudo which is why it refuses.
Check the permissions:
ls -ld /usr/local/Cellar
Open them up for writing:
sudo chmod a+w /usr/local/Cellar
Do not use sudo when working with brew (for security reasons).
You've to simple set-up your permissions.
So I would go even further and change the permissions to:
sudo chgrp -R admin /usr/local /Library/Caches/Homebrew
sudo chmod -R g+w /usr/local /Library/Caches/Homebrew
and then apply the specific group (either admin or staff) to user which should be allowed to use brew command. Check groups of your user via: id -Gn).
If there are further issues, run: brew doctor to see what's wrong.
I'd change the group permissions:
$ chgrp -R admin /usr/local/Cellar
$ chmod g+w /usr/local/Cellar
assuming your user account is in group admin.
This also happens if you have multiple users on your machine. If so, it would be best for you to change the user since every other approach would have you messing around with a lot more files and folders than just /usr/local/Cellar
Use su userWhoInstalledBrew.
The problem can be solved by changing the directory's owner to the current user:
sudo chown -R $USER /usr/local
This answer is taken from: https://github.com/Homebrew/homebrew/issues/17884
Following the advice chukcha14 provided in his answer at There is no Cellar file in my usr/local dir for brew, I did this:
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Error: Could not create /usr/local/Cellar
Check you have permission to write to /usr/local
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/Cellar
Password:
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/Cellar
jaimes-mbp:SMR jaimemontoya$ brew install mongodb-community#4.2
Warning: You are using OS X 10.15.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
==> Installing mongodb-community from mongodb/homebrew-brew
==> Downloading https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-4.2.3.tgz
###################################################################################### 100.0%
Error: Failed to install plist file
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink .
/usr/local/opt is not writable.
You can try again using:
brew link mongodb-community
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mongodb/brew/mongodb-community`
==> Caveats
To have launchd start mongodb/brew/mongodb-community at login:
ln -sfv /usr/local/opt/mongodb-community/*.plist ~/Library/LaunchAgents
Then to load mongodb/brew/mongodb-community now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
Or, if you don't want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
🍺 /usr/local/Cellar/mongodb-community/4.2.3: 20 files, 304M, built in 110 seconds
jaimes-mbp:SMR jaimemontoya$ sudo mkdir /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ sudo chown $(whoami) /usr/local/opt
jaimes-mbp:SMR jaimemontoya$ brew link mongodb-community
Linking /usr/local/Cellar/mongodb-community/4.2.3... 13 symlinks created
jaimes-mbp:SMR jaimemontoya$
funny but I received the Error: Cannot write to /usr/local/Cellar message due to lack of disk space .. :/ ( 18MB left )

Resources