Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not run in cloud CI. #61

Open
michaelmosmann opened this issue Sep 14, 2024 · 1 comment
Open

Does not run in cloud CI. #61

michaelmosmann opened this issue Sep 14, 2024 · 1 comment

Comments

@michaelmosmann
Copy link
Member

          @michaelmosmann, I'm facing a problem during my cloud CI.

Locally the tests work very well, but in the cloud I get some errors.

de.flapdoodle.embed.mongo.spring30x: 4.11.0
Spring Boot: v3.2.2
JDK 21

.   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.2)

2024-09-12 15:00:27.450  INFO  [main] Starting LimitChangeRepositoryTest using Java 21.0.4 with PID 133 (started by root in /workspace/output)
2024-09-12 15:00:27.452  INFO  [main] No active profile set, falling back to 1 default profile: "default"
2024-09-12 15:00:27.826  INFO  [main] Bootstrapping Spring Data MongoDB repositories in DEFAULT mode.
2024-09-12 15:00:28.020  INFO  [main] Finished Spring Data repository scanning in 187 ms. Found 1 MongoDB repository interface.
2024-09-12 15:00:28.397  INFO  [main] MongoClient with metadata {"driver": {"name": "mongo-java-driver|sync|spring-boot", "version": "4.11.1"}, "os": {"type": "Linux", "name": "Linux", "architecture": "amd64", "version": "5.10.223-211.872.amzn2.x86_64"}, "platform": "Java/Eclipse Adoptium/21.0.4+7-LTS"} created with settings MongoClientSettings{readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=null, transportSettings=null, streamFactoryFactory=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, CollectionCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.client.model.mql.ExpressionCodecProvider@19e884a2, com.mongodb.Jep395RecordCodecProvider@6795c28a, com.mongodb.KotlinCodecProvider@55633015]}, loggerSettings=LoggerSettings{maxDocumentLength=1000}, clusterSettings={hosts=[localhost:27017], srvServiceName=mongodb, mode=SINGLE, requiredClusterType=UNKNOWN, requiredReplicaSetName='null', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='15 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, proxySettings=ProxySettings{host=null, port=null, username=null, password=null}}, connectionPoolSettings=ConnectionPoolSettings{maxSize=100, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=false, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=JAVA_LEGACY, serverApi=null, autoEncryptionSettings=null, dnsClient=null, inetAddressResolver=null, contextProvider=null}
2024-09-12 15:00:28.398  INFO  [cluster-ClusterId{value='66e3020c0546c8407ee46110', description='null'}-localhost:27017] Exception in monitor thread while connecting to server localhost:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.internal.connection.SocketStream.lambda$open$0([SocketStream.java:84](http://socketstream.java:84/))
at java.base/java.util.Optional.orElseThrow([Optional.java:403](http://optional.java:403/))
at [com.mongodb.internal.connection.SocketStream.open]([http://com.mongodb.internal.connection.socketstream.open/)([SocketStream.java:84](http://socketstream.java:84/)](http://com.mongodb.internal.connection.socketstream.open/)(%5BSocketStream.java:84%5D(http://socketstream.java:84/)))
at [com.mongodb.internal.connection.InternalStreamConnection.open]([http://com.mongodb.internal.connection.internalstreamconnection.open/)([InternalStreamConnection.java:211](http://internalstreamconnection.java:211/)](http://com.mongodb.internal.connection.internalstreamconnection.open/)(%5BInternalStreamConnection.java:211%5D(http://internalstreamconnection.java:211/)))
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription([DefaultServerMonitor.java:196](http://defaultservermonitor.java:196/))
at [com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run](http://com.mongodb.internal.connection.defaultservermonitor/$servermonitorrunnable.run/)([DefaultServerMonitor.java:156](http://defaultservermonitor.java:156/))
at java.base/java.lang.Thread.run([Thread.java:1583](http://thread.java:1583/))
Caused by: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow([Net.java:682](http://net.java:682/))
at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect([NioSocketImpl.java:542](http://niosocketimpl.java:542/))
at java.base/sun.nio.ch.NioSocketImpl.connect([NioSocketImpl.java:592](http://niosocketimpl.java:592/))
at java.base/java.net.SocksSocketImpl.connect([SocksSocketImpl.java:327](http://sockssocketimpl.java:327/))
at java.base/java.net.Socket.connect([Socket.java:751](http://socket.java:751/))
at com.mongodb.internal.connection.SocketStreamHelper.initialize([SocketStreamHelper.java:76](http://socketstreamhelper.java:76/))
at com.mongodb.internal.connection.SocketStream.initializeSocket([SocketStream.java:104](http://socketstream.java:104/))
at [com.mongodb.internal.connection.SocketStream.open]([http://com.mongodb.internal.connection.socketstream.open/)([SocketStream.java:78](http://socketstream.java:78/)](http://com.mongodb.internal.connection.socketstream.open/)(%5BSocketStream.java:78%5D(http://socketstream.java:78/)))
... 4 common frames omitted
2024-09-12 15:00:28.826  INFO  [main] Started LimitChangeRepositoryTest in 1.879 seconds (process running for 6.037)
2024-09-12 15:00:28.894  INFO  [main] No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]}. Waiting for 30000 ms before timing out
2024-09-12 15:00:58.908  INFO  [main] No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]}. Waiting for 30000 ms before timing out
2024-09-12 15:01:28.914  INFO  [main] No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]}. Waiting for 30000 ms before timing out
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 92.21 s <<< FAILURE! -- in com.test.dataprovider.database.repository.LimitChangeRepositoryTest
[ERROR] com.test.dataprovider.database.repository.LimitChangeRepositoryTest.findOneBySellerIdAndStatusReturnsEmptyForNonExistingSellerId -- Time elapsed: 30.07 s <<< ERROR!
org.springframework.dao.DataAccessResourceFailureException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible([MongoExceptionTranslator.java:88](http://mongoexceptiontranslator.java:88/))
at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException([MongoTemplate.java:2993](http://mongotemplate.java:2993/))
at org.springframework.data.mongodb.core.MongoTemplate.execute([MongoTemplate.java:603](http://mongotemplate.java:603/))
at org.springframework.data.mongodb.core.MongoTemplate.doRemove([MongoTemplate.java:1812](http://mongotemplate.java:1812/))
at org.springframework.data.mongodb.core.MongoTemplate.remove([MongoTemplate.java:1778](http://mongotemplate.java:1778/))
at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.deleteAll([SimpleMongoRepository.java:212](http://simplemongorepository.java:212/))
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke([DirectMethodHandleAccessor.java:103](http://directmethodhandleaccessor.java:103/))
at java.base/java.lang.reflect.Method.invoke([Method.java:580](http://method.java:580/))
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection([AopUtils.java:351](http://aoputils.java:351/))
at org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0([RepositoryMethodInvoker.java:277](http://repositorymethodinvoker.java:277/))
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke([RepositoryMethodInvoker.java:170](http://repositorymethodinvoker.java:170/))
at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke([RepositoryMethodInvoker.java:158](http://repositorymethodinvoker.java:158/))
at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke([RepositoryComposition.java:516](http://repositorycomposition.java:516/))
at org.springframework.data.repository.core.support.RepositoryComposition.invoke([RepositoryComposition.java:285](http://repositorycomposition.java:285/))
at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke([RepositoryFactorySupport.java:628](http://repositoryfactorysupport.java:628/))
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](http://reflectivemethodinvocation.java:184/))
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke([QueryExecutorMethodInterceptor.java:168](http://queryexecutormethodinterceptor.java:168/))
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke([QueryExecutorMethodInterceptor.java:143](http://queryexecutormethodinterceptor.java:143/))
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](http://reflectivemethodinvocation.java:184/))
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke([DefaultMethodInvokingMethodInterceptor.java:70](http://defaultmethodinvokingmethodinterceptor.java:70/))
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](http://reflectivemethodinvocation.java:184/))
at org.springframework.data.mongodb.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke([CrudMethodMetadataPostProcessor.java:158](http://crudmethodmetadatapostprocessor.java:158/))
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](http://reflectivemethodinvocation.java:184/))
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke([ExposeInvocationInterceptor.java:97](http://exposeinvocationinterceptor.java:97/))
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed([ReflectiveMethodInvocation.java:184](http://reflectivemethodinvocation.java:184/))
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke([JdkDynamicAopProxy.java:220](http://jdkdynamicaopproxy.java:220/))
at jdk.proxy2/jdk.proxy2.$Proxy126.deleteAll(Unknown Source)
at com.test.dataprovider.database.repository.LimitChangeRepositoryTest.setUp([LimitChangeRepositoryTest.java:33](http://limitchangerepositorytest.java:33/))
at java.base/java.lang.reflect.Method.invoke([Method.java:580](http://method.java:580/))
at java.base/java.util.ArrayList.forEach([ArrayList.java:1596](http://arraylist.java:1596/))
at java.base/java.util.ArrayList.forEach([ArrayList.java:1596](http://arraylist.java:1596/))
Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]
at com.mongodb.internal.connection.BaseCluster.createTimeoutException([BaseCluster.java:380](http://basecluster.java:380/))
at com.mongodb.internal.connection.BaseCluster.selectServer([BaseCluster.java:125](http://basecluster.java:125/))
at com.mongodb.internal.connection.SingleServerCluster.selectServer([SingleServerCluster.java:46](http://singleservercluster.java:46/))
at com.mongodb.internal.binding.ClusterBinding.getWriteConnectionSource([ClusterBinding.java:134](http://clusterbinding.java:134/))
at com.mongodb.client.internal.ClientSessionBinding.getConnectionSource([ClientSessionBinding.java:128](http://clientsessionbinding.java:128/))
at com.mongodb.client.internal.ClientSessionBinding.getWriteConnectionSource([ClientSessionBinding.java:102](http://clientsessionbinding.java:102/))
at com.mongodb.internal.operation.SyncOperationHelper.withSuppliedResource([SyncOperationHelper.java:144](http://syncoperationhelper.java:144/))
at com.mongodb.internal.operation.SyncOperationHelper.withSourceAndConnection([SyncOperationHelper.java:125](http://syncoperationhelper.java:125/))
at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$execute$3([MixedBulkWriteOperation.java:188](http://mixedbulkwriteoperation.java:188/))
at com.mongodb.internal.operation.MixedBulkWriteOperation.lambda$decorateWriteWithRetries$0([MixedBulkWriteOperation.java:146](http://mixedbulkwriteoperation.java:146/))
at com.mongodb.internal.async.function.RetryingSyncSupplier.get([RetryingSyncSupplier.java:67](http://retryingsyncsupplier.java:67/))
at com.mongodb.internal.operation.MixedBulkWriteOperation.execute([MixedBulkWriteOperation.java:207](http://mixedbulkwriteoperation.java:207/))
at com.mongodb.internal.operation.MixedBulkWriteOperation.execute([MixedBulkWriteOperation.java:77](http://mixedbulkwriteoperation.java:77/))
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute([MongoClientDelegate.java:173](http://mongoclientdelegate.java:173/))
at com.mongodb.client.internal.MongoCollectionImpl.executeSingleWriteRequest([MongoCollectionImpl.java:1085](http://mongocollectionimpl.java:1085/))
at com.mongodb.client.internal.MongoCollectionImpl.executeDelete([MongoCollectionImpl.java:1058](http://mongocollectionimpl.java:1058/))
at com.mongodb.client.internal.MongoCollectionImpl.deleteMany([MongoCollectionImpl.java:537](http://mongocollectionimpl.java:537/))
at org.springframework.data.mongodb.core.MongoTemplate.lambda$doRemove$22([MongoTemplate.java:1841](http://mongotemplate.java:1841/))
at org.springframework.data.mongodb.core.MongoTemplate.execute([MongoTemplate.java:601](http://mongotemplate.java:601/))
... 28 more

Can you help me?

Originally posted by @rafaneri in #52 (comment)

@michaelmosmann
Copy link
Member Author

@rafaneri please use

de.flapdoodle.embed de.flapdoodle.embed.mongo.spring3x 4.16.1

But this might not be the cause of your problems.. Is this the full stack trace/log? I can not see any logging for starting the mongodb? Do you have any slf4j-logging adapter to your prefered logging implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant