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

Update HTTP-Proxy with support of corporate proxy #7950

Closed
1 of 6 tasks
offtherailz opened this issue Mar 10, 2022 · 14 comments
Closed
1 of 6 tasks

Update HTTP-Proxy with support of corporate proxy #7950

offtherailz opened this issue Mar 10, 2022 · 14 comments

Comments

@offtherailz
Copy link
Member

offtherailz commented Mar 10, 2022

Description

We can update the proxy for this:
geosolutions-it/http-proxy#65

When this issue is solved, we need to update the dependency to the proxy.

What kind of improvement you want to add? (check one with "x", remove the others)

  • Minor changes to existing features
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Other useful information

@tdipisa
Copy link
Member

tdipisa commented Mar 23, 2022

@offtherailz as soon as @taba90 confirm this we can proceed on changing the dependency to 1.3-SNAPSHOT in master to do needed tests.

@tdipisa
Copy link
Member

tdipisa commented Mar 24, 2022

@offtherailz, thanks to this we can proceed to update the http-proxy dependency to 1.3-SNAPSHOT in master branch to test in DEV.

@tdipisa
Copy link
Member

tdipisa commented Mar 25, 2022

It seems we still have problems with the latest 1.3-SNAPSHOT of http_proxy.
Sample of request performed by MapStore catalog tool is:

curl 'https://dev-mapstore.geosolutionsgroup.com/mapstore/proxy/?url=https%3A%2F%2Fgeorchestra.geo-solutions.it%2Fgeoserver%2Fwms%3Fservice%3DWMS%26version%3D1.3.0%26request%3DGetCapabilities' \
  -H 'Connection: keep-alive' \
  -H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: https://dev-mapstore.geosolutionsgroup.com/mapstore/' \
  -H 'Accept-Language: en,it;q=0.9,fr-FR;q=0.8,fr;q=0.7,en-US;q=0.6' \
  -H 'Cookie: _gcl_au=1.1.694834413.1648205893; _ga=GA1.2.1500297756.1648205893; _gid=GA1.2.1032213120.1648205893' \
  --compressed

The error if HTTP 500 while the reported exception is:

javax.servlet.ServletException: Servlet.init() for servlet [HttpProxy] threw exception
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base/java.lang.Thread.run(Thread.java:829)
</pre><p><b>Root Cause</b></p><pre>java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
	org.apache.http.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:116)
	org.apache.http.impl.conn.PoolingHttpClientConnectionManager.&lt;init&gt;(PoolingHttpClientConnectionManager.java:123)
	it.geosolutions.httpproxy.HTTPProxy.init(HTTPProxy.java:135)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base&#47;java.lang.Thread.run(Thread.java:829)

@tdipisa
Copy link
Member

tdipisa commented Mar 29, 2022

@taba90 I've reverted the dependency in MS master. Do you have any news for the fix?

@shad-git
Copy link

shad-git commented Apr 6, 2022

@tdipisa We had a quick call with @taba90 and @offtherailz to check this.
I was not able to reproduce this. the tests were done for both HTTP and HTTPS on a local setup. The mapstore was built using the 1.3-SNAPSHOT version of the http-proxy. Looks like the problem is not even related to dependency conflicts as well. can you please deploy it again and share with us the logs (at debug level)?

@offtherailz
Copy link
Member Author

I did this PR:
#8071
for testing. Please merge as well as you are able to test and revert as well as you have sufficient information

@tdipisa
Copy link
Member

tdipisa commented Apr 8, 2022

I did this PR: #8071 for testing. Please merge as well as you are able to test and revert as well as you have sufficient information

@offtherailz let's coordinate things better since the last time we had problem in DEV for this. @shadab-geo let us know a bit in advance when you can spend time on this so that we will merge the PR for your test and eventually revert it again if necessary early after. To capture the log of your test you can ask @randomorder and maybe schedule a quick session with him.

@nmco nmco assigned shad-git and unassigned offtherailz May 4, 2022
@nmco nmco closed this as completed May 31, 2022
@tdipisa tdipisa reopened this May 31, 2022
@tdipisa tdipisa mentioned this issue Aug 3, 2022
9 tasks
@taba90
Copy link
Contributor

taba90 commented Aug 3, 2022

@randomorder could you download the log from MapStore QA so we can investigate the issue?

@taba90
Copy link
Contributor

taba90 commented Aug 4, 2022

@randomorder provided me logs. Checking this...

@taba90
Copy link
Contributor

taba90 commented Aug 4, 2022

@tdipisa
It is another dependency conflict issue this time with a print-lib transitive depedency. Shadab was not able to reproduce locally because the test was done with the print extension.
I'm opening a pr to put an exclusion on the depenency at stake in the print-lib pom.xml.

@taba90
Copy link
Contributor

taba90 commented Aug 4, 2022

opened pr on master for print-lib see here geosolutions-it/mapfish-print#55

@tdipisa
Copy link
Member

tdipisa commented Aug 5, 2022

@taba90 @randomorder thank you so much, really. @taba90 please check my review here

@tdipisa
Copy link
Member

tdipisa commented Aug 9, 2022

@taba90 after the updates below deployed in MS QA instance through this PR, the problem still exist. Below is the error that seems to be the same:

geosolutions-it/mapfish-print#55
geosolutions-it/mapfish-print#56 (the backport to geosolutions-2.1.x) used by MS QA)

<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Servlet.init() for servlet [HttpProxy] threw exception</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException: Servlet.init() for servlet [HttpProxy] threw exception
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base&#47;java.lang.Thread.run(Thread.java:829)
</pre><p><b>Root Cause</b></p><pre>java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
	org.apache.http.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:116)
	org.apache.http.impl.conn.PoolingHttpClientConnectionManager.&lt;init&gt;(PoolingHttpClientConnectionManager.java:123)
	it.geosolutions.httpproxy.HTTPProxy.init(HTTPProxy.java:135)
	org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:433)
	org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
	org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
	org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	java.base&#47;java.lang.Thread.run(Thread.java:829)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/9.0.65</h3></body></html>

Beside that, as per naming convention we agreed in the team the tag name here should be geosolutions-2.1.0 and not v2.1.0

Considering the above I'm forced to restore again the http_proxy 1.1.1 for 2022.02.xx branch to allow QA functional testing for 2022.02.00.

Let's wait to merge #8459 for master branch for the moment to see if we can solve before the problem for 2022.02.xx shortly to use the new fixed version of http_proxy also in master.

tdipisa added a commit that referenced this issue Aug 9, 2022
* Update pom.xml

* Update pom.xml
@tdipisa
Copy link
Member

tdipisa commented Aug 30, 2022

@taba90 working now in QA as reported here

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

No branches or pull requests

5 participants