reportportal / shell-installation

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

Application attempts to write to /plugins #5

Open blaky opened 4 years ago

blaky commented 4 years ago

On startup, the application tries to read/write /plugins. If the user running the start_rp.sh script, doesn't have access to the folder, the process will crash:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'extensionsInfoContributor': Unsatisfied dependency expressed through field 'pluginBox'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pf4jPluginBox' defined in class path resource [com/epam/ta/reportportal/core/configs/PluginConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.epam.ta.reportportal.core.plugin.Pf4jPluginBox]: Factory method 'pf4jPluginBox' threw exception; nested exception is java.nio.file.AccessDeniedException: /plugins
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:397)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1429)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1503)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1467)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1358)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778)
    ... 105 common frames omitted

Once I manually created the folder and granted permissions to the user running the script, the issue got resolved.

blaky commented 4 years ago

The path seems to be hardcoded at: https://github.com/reportportal/service-api/blob/develop/src/main/resources/application.yaml

AlehB commented 4 years ago

Hi @Yumfriez ,

Can we get this not-hardcoded?

bhecquet commented 4 years ago

Hello, you can set environment variable RP_PLUGINS_ROOTDIR= The same applies for all other configurations set in application.yaml