not connecting with postgres - getting error - role alfresco_db does not exists;

cancel
Showing results for 
Search instead for 
Did you mean: 
monicakumari
Established Member

not connecting with postgres - getting error - role alfresco_db does not exists;

Jump to solution

Hello.
I am trying to implement https://github.com/loftuxab/alfresco-ubuntu-install on my ubuntu system and It seems quite simple but its not connecting with postgres so repository not starting up.
I have updated postgreql.sh script and replaced values for ALFRESCODB=alfresco and ALFRESCOUSER=alfresco with ALFRESCODB=alfresco_db and ALFRESCOUSER=alfresco_db and ran this script (asked me for the password and I have entered "admin" for the same) and because of this, the database with "alfresco_db" name created automatically with the password "admin".
then I have updated alfresco-global.properties file for the same.
I have replaced db.username=alfresco , db.password=alfresco and db.name=alfresco
with db.username=alfresco_db , db.password=admin and db.name=alfresco_db
and started alfresco service but getting exception in initializing repository and getting below errors in the end

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: role "alfresco_db" does not exist)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
at org.alfresco.repo.domain.dialect.DialectFactoryBean.getObject(DialectFactoryBean.java:59)
at org.alfresco.repo.domain.dialect.DialectFactoryBean.getObject(DialectFactoryBean.java:1)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171)
... 116 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FATAL: role "alfresco_db" does not exist)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
... 119 more
Caused by: org.postgresql.util.PSQLException: FATAL: role "alfresco_db" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.readStartupMessages(QueryExecutorImpl.java:2559)
at org.postgresql.core.v3.QueryExecutorImpl.<init>(QueryExecutorImpl.java:133)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:250)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:454)
at org.postgresql.Driver.connect(Driver.java:256)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
... 124 more

Seems like its not connecting with the database. Please guide what else I can try or Is there anything I am doing wrong.

Thanks.

1 Solution

Accepted Solutions
angelborroy
Alfresco Employee

Re: not connecting with postgres - getting error &quot;role alfresco_db does not exists&quot

Jump to solution

It seems that your Postgres user is not created by the script.

Did you set the "createdb" variable to "y"?

https://github.com/loftuxab/alfresco-ubuntu-install/blob/master/scripts/postgresql.sh#L41

Hyland Developer Evangelist

View solution in original post

4 Replies
angelborroy
Alfresco Employee

Re: not connecting with postgres - getting error &quot;role alfresco_db does not exists&quot

Jump to solution

It seems that your Postgres user is not created by the script.

Did you set the "createdb" variable to "y"?

https://github.com/loftuxab/alfresco-ubuntu-install/blob/master/scripts/postgresql.sh#L41

Hyland Developer Evangelist
monicakumari
Established Member

Re: not connecting with postgres - getting error &quot;role alfresco_db does not exists&quot

Jump to solution

yes.. Thanks alot. It was a version issue. I have installed postgres manually and tried to connect. I have uninstalled it and tried via script and it worked.

monicakumari
Established Member

Re: not connecting with postgres - getting error role alfresco_db does not exists

Jump to solution

Hello. It was resolved but still I am getting an issue. I am not able to login because repository is not starting up. There is no exception on console.

while hitting share link :

Screenshot from 2020-01-13 12-37-46.png

and with alfresco link :

Screenshot from 2020-01-13 12-37-04.pngI have found nothing (errors or exceptions ) on console logs (catalina.out) but noticed that the line says connected to the databse is missing in logs catalina.out .I think its not connecting with database. Please guide.

Thank you.

EddieMay
Alfresco Employee

Re: not connecting with postgres - getting error role alfresco_db does not exists

Jump to solution

Hi @monicakumari,

It might be better if you raise this subsequent issue as a new post - with a reference to the original post if required - because people see the Solved icon & assume everything is ok.

Kind regards,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!