OperationalError : FATAL: no pg_hba.conf entry for host “127.0.0.1”, user “fibzadmin”, database...












0














I have been struggling with this issue for a few days now. I have read numerous other SO threads and it seems like my django app is having difficulty connecting to the postgres database. I am not sure why that is happening though. I am hoping some of the experts out there can take a look and tell me why this might be happening. I have pasted some of my configuration here.



This is what my settings.py contains



DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'fibz',
'USER':"fibzadmin",
"PASSWORD":"fibzadmin",
"HOST":"localhost",
"PORT":"5432",
}
}


This is what my pg_hba.conf and postgresql.conf look like



sudo vim /var/lib/pgsql9/data/pg_hba.conf


Output:



local   all             all                                     trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
# IPv6 local connections:
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
host all all ::1/128 md5


following are the main uncommented lines



listen_addresses = '*'
port = 5432
max_connections = 100


and this is from the psql



(fibzVenv) [admin]$ sudo su - postgres
Last login: Fri Nov 23 07:13:53 UTC 2018 on pts/3
-bash-4.2$ psql -U postgres
psql (9.2.24)
Type "help" for help.

postgres=# du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
fibzadmin | | {}

postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+------------+----------+-------------+-------------+---------------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
fibz | fibzadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/fibzadmin +
| | | | | fibzadmin=CTc/fibzadmin
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)


Are there any suggestions on what I might be doing wrong or what I should be looking at ? This is happening on amazon linux its on the same instance.










share|improve this question






















  • what's in the /etc/hosts?
    – Red Cricket
    Nov 23 '18 at 7:53










  • Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
    – Red Cricket
    Nov 23 '18 at 7:57










  • No I am using postgis plugin instead of postgresql
    – MistyD
    Nov 23 '18 at 7:58
















0














I have been struggling with this issue for a few days now. I have read numerous other SO threads and it seems like my django app is having difficulty connecting to the postgres database. I am not sure why that is happening though. I am hoping some of the experts out there can take a look and tell me why this might be happening. I have pasted some of my configuration here.



This is what my settings.py contains



DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'fibz',
'USER':"fibzadmin",
"PASSWORD":"fibzadmin",
"HOST":"localhost",
"PORT":"5432",
}
}


This is what my pg_hba.conf and postgresql.conf look like



sudo vim /var/lib/pgsql9/data/pg_hba.conf


Output:



local   all             all                                     trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
# IPv6 local connections:
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
host all all ::1/128 md5


following are the main uncommented lines



listen_addresses = '*'
port = 5432
max_connections = 100


and this is from the psql



(fibzVenv) [admin]$ sudo su - postgres
Last login: Fri Nov 23 07:13:53 UTC 2018 on pts/3
-bash-4.2$ psql -U postgres
psql (9.2.24)
Type "help" for help.

postgres=# du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
fibzadmin | | {}

postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+------------+----------+-------------+-------------+---------------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
fibz | fibzadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/fibzadmin +
| | | | | fibzadmin=CTc/fibzadmin
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)


Are there any suggestions on what I might be doing wrong or what I should be looking at ? This is happening on amazon linux its on the same instance.










share|improve this question






















  • what's in the /etc/hosts?
    – Red Cricket
    Nov 23 '18 at 7:53










  • Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
    – Red Cricket
    Nov 23 '18 at 7:57










  • No I am using postgis plugin instead of postgresql
    – MistyD
    Nov 23 '18 at 7:58














0












0








0







I have been struggling with this issue for a few days now. I have read numerous other SO threads and it seems like my django app is having difficulty connecting to the postgres database. I am not sure why that is happening though. I am hoping some of the experts out there can take a look and tell me why this might be happening. I have pasted some of my configuration here.



This is what my settings.py contains



DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'fibz',
'USER':"fibzadmin",
"PASSWORD":"fibzadmin",
"HOST":"localhost",
"PORT":"5432",
}
}


This is what my pg_hba.conf and postgresql.conf look like



sudo vim /var/lib/pgsql9/data/pg_hba.conf


Output:



local   all             all                                     trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
# IPv6 local connections:
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
host all all ::1/128 md5


following are the main uncommented lines



listen_addresses = '*'
port = 5432
max_connections = 100


and this is from the psql



(fibzVenv) [admin]$ sudo su - postgres
Last login: Fri Nov 23 07:13:53 UTC 2018 on pts/3
-bash-4.2$ psql -U postgres
psql (9.2.24)
Type "help" for help.

postgres=# du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
fibzadmin | | {}

postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+------------+----------+-------------+-------------+---------------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
fibz | fibzadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/fibzadmin +
| | | | | fibzadmin=CTc/fibzadmin
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)


Are there any suggestions on what I might be doing wrong or what I should be looking at ? This is happening on amazon linux its on the same instance.










share|improve this question













I have been struggling with this issue for a few days now. I have read numerous other SO threads and it seems like my django app is having difficulty connecting to the postgres database. I am not sure why that is happening though. I am hoping some of the experts out there can take a look and tell me why this might be happening. I have pasted some of my configuration here.



This is what my settings.py contains



DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'fibz',
'USER':"fibzadmin",
"PASSWORD":"fibzadmin",
"HOST":"localhost",
"PORT":"5432",
}
}


This is what my pg_hba.conf and postgresql.conf look like



sudo vim /var/lib/pgsql9/data/pg_hba.conf


Output:



local   all             all                                     trust
# IPv4 local connections:
host all power_user 0.0.0.0/0 md5
# IPv6 local connections:
host all other_user 0.0.0.0/0 md5
host all storageLoader 0.0.0.0/0 md5
host all all ::1/128 md5


