I am trying to add new user to SASL db with:
saslpasswd2 -a memcached -c <new_user>.
Once I repeat password I get following error:
saslpasswd2: generic failure
I was not able to find any solution online...
If anyone has similar problem, solution is to add sudo before saslpasswd2...
sudo saslpasswd2 -a memcached -c <new_user>
Related
I have been trying since yesterday to connect to a ChainLink node and I was not able to.
I followed the steps at this website
I am having a problem with "Set the Remote DATABASE_URL Config" (I think that this is my only error because of the [ERROR] listed below, I do not know if I am doing something else wrong since every command was executed without error)
I am using the Docker option to create the database listed here.
I am always having this error:
"[ERROR] unable to lock ORM: failed to connect to host=localhost user=some-postgres database=postgres: dial error (dial tcp [::1]:5432: connect: cannot assign requested address) logger/default.go:155 stacktrace=github.com/smartcontractkit/chainlink/core/logger.Errorf
/chainlink/core/logger/default.go:155"
After writing in my Ubuntu Terminal (ON WINDOWS 10):
"cd ~/.chainlink-kovan && docker run -p 6688:6688 -v ~/.chainlink-kovan:/chainlink -it --env-file=.env smartcontract/chainlink:0.10.1 local n"
I do not know how to connect to the database and what to write as attributes. All of the other steps and installs I have accomplished successfully.
I just want to know how to create a database on PostgreSQL and connect it to Docker as explained on the ChainLink website and write the appropriate command in the Ubunto terminal (for the "Remote DATABASE_URL Config PostgreSQL" step) so that I can run my node.
Thanks! (PS: I am a beginner and your help is much appreciated, and if I forgot to mention any important information please let me know so that I add it)
A comprehensive 101 for docker-postgres can be found here: https://hackernoon.com/dont-install-postgres-docker-pull-postgres-bee20e200198
Basically, you need to deploy a postgres db with docker
Pre-Reqs:
Create a dir for you docker/postgres:
mkdir -p $HOME/docker/volumes/postgres
Example:
docker run --rm --name pg-docker -e POSTGRES_USER=<any_desired_name> -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=<any_db_name> -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres
For postgres username, it can be anything like "super_chain" or etc.
For postgres db, it can be "chainlink"
After, docker is up and running. Just follow up the docs tut, where you need to write the DB URL to the .env file
Cheers
everyone.
I hope that someone can help to answer my question.
I am joining a project in which I have to use various docker containers. I was told that I just needed to use docker-compose to pull down all the necessary containers. I tried this, and got two different errors, based on whether I used sudo or not. My machine is Ubuntu bionic beaver 18.04.4LTS
I have docker-engine installed according to the installation instructions for Bionic on the github page, and docker-compose is likewise installed according to its instructions. I did not create a "docker" group since I have sudo access.
We have two repos that I have to log in to before I can do anything. In order to prevent my passwords from being stored unencrypted in config.json, I followed this guide to set up a secure credential store:
https://www.techrepublic.com/article/how-to-setup-secure-credential-storage-for-docker/
However, rather than asking me for the password and/or passphrase mentioned in this article, the login process makes me enter the actual passwords to the repos. So, the secure credential store may not be working, which might be causing the problem.
At any rate, once I log in and the two commands show login succeeded, I then try to do a
docker-compose pull
on the repos. When I do
sudo docker-compose pull
I get this final error:
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-pass exited with "exit status 2: gpg: WARNING: unsafe ownership on homedir '/home/myuser/.gnupg'\ngpg: decryption failed: No secret key".')
an ls of the .gnupg directory is
myuser#myhost$ ls -lA ~ | grep gnupg
drwx------ 4 myuser myuser 226 Feb 9 13:35 .gnupg
gpg --list-secret-keys shows my keypair when I run it as myuser.
I am assuming that what is happening is that because I am running as sudo the user trying to access this directory is root, not myuser, and so it is failing. However, if I leave off the sudo
docker-compose pull
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
I am guessing that this is because my normal user doesn't have the ability to connect to the docker daemon's Unix socket.
So, how do I make these play together? Is the answer to add a docker group so that the command still runs as myuser and not as root? or is there another way to do this?
Also, why is my credential store not asking me for the password set by docker-credential-pass or the GPG passphrase? I suspect these two are related. Perhaps the pull is trying to send my authentication tokens over again and can't because it doesn't have access to the secure credentials store.
All of the above are guesses. Does anyone know what is going on here?
Thanking you in advance,
Brad
I just wanted to follow up with a solution to this question that worked for me.
Firstly, you need to add your user to the docker group that was created during docker-engine's installation.
sudo usermod --append --groups docker your_user_name
Because I had already used sudo to try this, there were a few files that ended up being created by root.
So, you have to chown a few things.
sudo chown your_user_name:your_group_name ~/.docker/config.json
Note that for the group name I used
docker
but I'm not sure if that's necessary.
Then, there were files inside the ~/.password-store directory that needed to be changed.
sudo chown -R your_user_name:your_group_name ~/.password-store
Most of these files are already owned by you, but the recorded credentials are not.
Then, the magic that fixed it all. From
https://ask.csdn.net/questions/5153956
you have to do this.
export GPG_TTY=$(tty)
and it is this last that makes gpg work.
Then, you can log in to your repos if you have to without using sudo
docker login -u repo_user_name your_repo_host
and then log in with your repo password.
Note that I don't know why you have to use the repo password instead of using the stored credentials.
Once you log in, you should be able to do a
docker-compose pull
without sudo
from the directory where you want the containers to be placed.
Note that you will probably have to provide your GPG passphrase at first. I'm not sure about this because I had already unlocked the key by following the steps in the above link to check to see if docker-credential-pass had the right credential store password stored.
and that should do it.
I'm trying to access mongodb on remote server using ssl. I followed the following tutorial [link].
I don't even know about the password part yet as I use ssh and the pem file without a password all the time.
Regardless, I used the following command:
mongod --sslOnNormalPorts <my pem file>
and got the following error:
Error parsing command line: unknown option sslOnNormalPorts
is there a simple way for me to access the remote mongodb database remotely?
EDIT Based on Comments
I read this link and tried the following:
mongo --host xx.xx.xxx.xxx/db-name --sslPEMKeyFile pemfileName.pem
I got the following error:
Error parsing command line: unknown option sslPEMKeyFile
What am I doing wrong?
You can try this command
ssh -i ~/my-aws-key.pem -N -f -L 8000:localhost:27017 ubuntu#ec2-54-252-168-106.ap-southeast-2.compute.amazonaws.com
I am trying to use a postgresql database for my rails app.
I followed the tutorials provided in this link:
http://blog.crowdint.com/2010/10/27/working-with-postgresql-and-rails3.html
I successfully installed postgresql with this command:
sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev libpgsql-ruby libgda-4.0-postgres libpq-dev
When I reached the line to create a user I entered this command:
sudo -u postgres psql template1
But after I entered a password for root it gave me an error saying
env: -u: No such file or directory
Any idea why the error popped up?
It sounds like the environment/path may be messed up for your user. I'm not sure if you're running on mac or linux/unix but I found a post from the Ubuntu forums that may be related to your problem:
sudo is broken
I'm not sure if alias'ing sudo (page 2 reply)
alias sudo='sudo env PATH=$path'
is the best permanent solution but it fixes it for him. I have no such alias on my sudo so I'm thinking there's a better solution via profile / export command and would invite someone to provide a better answer.
Hope this helps
I am using tilelite to serve up maps. I need it to run at the time the server is started. I have built a script that runs the following command at startup:
/usr/local/bin/liteserv.py /home/Uname/bin/mapnik/my_osm.xml --caching --debug=False
The process is failing with:
FATAL: Ident authentication failed for user "user_name" (encountered during parsing of layer 'leisure')
According to this page:
http://wiki.openstreetmap.org/wiki/Mapnik#Authentication_failed
I ran the following command:
./generate_xml.py osm.xml my_osm.xml --accept-none --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/
Now I get:
RuntimeError: PSQL error:
FATAL: Ident authentication failed for user "root" (encountered during parsing of layer 'leisure')
I am really new to postgres so could someone give me some very simple insructions on how to fix this.
If you call ./generate_xml.py --help you will see the various options. One of them is --user. If you do not supply it and also pass --accept-none then no specific user will be written into the Mapnik XML, which means that when Mapnik attempts to connect to the postgres database the current user will be used. So, if you run that script as root, 'root' will be used.
So, you need to either run that script as a unix user that can connect to postgres, or you need to go back and regenerate the XML and embed the name of a user that can connect to postgres. The latter is likely easier. Here is what I would do:
Assuming your normal unix use is named 'heman' do:
$ sudo su postgres
$ createuser heman # make superuser
$ exit
$ ./generate_xml.py osm.xml --accept-none --user heman --dbname gis --symbols ./symbols/ --world_boundaries ./world_boundaries/
$ liteserv.py osm.xml --caching --debug=False
More details on postgres and how to enable "trust" so that you can connect as the "postgres" user here: http://dbsgeo.com/foss4g2010/html/troubleshooting.html#troubleshooting-postgresql-connections