Password authentication failed error on running laravel migration - postgresql

I am trying to deploy my Laravel app on a DigitalOcean droplet. The droplet is setup with nginx, php7, and postgres, I follow up the tuts from DigitalOcean on how to set them up. Then I try to follow this tutorial on how to deploy the Laravel app using the git hook and so on.
Now the app itself is up and running, I can access the pages and all. But I can't run php artisan migrate. I have been changing the database username, name, password on .env file, but I always get the exact same error:
[Illuminate\Database\QueryException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy" (SQL: select * from information_schema.tables where table_schema = apollo and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy"
[PDOException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy"
Here is my latest .env config for the database:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USERNAME=postgres
DB_DATABASE=postgres
DB_PASSWORD=[my password]
DB_SCHEMA=public
As you can see, what is so absurd is that even with the DB_USERNAME is set to postgres, the error will still say for user "deploy".
I have been googling around and the closest thing, or I thought so, is to update some configuration on /etc/postgresql/9.5/main/postgresql.conf, which is to make listen_addresses = '*'. I updated it, restarted postgres service, and still get the exact same error.
Anyone can help me to point out what did I miss?
Thanks.

This happens due to caching.
When you run, php artisan config:cache, it will cache the configuration files. Whenever things get change, you need to keep running it to update the cache files. But, it won't cache if you never run that command.
This is OK for production, since config don't change that often. But during staging or dev, you can just disable caching by clearing the cache and don't run the cache command
So, just run php artisan config:clear, and don't run the command previously to avoid caching

Related

Heroku: Enabling MTLS on postgres... failed! Not Found

I am trying to enable mutual MTLS on my PostgreSQL database, however whenever I run the command heroku data:mtls:create DATABASE_NAME --app APP_NAME (With my own DATABASE_NAME and APP_NAME obviously) I get the error Enabling MTLS on DATABASE_NAME... failed! Not Found. I am not sure why I am getting this error because I installed the MTLS plugin just fine from the same command line, I am logged in to heroku and when I run heroku apps my APP_NAME comes up just fine. If anybody could help me out with this that would be amazing!

psql: FATAL: role "root" does not exist when creating database from fabric explorer's sql file

I meet error psql: FATAL: role "root" does not exist when running ./createdb.sh from https://github.com/hyperledger/blockchain-explorer. I am trying to run the blockchain explorer on Centos.
I think the last version broke something, or makes it incompatible with some of the tooling around.
Try reverting to the prev docker images:
hyperledger/explorer-db:0.3.8
hyperledger/explorer:0.3.8
That did the trick for me.
Similar error for me "psql: FATAL: role "postgres" does not exist" when running the createdb.sh script. I am trying to install on ubuntu.
I fixed it by running the following command before :
/home/linuxbrew/.linuxbrew/Cellar/postgresql/11.4/bin$ createuser -s postgres
than run the createdb.sh script WITHOUT using sudo.
Hope this can help somebody.
You should specify the DB user while running the script.
Modify explorerconfig.json under blockchain-explorer/app to include the properties of the connection to DB like "host", "port", "database", "username" and "password".
Please refer to this readme from their github repo - https://github.com/hyperledger/blockchain-explorer/blob/master/README.md#Database-Setup

Can not input password of my GitHub account when using hexo deploy

I encounter this issue after I type "hexo deploy" in terminal. It asked me my GitHub username and password. The problem is I can only type in my username but not my password.
INFO Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
On branch master
nothing to commit, working tree clean
Username for 'https://github.com': Yancey2126
Password for 'https://Yancey2126#github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Yancey2126/yancey2126.github.io.git/'
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/Yancey2126/yancey2126.github.io.git/'
All I can do is to press Return and get an failed identification. Anyone knows what's going on? Thanks a lot~
Check the output of git config credential helper: you might have a password cache, which will provide automatically a password for the user Yancey2126.
For instance, with Git for Windows, you would be using the latest Microsoft Git Credential Manager for Windows.
On mac, you would have the osxkeychain.

Mongo DB: Authentication failed

I have 2 problems. First I can't login into my MongoDB. I tried this way: Can't create backup mongodump with --db. Authentication failed but no succsess. I've tried differnt passwords and user, but I can't log in. My Mongo Server runs on an Debian 8 Server. For Uninstall and install, I used this tutorial: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/ . I start the debian new after every uninstall.
Can I remove the password. In the conf data, I comment auth = true. I hope you can help me.
I get this message
MongoDB shell version: 3.2.7
connecting to: 127.0.0.1:27017/test
2016-06-29T12:30:01.079+0000 E QUERY [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow#src/mongo/shell/db.js:1441:20
#(auth):6:1
#(auth):1:2
exception: login failed
No authentication by default on mongo that might have to do with system privileges.

Running PGAdmin after Silent installation, what is the login?

I started an installation of Postgres in unatended mode with the commandline:
postgresql-9.5.2-1-windows-x64-x64.exe --unattendedmodeui minimal --mode unattended --superpassword "password" --servicename "postgreSQL"
--servicepassword "password" --serverport 5432
After the installation is finished i want to login to the database with pgadmin. i tried with "password" but i get the error:
fatal password authentication failed for user postgres
so what are my login data for the installed database?
Thanks a lot
Marcel
If you don't know the password you have to change the pg_hba.conf file that contains all the authentication information.
You can read about how it works here:
http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html
I suggest you to create a backup of the original file first and to reboot the server after changes.
I was facing the same issue. It looked like there was a conflict with previous installations of Postgres.
I could login using the password specified by --superpassword after cleaning all Postgres-related folders in program files as well as in custom install locations.
A professional approach would be running your installer on a clean system or a VM.