following are the main uncommented lines



listen_addresses = '*'
port = 5432
max_connections = 100


and this is from the psql



(fibzVenv) [admin]$ sudo su - postgres
Last login: Fri Nov 23 07:13:53 UTC 2018 on pts/3
-bash-4.2$ psql -U postgres
psql (9.2.24)
Type "help" for help.

postgres=# du
List of roles
Role name | Attributes | Member of
------------+------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication | {}
fibzadmin | | {}

postgres=# l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+------------+----------+-------------+-------------+---------------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
fibz | fibzadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/fibzadmin +
| | | | | fibzadmin=CTc/fibzadmin
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)


Are there any suggestions on what I might be doing wrong or what I should be looking at ? This is happening on amazon linux its on the same instance.







python django postgresql devops






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 23 '18 at 7:36









MistyD

4,0251468138




4,0251468138












  • what's in the /etc/hosts?
    – Red Cricket
    Nov 23 '18 at 7:53










  • Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
    – Red Cricket
    Nov 23 '18 at 7:57










  • No I am using postgis plugin instead of postgresql
    – MistyD
    Nov 23 '18 at 7:58


















  • what's in the /etc/hosts?
    – Red Cricket
    Nov 23 '18 at 7:53










  • Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
    – Red Cricket
    Nov 23 '18 at 7:57










  • No I am using postgis plugin instead of postgresql
    – MistyD
    Nov 23 '18 at 7:58
















what's in the /etc/hosts?
– Red Cricket
Nov 23 '18 at 7:53




what's in the /etc/hosts?
– Red Cricket
Nov 23 '18 at 7:53












Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
– Red Cricket
Nov 23 '18 at 7:57




Also shouldn't ENGINE be set to django.db.backends.postgresql instead of django.contrib.gis.db.backends.postgis.
– Red Cricket
Nov 23 '18 at 7:57












No I am using postgis plugin instead of postgresql
– MistyD
Nov 23 '18 at 7:58




No I am using postgis plugin instead of postgresql
– MistyD
Nov 23 '18 at 7:58












1 Answer
1






active

oldest

votes


















0














I think the error message is very accurate. Looking at your pg_hba.conf I don't see a line specifying fibzadmin as a valid user except over ipv6.



I think you need to add the following line:



host    all             fibzadmin     0.0.0.0/0               md5





share|improve this answer























  • I am going to try this.
    – MistyD
    Nov 23 '18 at 7:45










  • after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
    – MistyD
    Nov 23 '18 at 7:53












  • think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
    – Exelian
    Nov 23 '18 at 8:19











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442434%2foperationalerror-fatal-no-pg-hba-conf-entry-for-host-127-0-0-1-user-fibza%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I think the error message is very accurate. Looking at your pg_hba.conf I don't see a line specifying fibzadmin as a valid user except over ipv6.



I think you need to add the following line:



host    all             fibzadmin     0.0.0.0/0               md5





share|improve this answer























  • I am going to try this.
    – MistyD
    Nov 23 '18 at 7:45










  • after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
    – MistyD
    Nov 23 '18 at 7:53












  • think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
    – Exelian
    Nov 23 '18 at 8:19
















0














I think the error message is very accurate. Looking at your pg_hba.conf I don't see a line specifying fibzadmin as a valid user except over ipv6.



I think you need to add the following line:



host    all             fibzadmin     0.0.0.0/0               md5





share|improve this answer























  • I am going to try this.
    – MistyD
    Nov 23 '18 at 7:45










  • after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
    – MistyD
    Nov 23 '18 at 7:53












  • think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
    – Exelian
    Nov 23 '18 at 8:19














0












0








0






I think the error message is very accurate. Looking at your pg_hba.conf I don't see a line specifying fibzadmin as a valid user except over ipv6.



I think you need to add the following line:



host    all             fibzadmin     0.0.0.0/0               md5





share|improve this answer














I think the error message is very accurate. Looking at your pg_hba.conf I don't see a line specifying fibzadmin as a valid user except over ipv6.



I think you need to add the following line:



host    all             fibzadmin     0.0.0.0/0               md5






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 23 '18 at 7:46

























answered Nov 23 '18 at 7:44









Exelian

3,7572237




3,7572237












  • I am going to try this.
    – MistyD
    Nov 23 '18 at 7:45










  • after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
    – MistyD
    Nov 23 '18 at 7:53












  • think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
    – Exelian
    Nov 23 '18 at 8:19


















  • I am going to try this.
    – MistyD
    Nov 23 '18 at 7:45










  • after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
    – MistyD
    Nov 23 '18 at 7:53












  • think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
    – Exelian
    Nov 23 '18 at 8:19
















I am going to try this.
– MistyD
Nov 23 '18 at 7:45




I am going to try this.
– MistyD
Nov 23 '18 at 7:45












after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
– MistyD
Nov 23 '18 at 7:53






after adding that I am getting the error FATAL: password authentication failed for user "fibzadmin". Is there a simple way for me to check if the password I specified is correct ?
– MistyD
Nov 23 '18 at 7:53














think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
– Exelian
Nov 23 '18 at 8:19




think you can assume that password authentication failed means the password you entered is incorrect. If you're testing things you could temperarely set the trust level as trust so you can log in.
– Exelian
Nov 23 '18 at 8:19


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53442434%2foperationalerror-fatal-no-pg-hba-conf-entry-for-host-127-0-0-1-user-fibza%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Trompette piccolo

Slow SSRS Report in dynamic grouping and multiple parameters

Simon Yates (cyclisme)