SaiUpadhyayula / spring-boot-microservices

This repository contains the latest source code of th spring-boot-microservices tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ProductServiceApplicationTests fails to read from mongodb container

tylerdelamater opened this issue · comments

Platform: Debian linux
Java version: 17

Was following along the youtube video. Figured it was my mistake, so i cloned this repo got the same error. Googling didn't return much a couple tips that it might be an SSL error.

23-01-27 18:49:10.938  INFO [product-service,,] 3582446 --- [           main] org.mongodb.driver.connection            : Opened connection [connectionId{localValue:3, serverValue:5}] to localhost:32783
2023-01-27 18:49:11.411  INFO [product-service,,] 3582446 --- [localhost:32783] org.mongodb.driver.cluster               : Exception in monitor thread while connecting to server localhost:32783

com.mongodb.MongoSocketReadException: Prematurely reached end of stream
	at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:112) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.SocketStream.read(SocketStream.java:135) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:713) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.receiveMessageWithAdditionalTimeout(InternalStreamConnection.java:571) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:410) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.InternalStreamConnection.receive(InternalStreamConnection.java:369) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:221) ~[mongodb-driver-core-4.6.1.jar:na]
	at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:157) ~[mongodb-driver-core-4.6.1.jar:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

2023-01-27 18:49:11.690  INFO [product-service,,] 3582446 --- [       Thread-4] o.s.c.s.a.z.ZipkinAutoConfiguration      : Flushing remaining spans on shutdown
2023-01-27 18:49:11.694  INFO [product-service,,] 3582446 --- [ionShutdownHook] o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING
2023-01-27 18:49:11.697  INFO [product-service,,] 3582446 --- [ionShutdownHook] o.s.c.n.e.s.EurekaServiceRegistry        : Unregistering application PRODUCT-SERVICE with eureka with status DOWN

Process finished with exit code 255

Woops here's the real reason:

MockHttpServletResponse:
           Status = 201
    Error message = null
          Headers = []
     Content type = null
             Body = 
    Forwarded URL = null
   Redirected URL = null
          Cookies = []

org.opentest4j.AssertionFailedError: 
Expected :2
Actual   :1