servicecatalog / oscm-identity

Identity service for managing authentication with external IdPs using OpenId Connect.
2 stars 2 forks source link

Dockerbuild Identity Server Proxy Error #92

Closed surfer190 closed 3 years ago

surfer190 commented 4 years ago

Version Info

How do I get the exact version?

[root@localhost docker]# docker image list
REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
servicecatalog/oscm-deployer   latest              11cafdd2e960        7 weeks ago         502MB
servicecatalog/oscm-initdb     latest              46384194386f        7 weeks ago         757MB
servicecatalog/oscm-birt       latest              62e2b8ab3591        7 weeks ago         781MB
servicecatalog/oscm-help       latest              2bf77647c280        7 weeks ago         457MB
servicecatalog/oscm-branding   latest              2db240ba2c82        7 weeks ago         603MB
servicecatalog/oscm-identity   latest              b94e3d62c459        7 weeks ago         685MB
servicecatalog/oscm-db         latest              a73ba8c09b69        7 weeks ago         581MB
servicecatalog/oscm-app        latest              377a3d8f7de2        7 weeks ago         942MB
servicecatalog/oscm-core       latest              5d332bcceb91        7 weeks ago         836MB

Describe the bug When using the dockerbuild, the identity server keeps restarting (autohealing) due to the following error:

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'applicationConfiguration': Unsatisfied dependency expressed through field 'proxyHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'proxyHandler': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'PROXY_HTTP_HOST' in value "${PROXY_HTTP_HOST}"

If seems if PROXY_HTTP_HOST is not an environment variable, no substituition happens and it fails.

How to Reproduce Steps to reproduce the behavior:

  1. Setup as per OSCM-Dockerbuild
  2. Ensure your var.env has the following:
##################
# Tomee settings #
##################
# The number of threads for constructing and destroying beans.
CONTAINER_CALLBACK_THREADS=4
# Specifies the size of the instance pool for this stateless SessionBean container.
CONTAINER_MAX_SIZE=1000
PROXY_ENABLED=false
#PROXY_HTTP_HOST=''
#PROXY_HTTP_PORT=''
#PROXY_HTTPS_HOST=''
#PROXY_HTTPS_PORT=''

Expected behavior No error, identity server runs successfully.

GoebelL commented 4 years ago

Hi @surfer190 I fear there is a issue with non-proxied https connections her. We are on it.

GoebelL commented 4 years ago

Hi @kowalczyka Looking into this issue, it seems to me that the identity service requires usage of an HTTPS proxy. Please check the VM args in the start script - https://github.com/servicecatalog/oscm-dockerbuild/blob/master/oscm-identity/start.sh#L42 If that's the case, we'll need a fix here. Can you see any workaround without proxy? E.g. would it help to leave the proxy settings blank? (Sorry, I don't have direct access at my place to test it)

kowalczyka commented 4 years ago

hello, @surfer190 is right, the oscm-identity container requires PROXY_HTTP_HOST and PROXY_HTTP_PORT env variables to be set even if proxy is disabled

Quick workaround for the issue would be to fill var.env with some dummy values for this e.g.: PROXY_ENABLED=false PROXY_HTTP_HOST=noproxy PROXY_HTTP_PORT=0

GoebelL commented 4 years ago

Thanks @kowalczyka

@surfer190, let me know if this works for you.

surfer190 commented 4 years ago

@GoebelL It worked, in that the container is stable now and does not restart.

2020-02-21 06:30:59.975  INFO 50 --- [           main] o.oscm.identity.OSCMIdentityApplication  : Started OSCMIdentityApplication in 65.03 seconds (JVM running for 68.013)

The /oscm-portal url still returnsHTTP Status 404 – Not Found. In the oscm-core container logs I am getting errors like Mandatory property 'LOG_FILE_PATH' not set!. I suppose that is an issue for a different repo though.

GoebelL commented 4 years ago

Fix is on DockerHub. Pull from docker.io servicecatalog/oscm-*:latest.

cworf91 commented 4 years ago

The HTTP_PROXY_HOST and HTTP_PROXY_PORT from the var.env are overridden by the start.sh. This has to be fixed.

cworf91 commented 3 years ago

To avoid the problem of the variables being overwritten, the oscm-identity container must be started via the Compose network. docker-compose -f docker-compose-oscm.yml up oscm-identity. The compose network will provide the variables from the var.env file to the container.