[JBoss JIRA] (TEIIDSB-170) Automate materialization to JDG
by Ramesh Reddy (Jira)
[ https://issues.redhat.com/browse/TEIIDSB-170?page=com.atlassian.jira.plug... ]
Work on TEIIDSB-170 started by Ramesh Reddy.
--------------------------------------------
> Automate materialization to JDG
> -------------------------------
>
> Key: TEIIDSB-170
> URL: https://issues.redhat.com/browse/TEIIDSB-170
> Project: Teiid Spring Boot
> Issue Type: Enhancement
> Components: OpenShift
> Reporter: Steven Hawkins
> Assignee: Ramesh Reddy
> Priority: Major
> Fix For: 1.5.0
>
> Original Estimate: 1 week
> Time Spent: 1 hour
> Remaining Estimate: 4 days, 7 hours
>
> Create an internal materialization replacement needs that is turnkey materialization to JDG (little to no user setup required)
> - the operator may create the infinispan cluster if needed
> - the status table and internal representation of the materialization target would be setup automatically
> For the user this would be as simple marking a view as materialized and then it would be populated in jdg upon deployment. They would not have any concerns with cache naming, status tables, etc.
> For simplicity the initial version would make a similar assumption to the current internal logic - it is for only a specific vdb. If the vdb cr is modified, then it's expected that the cache would be recreated.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-190) REST with request payload throws an error
by Ramesh Reddy (Jira)
[ https://issues.redhat.com/browse/TEIIDSB-190?page=com.atlassian.jira.plug... ]
Work on TEIIDSB-190 started by Ramesh Reddy.
--------------------------------------------
> REST with request payload throws an error
> -----------------------------------------
>
> Key: TEIIDSB-190
> URL: https://issues.redhat.com/browse/TEIIDSB-190
> Project: Teiid Spring Boot
> Issue Type: Bug
> Components: core
> Reporter: Sadhana Nandakumar
> Assignee: Ramesh Reddy
> Priority: Major
> Fix For: 1.5.0
>
>
> TEIID spring boot is expecting the payload to be a bean, and hence throws an error. POST without request body works fine without any issues.
> CREATE VIEW StockPrice (
> symbol string PRIMARY KEY,
> price double
> ) AS
> SELECT p.symbol, y.price
> FROM accounts.PRODUCT as p, TABLE(call invokeHttp(action=>'POST', endpoint=>QUERYSTRING('predict'), headers=>jsonObject('application/json' as "Content-Type"), request=>jsonObject('PLATINUM' as "customerClass"))) as x,
> JSONTABLE(JSONPARSE(x.result,true), '$' COLUMNS price double path '@.data.segment') as y
> No errors on build, when I query the odata endpoint, I see the following error.
> <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
> <code>TEIID30504</code>
> <message>
> TEIID30504 quotesvc: No bean named '{"customerClass":"PLATINUM"}' available
> </message>
> </error>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-190) REST with request payload throws an error
by Ramesh Reddy (Jira)
[ https://issues.redhat.com/browse/TEIIDSB-190?page=com.atlassian.jira.plug... ]
Ramesh Reddy updated TEIIDSB-190:
---------------------------------
Story Points: 0.5
> REST with request payload throws an error
> -----------------------------------------
>
> Key: TEIIDSB-190
> URL: https://issues.redhat.com/browse/TEIIDSB-190
> Project: Teiid Spring Boot
> Issue Type: Bug
> Components: core
> Reporter: Sadhana Nandakumar
> Assignee: Ramesh Reddy
> Priority: Major
> Fix For: 1.5.0
>
>
> TEIID spring boot is expecting the payload to be a bean, and hence throws an error. POST without request body works fine without any issues.
> CREATE VIEW StockPrice (
> symbol string PRIMARY KEY,
> price double
> ) AS
> SELECT p.symbol, y.price
> FROM accounts.PRODUCT as p, TABLE(call invokeHttp(action=>'POST', endpoint=>QUERYSTRING('predict'), headers=>jsonObject('application/json' as "Content-Type"), request=>jsonObject('PLATINUM' as "customerClass"))) as x,
> JSONTABLE(JSONPARSE(x.result,true), '$' COLUMNS price double path '@.data.segment') as y
> No errors on build, when I query the odata endpoint, I see the following error.
> <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
> <code>TEIID30504</code>
> <message>
> TEIID30504 quotesvc: No bean named '{"customerClass":"PLATINUM"}' available
> </message>
> </error>
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?focusedWorklogId=12450854&pag... ]
Steven Hawkins logged work on TEIID-5942:
-----------------------------------------
Author: Steven Hawkins
Created on: 20/Apr/20 1:50 PM
Start Date: 20/Apr/20 1:50 PM
Worklog Time Spent: 2 hours, 30 minutes
Issue Time Tracking
-------------------
Remaining Estimate: 0 minutes (was: 2 hours, 30 minutes)
Time Spent: 2 hours, 30 minutes
Worklog Id: (was: 12450854)
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 14.0, 13.0.3, 13.1.1
>
> Original Estimate: 2 hours, 30 minutes
> Time Spent: 2 hours, 30 minutes
> Remaining Estimate: 0 minutes
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?page=com.atlassian.jira.plugi... ]
Steven Hawkins resolved TEIID-5942.
-----------------------------------
Fix Version/s: 14.0
13.0.3
13.1.1
Resolution: Done
Required adding a check to see if the port information was duplicated. On the spring boot side the fix is to pick up the common teiid logic. That will come in on 8.0 and master.
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 14.0, 13.0.3, 13.1.1
>
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?page=com.atlassian.jira.plugi... ]
Steven Hawkins updated TEIID-5942:
----------------------------------
Original Estimate: 2 hours, 30 minutes
Remaining Estimate: 2 hours, 30 minutes
Story Points: 0.5
Sprint: DV Sprint 62
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 14.0, 13.0.3, 13.1.1
>
> Original Estimate: 2 hours, 30 minutes
> Remaining Estimate: 2 hours, 30 minutes
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?page=com.atlassian.jira.plugi... ]
Steven Hawkins commented on TEIID-5942:
---------------------------------------
The root issue seems to be that the proxy is setting both the X-Forwarded-Host with host and port and the X-Forwarded-Port property. That is not expected and I dare say seems like an issue with the proxy - if it is setting X-Forwarded-Port, it should not include that in the X-Forwarded-Host. In any case we can fix it on our side.
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?page=com.atlassian.jira.plugi... ]
Work on TEIID-5942 started by Steven Hawkins.
---------------------------------------------
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIID-5942) OData request fails when Host header specifies also port
by Steven Hawkins (Jira)
[ https://issues.redhat.com/browse/TEIID-5942?page=com.atlassian.jira.plugi... ]
Steven Hawkins moved ENTESB-13523 to TEIID-5942:
------------------------------------------------
Project: Teiid (was: Red Hat Fuse)
Key: TEIID-5942 (was: ENTESB-13523)
Workflow: classic default workflow (was: ENTESB Planned Work)
Component/s: OData
(was: Data Integration)
Affects Version/s: (was: fuse-next-TP1-CR2)
> OData request fails when Host header specifies also port
> --------------------------------------------------------
>
> Key: TEIID-5942
> URL: https://issues.redhat.com/browse/TEIID-5942
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Priority: Blocker
>
> TLDR: using the URLs returned in odata responses for new requests in apache http client causes 406 in the server pod because it tries to add the port twice to the url
> ----
> The current implementation of odata endpoint always adds the port to the returned links (such as {{context}} or {{nextLink}}), even when using the default port and not specifying it in the request:
> {code}
> $ curl -s -k https://host/odata/Source/SimpleTableView | jq '."@odata.context"'
> "https://host:443/odata/Source/$metadata#SimpleTableView"
> {code}
> This is ok, but will be important for triggering the issue later.
> Tools such as {{curl}} or web browsers strip the port from the hostname before they set it in the {{Host}} header on the HTTP request:
> {code}
> $ curl -vs -k https://host/odata/Source/SimpleTableView 2>&1 | grep 'Host:'
> > Host: host
> {code}
> However, the Apache HTTP client java client (also used by the olingo odata 4 client) does not strip the port, resulting in {{Host}} header such as
> {code}
> Host: host:443
> {code}
> This is in fact in line with [RFC 2616|https://tools.ietf.org/html/rfc2616#section-14.23] which states
> {quote}
> The Host request-header field specifies the Internet host and port
> number of the resource being requested, as obtained from the original
> URI given by the user or referring resource
> {quote}
> Requests with such a header will fail in the vdb pod with the following exception:
> {code}
> Caused by: java.lang.RuntimeException: Unable to create URI: https://host:443:443/odata/Source/SimpleTableView
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:85) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.handleProxiedRequest(SpringODataFilter.java:218) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.teiid.spring.odata.SpringODataFilter.preHandle(SpringODataFilter.java:73) ~[spring-odata-1.4.1.fuse-jdk11-800012-redhat-00001.jar!/:1.4.1.fuse-jdk11-800012-redhat-00001]
> at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1034) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.8.RELEASE.jar!/:5.1.8.RELEASE]
> ... 66 common frames omitted
> Caused by: java.net.MalformedURLException: Error at index 3 in: "443:443"
> at java.base/java.net.URL.<init>(URL.java:679) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:541) ~[na:na]
> at java.base/java.net.URL.<init>(URL.java:488) ~[na:na]
> at org.teiid.olingo.web.ProxyHttpServletRequest.<init>(ProxyHttpServletRequest.java:83) ~[teiid-olingo-13.1.1.fuse-jdk11-800015-redhat-00001.jar!/:13.1.1.fuse-jdk11-800015-redhat-00001]
> ... 72 common frames omitted
> {code}
> Notice {{443:443}}, it appears the backend is trying to add the port even though it's already there, which makes the resulting URL invalid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months