Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres and RabbitMQ credentials from start_rb.sh are ignored, default hardcoded credentials used instead #4

Open
blaky opened this issue Apr 7, 2020 · 6 comments

Comments

@blaky
Copy link
Contributor

blaky commented Apr 7, 2020

Hi,

I just completed the guide, I used a custom username and password and updated the start script as the guide instructs, but it looks like the database username is hardcoded somewhere in the application as I get the following error in the logs when I execute the start_rp.sh file.

Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "rpuser"
	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.Driver.makeConnection(Driver.java:458) ~[postgresql-42.2.8.jar!/:42.2.8]
	at org.postgresql.Driver.connect(Driver.java:260) ~[postgresql-42.2.8.jar!/:42.2.8]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-3.4.1.jar!/:na]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:353) ~[HikariCP-3.4.1.jar!/:na]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[HikariCP-3.4.1.jar!/:na]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:473) ~[HikariCP-3.4.1.jar!/:na]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) ~[HikariCP-3.4.1.jar!/:na]
	... 169 common frames omitted
	Suppressed: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "rpuser"
		at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:520) ~[postgresql-42.2.8.jar!/:42.2.8]
		at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:141) ~[postgresql-42.2.8.jar!/:42.2.8]
		at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:201) ~[postgresql-42.2.8.jar!/:42.2.8]
		... 178 common frames omitted
@blaky
Copy link
Contributor Author

blaky commented Apr 7, 2020

I went back and created an rpuser account to get finish the installation, but it looks like the password is hardcoded too.

@blaky
Copy link
Contributor Author

blaky commented Apr 7, 2020

Yes, once I created an rpuser authenticated by rppass it started working. The credentials I provided in the start_rp.sh file are ignored by the application.

@blaky
Copy link
Contributor Author

blaky commented Apr 7, 2020

Actually all credentials seem to be hardcoded.

2020-04-07 12:28:15.406 ERROR 24309 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'infoEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/info/InfoEndpointAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.info.InfoEndpoint]: Factory method 'infoEndpoint' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'infoContributorComposite' defined in URL [jar:file:/home/reportportal/service-api.jar!/BOOT-INF/classes!/com/epam/ta/reportportal/info/InfoContributorComposite.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analyzerInfoContributor' defined in URL [jar:file:/home/reportportal/service-api.jar!/BOOT-INF/classes!/com/epam/ta/reportportal/info/AnalyzerInfoContributor.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managementTemplate' defined in class path resource [com/epam/ta/reportportal/core/configs/rabbit/AnalyzerRabbitMqConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.epam.ta.reportportal.core.analyzer.auto.client.RabbitMqManagementClient]: Factory method 'managementTemplate' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized

I got this error about connecting to RabbitMQ, once I created an account in RabbitMQ with the username and password found in the ReportPortal docker files, I got beyond this point.

@blaky blaky changed the title Database username is hardcoded somewhere Postgres and RabbitMQ credentials from start_rb.sh are ignored, default hardcoded credentials used instead Apr 7, 2020
@blaky
Copy link
Contributor Author

blaky commented Apr 7, 2020

Yep, it looks like the credentials are hardcoded in the application.yaml file: https://github.com/reportportal/service-api/blob/develop/src/main/resources/application.yaml

@AlehB
Copy link
Contributor

AlehB commented Apr 13, 2020

Hi @Yumfriez ,

Can we get the credentials not-hardcoded?

@bhecquet
Copy link

for starting service-api, I'm using the following line and it works as it overrides every needed configuration from application.yaml:
RP_AMQP_HOST=localhost RP_AMQP_APIUSER=$RP_RABBITMQ_USER RP_AMQP_APIPASS=$RP_RABBITMQ_PASSWORD RP_AMQP_USER=$RP_RABBITMQ_USER RP_AMQP_PASS=$RP_RABBITMQ_PASSWORD RP_DB_USER=$RP_POSTGRES_USER RP_DB_PASS=$RP_POSTGRES_PASSWORD RP_DB_HOST=localhost RP_PLUGINS_ROOTDIR=<path_to_plugins> RP_BINARYSTORE_PATH=<path_to_data>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants