Open scany1211 opened 4 years ago
Hi @scany1211, SiteWhere 2.x uses Istio to create a service mesh. You need to connect to Istio Ingress Gateway and not to expose web-rest service.
Hi @scany1211, SiteWhere 2.x uses Istio to create a service mesh. You need to connect to Istio Ingress Gateway and not to expose web-rest service.
hi,
Thanks for your reply, but I installed the istio-gateway and try again, got the 404 error.
[root@master2 ~]# kubectl describe virtualservice sitewhere-web-rest
Name: sitewhere-web-rest
Namespace: default
Labels: io.cattle.field/appId=sitewhere
Annotations:
The istio-gateway is running on the server as below, which has port 80 listening:
[root@rancher3 data]# netstat -anp|grep -w 80 tcp 0 0 0.0.0.0:80 0.0.0.0: LISTEN 15563/nginx: master tcp 0 0 192.168.2.28:80 192.168.1.94:53508 ESTABLISHED 20375/nginx: worker tcp6 0 0 :::80 ::: LISTEN 15563/nginx: master
So, in adminUI, I configure the connection as http://192.168.2.28:80, but give me error "default backend 404". Could you please help me? Thanks
ENV:
sitewhere 2.1
all the pod status are running as below:
I have exposed the sitewhere web-rest svc to one NodePort svc as below:
login the sitewhere admin UI with the node ip and port 32051, shows error " HTTP Status 401 Unauthorized Type Status Report
Message Unauthorized
Description The request has not been applied because it lacks valid authentication credentials for the target resource."
has checked the port in pod sitewhere-web-rest-7f6d7db47-hd49h , 8080 port is listening.
checked the sitewhere-web-rest-7f6d7db47-hd49h pod log via kubectl logs sitewhere-web-rest-7f6d7db47-hd49h -c sitewhere-web-rest, shows error as below:
com.sitewhere.spi.microservice.ServiceNotAvailableException: The requested service is not available [UNAVAILABLE: upstream connect error or disconnect/reset before headers. reset reason: connection failure] at com.sitewhere.grpc.client.GrpcUtils.handleClientMethodException(GrpcUtils.java:225) ~[sitewhere-grpc-client-2.1.1.jar!/:na] at com.sitewhere.grpc.client.user.UserManagementApiChannel.authenticate(UserManagementApiChannel.java:150) ~[sitewhere-grpc-client-2.1.1.jar!/:na] at com.sitewhere.grpc.client.user.CachedUserManagementApiChannel.authenticate(CachedUserManagementApiChannel.java:145) ~[sitewhere-grpc-client-2.1.1.jar!/:na] at com.sitewhere.web.security.SiteWhereAuthenticationProvider.authenticateBasicAuth(SiteWhereAuthenticationProvider.java:86) [classes!/:na] at com.sitewhere.web.security.SiteWhereAuthenticationProvider.authenticate(SiteWhereAuthenticationProvider.java:58) [classes!/:na] at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) [spring-security-core-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:199) [spring-security-core-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:180) [spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.4.RELEASE.jar!/:5.0.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.0.3.RELEASE.jar!/:5.0.3.RELEASE] @
2020-08-04 07:12:00.676 DEBUG 1 --- [-worker-ELG-3-2] i.g.n.NettyServerTransport.connections : Transport failed
java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.8.0_212] at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.8.0_212] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_212] at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_212] at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_212] at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) ~[netty-buffer-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1125) ~[netty-buffer-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347) ~[netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148) ~[netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677) [netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612) [netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529) [netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491) [netty-transport-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [netty-common-4.1.34.Final.jar!/:4.1.34.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.34.Final.jar!/:4.1.34.Final] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]