You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/23 14:24:19 UTC

[GitHub] [pulsar-manager] tuteng commented on issue #307: enable proxy pulsar-manager log report Error 401 Authentication required

tuteng commented on issue #307:
URL: https://github.com/apache/pulsar-manager/issues/307#issuecomment-648188501


   Exception stack:
   
   ```
   : http-outgoing-466 >> GET /admin/v2/brokers/beijing HTTP/1.1
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 >> Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY4NzA4NDI5MH0.K5sAvvUjd9J8RxHaBVlDCPnoPW8T6FDa4x9CovoH6v4
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 >> Host: 10.1.104.130:8080
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 >> Connection: Keep-Alive
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 >> User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_212)
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 >> Accept-Encoding: gzip,deflate
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "GET /admin/v2/brokers/beijing HTTP/1.1[\r][\n]"
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY4NzA4NDI5MH0.K5sAvvUjd9J8RxHaBVlDCPnoPW8T6FDa4x9CovoH6v4[\r][\n]"
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "Host: 10.1.104.130:8080[\r][\n]"
   2020-06-22 11:01:20.966 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "Connection: Keep-Alive[\r][\n]"
   2020-06-22 11:01:20.967 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_212)[\r][\n]"
   2020-06-22 11:01:20.967 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "Accept-Encoding: gzip,deflate[\r][\n]"
   2020-06-22 11:01:20.967 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 >> "[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "HTTP/1.1 307 Temporary Redirect[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "Date: Mon, 22 Jun 2020 11:01:20 GMT[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "Location: http://10.1.104.220:8080/admin/v2/brokers/beijing[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "broker-address: 10.1.104.130[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "Content-Length: 0[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "Server: Jetty(9.4.20.v20190813)[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.wire                     : http-outgoing-466 << "[\r][\n]"
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << HTTP/1.1 307 Temporary Redirect
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << Date: Mon, 22 Jun 2020 11:01:20 GMT
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << Location: http://10.1.104.220:8080/admin/v2/brokers/beijing
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << broker-address: 10.1.104.130
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << Content-Length: 0
   2020-06-22 11:01:20.968 DEBUG 42 --- [pool-2-thread-1] org.apache.http.headers                  : http-outgoing-466 << Server: Jetty(9.4.20.v20190813)
   2
   ```
   
   It seems that this problem is caused by 307 redirections. When a proxy does 307 redirections, the header does not carry authentication information. You can try to open this option on proxy.conf
   
   ```
   # Whether client authorization credentials are forwared to the broker for re-authorization.
   # Authentication must be enabled via authenticationEnabled=true for this to take effect.
   forwardAuthorizationCredentials=false
   ```
   
   @lvs071103 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org