We are running spring boot admin console inside Istio and trying to connect to pods with actuator end points. When SBAC tries to connect to a pod, it gives 502. We checked the logs and it sounds that SBAC is duplicating the IP address in the request URL
boot-admin-console 2023-01-12 19:26:54.480 DEBUG 1 --- [or-http-epoll-3] r.n.http.client.HttpClientOperations
: [db6578e5-10, L:/172.30.208.27:34026 - R:172.30.198.29/172.30.198.29:8080] Received response (auto-read:false) : RE
SPONSE(decodeResult: success, version: HTTP/1.1)
spring-boot-admin-console HTTP/1.1 200 OK
spring-boot-admin-console x-content-type-options:
spring-boot-admin-console x-xss-protection:
spring-boot-admin-console cache-control:
spring-boot-admin-console pragma:
spring-boot-admin-console expires:
spring-boot-admin-console x-frame-options:
spring-boot-admin-console content-type:
spring-boot-admin-console date:
spring-boot-admin-console x-envoy-upstream-service-time:
spring-boot-admin-console server:
spring-boot-admin-console transfer-encoding:
spring-boot-admin-console 2023-01-12 19:26:54.480 DEBUG 1 --- [or-http-epoll-3] r.n.r.DefaultPooledConnectionProvider
: [db6578e5-10, L:/172.30.208.27:34026 - R:172.30.198.29/172.30.198.29:8080] onStateChange(GET{uri=/actuator/health,
connection=PooledConnection{channel=[id: 0xdb6578e5, L:/172.30.208.27:34026 - R:172.30.198.29/172.30.198.29:8080]}}, [r
esponse_received])
Any ideas?
We have the headless service for the target service to allow connectivity between SBAC and the application pod. I curled the target pod actuator endpoint from the sbac pod and it is accessible but from the UI is giving 502
I have set the file application-prod.yml with mail account but it is not working with mail server , it returns error 550 invalid helo name. i want to know where i can set host correctly.
thanks
mail:
host: mail.xxxx.cloud
port: 587
username: register#xxxx.cloud
password: xxxxxxxxxx
protocol: smtp
tls: true
properties.mail.smtp:
auth: true
starttls.enable: true
ssl.trust: mail.xxxx.cloud
...
...
...
mail:
from: register#xxxx.cloud
base-url: https://host.xxxx.cloud/
I deployed my spring cloud application in docker,include eureka server,zuul,eureka client. I want to access eureka client via zuul.
Zuul and eureka client are registered at eureka server.I access each application ,it is work. When I access eureka client via zuul, zuul console infomation show java.net.NoRouteToHostException. I don't know why and how to deal with this problem.
Eureka server config is like this.
server:
port: 1020
spring:
application:
name: eureka-server
security:
basic:
enabled: true
user:
name: admin
password: admin
eureka:
client:
fetch-registry: true
register-with-eureka: true
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
instance:
hostname: 192.168.90.183
prefer-ip-address: true
ip-address: 192.168.90.183
server:
enable-self-preservation: false
eviction-interval-timer-in-ms: 5000
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
shutdown:
enabled: true
Zuul config is like this.
server:
port: 8088
spring:
application:
name: gateway
security:
oauth2:
management:
security:
enabled: false
endpoints:
web:
exposure:
exclude: refresh,health,info
ribbon:
ReadTimeout: 20000
SocketTimeout: 20000
zuul:
# sensitiveHeaders: "*"
routes:
tdcm-linyi:
path: /371300/**
serviceId: tdcm
ratelimit:
key-prefix: your-prefix
enabled: true
behind-proxy: true
default-policy:
limit: 100
quota: 1000
refresh-interval: 60
type:
- user
- origin
- url
host:
connect-timeout-millis: 20000
socket-timeout-millis: 20000
#================================eureka setting==============================
eureka:
instance:
instance-id: ${eureka.instance.hostname}:${server.port}
hostname: 192.168.90.183
prefer-ip-address: true
ip-address: 192.168.90.183
lease-expiration-duration-in-seconds: 10
lease-renewal-interval-in-seconds: 5
client:
serviceUrl:
defaultZone: http://admin:admin#${EUREKA_HOST:192.168.90.183}:${EUREKA_PORT:1020}/eureka
fetch-registry: true
register-with-eureka: true
Eureka client config is like this.
spring:
application:
name: tdcm
banner:
charset: UTF-8
http:
encoding:
charset: UTF-8
enabled: true
force: true
messages:
encoding: UTF-8
mvc:
throw-exception-if-no-handler-found: true
# Server
server:
port: 8926
tomcat:
uri-encoding: UTF-8
#================================eureka settinig==============================
eureka:
instance:
instance-id: ${eureka.instance.hostname}:${server.port}
hostname: 192.168.90.183
prefer-ip-address: true
ip-address: 192.168.90.183
lease-expiration-duration-in-seconds: 10
lease-renewal-interval-in-seconds: 5
client:
serviceUrl:
defaultZone: http://admin:admin#${EUREKA_HOST:192.168.90.183}:${EUREKA_PORT:1020}/eureka
fetch-registry: true
register-with-eureka: true
My test operate is like this.
I access the zuul by http://192.168.90.183:8088 ,it works well.
I access the eureka client by http://192.168.90.183:8926/getCityCenter , it works well.
When I access the eureka client via zuul by
http://192.168.90.183:8088/371300/getCityCenter , it doesn't work.
The console show the information like this.
03-29 01:55:27.229 INFO [c.n.loadbalancer.DynamicServerListLoadBalancer] - DynamicServerListLoadBalancer for client tdcm initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=tdcm,current list of Servers=[192.168.90.183:8926],Load balancer stats=Zone stats: {defaultzone=[Zone:defaultzone; Instance count:1; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:192.168.90.183:8926; Zone:defaultZone; Total Requests:0; Successive connection failure:0; Total blackout seconds:0; Last connection made:Thu Jan 01 00:00:00 UTC 1970; First connection made: Thu Jan 01 00:00:00 UTC 1970; Active Connections:0; total failure count in last (1000) msecs:0; average resp time:0.0; 90 percentile resp time:0.0; 95 percentile resp time:0.0; min resp time:0.0; max resp time:0.0; stddev resp time:0.0]
]}ServerList:org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList#3275110f
03-29 01:55:28.201 INFO [com.netflix.config.ChainedDynamicProperty] - Flipping property: tdcm.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
03-29 01:55:28.545 INFO [org.apache.http.impl.execchain.RetryExec] - I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://192.168.90.183:8926: No route to host (Host unreachable)
03-29 01:55:28.546 INFO [org.apache.http.impl.execchain.RetryExec] - I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://192.168.90.183:8926: No route to host (Host unreachable)
03-29 01:55:28.546 INFO [org.apache.http.impl.execchain.RetryExec] - Retrying request to {}->http://192.168.90.183:8926
03-29 01:55:28.546 INFO [org.apache.http.impl.execchain.RetryExec] - Retrying request to {}->http://192.168.90.183:8926
03-29 01:55:28.547 INFO [org.apache.http.impl.execchain.RetryExec] - I/O exception (java.net.NoRouteToHostException) caught when processing request to {}->http://192.168.90.183:8926: No route to host (Host unreachable)
03-29 01:55:28.548 INFO [org.apache.http.impl.execchain.RetryExec] - Retrying request to {}->http://192.168.90.183:8926
03-29 01:55:28.555 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:28.556 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
03-29 01:55:29.549 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:29.550 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
03-29 01:55:29.550 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:29.551 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
03-29 01:55:29.549 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:29.552 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
03-29 01:55:37.508 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:37.510 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
03-29 01:55:39.031 ERROR [c.t.gateway.component.exception.ProducerFallback] - s:tdcm
03-29 01:55:39.033 ERROR [c.t.gateway.component.exception.ProducerFallback] - exception: null
It seems the zuul can't find the router to eureka client of tdcm.
I tried to deployed all application on computer,include eureka server,zuul,eureka client,not in docker. The same config as this article descript,it works well. I don't know why it isn't work when access the eureka client via zuul in docker deployed.
I use the host computer IP address for spring cloud appliction.
My docker version is 17.12.1-ce.
My spring cloud version is Finchley.SR1.
My Spring boot version is 2.0.3.RELEASE.
My host computer is cent-os 7.
How can I deal with the problem?
I know the problem how to dealing.Eureka client config delete the yml value of ip-address.
eureka:
instance:
ip-address: 192.168.90.183
The reason is eureka client config in the inner network of docker.It can access from zuul through inner network of docker.
All static resources return GET http://www.gogogo.com:8888/js/jquery/2.0.0/jquery.min.js net::ERR_ABORTED 404
and then cannot go to the main page without port number.
I uploaded the spring-boot jar file to Google Cloud server (centos7)
and followed the instruction to set all environment include Nginx. The website is available to open use www.gogogo.com:8888 or port number 8080 but no CSS/JS.
I think the problem is the server didn't go to the correct place to find static resources and after a lot of search on google. I still can't fix the problem. The web on my local page works well and the direction is shown on chrome like "localhost:8888/js". All the static resources are under the webapp file.
This is how I link JS in HTML: <script src="js/jquery/2.0.0/jquery.min.js"></script>
The address in the project is gogogo/src/main/webapp/js.
include /etc/nginx/conf.d/*.conf;
server {
listen 8080 default_server;
listen [::]:8080 default_server;
server_name www.gogogo.com;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location ~ .*\.(js|css|img|jpg|svg|gif|png|bmp|swf|ttf|woff|svg|map|eot)$ {
root /gogogo/;
}
location / {
proxy_pass http://127.0.0.1:8888;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
Another problem is I cannot connect to the website using www.gogogo.com directly.
//////////////////error log///////////////////////////////
"Same Url as before" == www.gogogo.com
2019/02/10 14:23:46 [error] 23153#0: *26 open() "/gogogo/css/nav.css" failed (2: No such file or directory), cl
ient: 31.205.233.115, server: www.gogogo.com, request: "GET /css/nav.css HTTP/1.1", host: "www.gogogo.com:8080", referrer: "http://"www.gogogo.com:8080/home"
2019/02/10 14:23:46 [error] 23153#0: *27 open() "/gogogo/js/moment/2.22.2/moment.js" failed (2: No such file or
directory), client: 31.205.233.115, server: "Same Url as before", request: "GET /js/moment/2.22.2/moment.js HTTP/1.1
", host: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:23:46 [error] 23153#0: *17 open() "/gogogo/css/home.css" failed (2: No such file or directory), c
lient: 31.205.233.115, server: "Same Url as before", request: "GET /css/home.css HTTP/1.1", host: ""Same Url as before"
:8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:23:46 [error] 23153#0: *20 open() "/gogogo/img/utility/white.png" failed (2: No such file or dire
ctory), client: 31.205.233.115, server: "Same Url as before", request: "GET /img/utility/white.png HTTP/1.1", host: "
"Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:23:53 [notice] 23259#0: signal process started
2019/02/10 14:24:06 [error] 23264#0: *2 open() "/gogogo/js/jquery/2.0.0/jquery.min.js" failed (2: No such file
or directory), client: 31.205.233.115, server: "Same Url as before", request: "GET /js/jquery/2.0.0/jquery.min.js HTT
P/1.1", host: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:06 [error] 23264#0: *3 open() "/gogogo/js/vue/2.5.16/vue.min.js" failed (2: No such file or di
rectory), client: 31.205.233.115, server: "Same Url as before", request: "GET /js/vue/2.5.16/vue.min.js HTTP/1.1", ho
st: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:06 [error] 23264#0: *4 open() "/gogogo/js/axios/0.17.1/axios.min.js" failed (2: No such file o
r directory), client: 31.205.233.115, server: "Same Url as before", request: "GET /js/axios/0.17.1/axios.min.js HTTP/
1.1", host: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:06 [error] 23264#0: *9 open() "/gogogo/js/moment/2.22.2/moment.js" failed (2: No such file or
directory), client: 31.205.233.115, server: "Same Url as before", request: "GET /js/moment/2.22.2/moment.js HTTP/1.1"
, host: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:06 [error] 23264#0: *10 open() "/gogogo/css/nav.css" failed (2: No such file or directory), cl
ient: 31.205.233.115, server: "Same Url as before", request: "GET /css/nav.css HTTP/1.1", host: ""Same Url as before":8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:07 [error] 23264#0: *4 open() "/gogogo/css/footer.css" failed (2: No such file or directory),
client: 31.205.233.115, server: "Same Url as before", request: "GET /css/footer.css HTTP/1.1", host: "www.gogogo.
com:8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:07 [error] 23264#0: *3 open() "/gogogo/img/utility/white.png" failed (2: No such file or direc
tory), client: 31.205.233.115, server: "Same Url as before", request: "GET /img/utility/white.png HTTP/1.1", host: "w
ww.gogogo.com:8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:07 [error] 23264#0: *2 open() "/gogogo/css/home.css" failed (2: No such file or directory), cl
ient: 31.205.233.115, server: "Same Url as before", request: "GET /css/home.css HTTP/1.1", host: ""Same Url as before":
8080", referrer: "http://"Same Url as before":8080/home"
2019/02/10 14:24:07 [error] 23264#0: *1 open() "/gogogo/img/utility/white.png" failed (2: No such file or direc
tory), client: 31.205.233.115, server: "Same Url as before", request: "GET /img/utility/white.png HTTP/1.1", host: "w
ww.gogogo.com:8080", referrer: "http://"Same Url as before":8080/home"
Good evening. I've been having some trouble setting PHPMailer on my CI project. The thing is, after a lot of reading, I thought everything was settled, but no.
I'm calling the folder, outside any class, as soon as I open the php tag on my controller:
require './vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
Then, inside my public function, I'm doing the following:
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 5;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->AuthType = 'XOAUTH2';
$mail->Username = "username";
$mail->Password = "password";
// Content //
$mail->setFrom('somemail#gmail.com');
$mail->AddReplyTo('somemail#gmail.com');
$mail->addAddress('someanothermail#gmail.com', 'Contacto');
$mail->Subject = 'This is the subject';
$mail->Body = 'This is the message';
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Awesome sauce!";
}
So, here's what the debugger says:
2017-11-28 14:24:37 Connection: opening to smtp.gmail.com:587, timeout=300, options=array()
2017-11-28 14:24:38 Connection: opened
2017-11-28 14:24:38 SMTP INBOUND: "220 smtp.gmail.com ESMTP d15sm21670245qkc.26 - gsmtp"
2017-11-28 14:24:38 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP d15sm21670245qkc.26 - gsmtp
2017-11-28 14:24:38 CLIENT -> SERVER: EHLO localhost
2017-11-28 14:24:38 SMTP INBOUND: "250-smtp.gmail.com at your service, [190.104.220.99]"
2017-11-28 14:24:38 SMTP INBOUND: "250-SIZE 35882577"
2017-11-28 14:24:38 SMTP INBOUND: "250-8BITMIME"
2017-11-28 14:24:38 SMTP INBOUND: "250-STARTTLS"
2017-11-28 14:24:38 SMTP INBOUND: "250-ENHANCEDSTATUSCODES"
2017-11-28 14:24:38 SMTP INBOUND: "250-PIPELINING"
2017-11-28 14:24:38 SMTP INBOUND: "250-CHUNKING"
2017-11-28 14:24:38 SMTP INBOUND: "250 SMTPUTF8"
2017-11-28 14:24:38 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [190.104.220.99]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8
2017-11-28 14:24:38 CLIENT -> SERVER: STARTTLS
2017-11-28 14:24:39 SMTP INBOUND: "220 2.0.0 Ready to start TLS"
2017-11-28 14:24:39 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
2017-11-28 14:24:39 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed [C:\xampp\htdocs\crm\vendor\phpmailer\phpmailer\src\SMTP.php line 403]
SMTP Error: Could not connect to SMTP host.
2017-11-28 14:24:39 CLIENT -> SERVER: QUIT
2017-11-28 14:24:39
2017-11-28 14:24:39
2017-11-28 14:24:39
2017-11-28 14:24:39 Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Any suggestions?