reportportal / shell-installation

ReportPortal installation configs for CentOS/RHEL Linux distributions
Apache License 2.0
4 stars 8 forks source link

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

Open blaky opened 4 years ago

blaky commented 4 years ago

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 commented 4 years ago

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

blaky commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Hi @Yumfriez ,

Can we get the credentials not-hardcoded?

bhecquet commented 4 years ago

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= RP_BINARYSTORE_PATH=