flapdoodle-oss / de.flapdoodle.embed.mongo.spring

embedded mongo spring integration
Apache License 2.0
32 stars 7 forks source link

Tests working locally but not on GHA #52

Closed patriciayogi closed 3 months ago

patriciayogi commented 4 months ago

Tests are failing on Mongod.start(V5_0_2); after migration of Java and Springboot:

de.flapdoodle.embed.mongo: 4.13.1 embed Mongo version: V5_0_2 Spring Boot: v3.2.5 JDK 21

2024-06-03T20:57:49.7288766Z 188429 [INFO] Running com.samsung.knoxwsm.uemm.device.repository.UemmDeviceCustomRepositoryImplTest 2024-06-03T20:57:49.8114645Z Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts 2024-06-03T20:57:50.6135887Z 2024-06-03T20:57:50.6136570Z . ____ _ __ _ _ 2024-06-03T20:57:50.6137344Z /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ 2024-06-03T20:57:50.6137861Z ( ( )\___ | '_ | '_| | '_ \/ _ | \ \ \ \ 2024-06-03T20:57:50.6141758Z \/ _)| |)| | | | | || (| | ) ) ) ) 2024-06-03T20:57:50.6143354Z ' |__| .|| ||| |\, | / / / / 2024-06-03T20:57:50.6144936Z =========|_|==============|__/=//// 2024-06-03T20:57:50.6145764Z :: Spring Boot :: (v3.2.5) 2024-06-03T20:57:50.6146157Z 2024-06-03T20:57:52.6095822Z download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz START 2024-06-03T20:57:52.9311790Z download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz 0% download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz START 2024-06-03T20:57:57.4236237Z download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz 0% 1% 2% 1% 3% 4% 5% 6% 2% 7% 8% 9% 10% 11% 12% 13% 3% 4% 5% 14% 15% 16% 17% 6% 7% 8% 9% 18% 19% 20% 21% 10% 11% 22% 12% 13% 23% 24% 25% 26% 14% 15% 16% 17% 18% 19% 27% 28% 29% 30% 31% 20% 21% 22% 23% 32% 24% 25% 26% 27% 33% 34% 35% 36% 37% 38% 39% 40% 41% 28% 29% 30% 31% 32% 42% 43% 44% 45% 46% 33% 34% 35% 36% 37% 38% 39% 47% 48% 49% 50% 51% 40% 41% 42% 52% 53% 54% 43% 44% 45% 46% 47% 55% 56% 57% 58% 59% 60% 48% 49% 50% 51% 52% 53% 54% 61% 62% 63% 64% 55% 56% 57% 65% 58% 59% 60% 61% 66% 67% 68% 69% 62% 63% 64% 65% 66% 70% 71% 72% 73% 74% 75% 76% 67% 68% 69% 70% 71% 77% 78% 72% 73% 74% 75% 76% 79% 80% 81% 82% 83% 77% 78% 79% 80% 84% 85% 86% 87% 88% 81% 82% 83% 84% 85% 89% 90% 91% 92% 93% 86% 94% 95% 87% 88% 89% 90% 96% 97% 98% 91% 92% 93% 94% 95% 99% 2024-06-03T20:57:57.4238755Z download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz DONE 2024-06-03T20:57:57.5435654Z 96% 97% 98% 99% 2024-06-03T20:57:57.5438573Z download https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-5.0.2.tgz DONE 2024-06-03T20:57:59.2289242Z 2024-06-03T20:57:59.2291776Z [mongod error]/root/.embedmongo/fileSets/543ae6f04340d5b0fc97bfdf5f6da1c56ab935879b649c3660e23c044f3a261f/mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory 2024-06-03T20:57:59.2293390Z [mongod error] 2024-06-03T20:57:59.2479171Z 2024-06-03T20:57:59.2482662Z [mongod error]/root/.embedmongo/fileSets/543ae6f04340d5b0fc97bfdf5f6da1c56ab935879b649c3660e23c044f3a261f/mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory 2024-06-03T20:57:59.2483481Z [mongod error] 2024-06-03T20:57:59.2697785Z 2024-06-03T20:57:59.2697808Z 2024-06-03T20:57:59.2697817Z 2024-06-03T20:57:59.2698471Z ============================ 2024-06-03T20:57:59.2698942Z CONDITIONS EVALUATION REPORT 2024-06-03T20:57:59.2699345Z ============================`

michaelmosmann commented 4 months ago

@patriciayogi i guess you changed also the running linux version (ubuntu?) and they moved from libcrypto 1.1 to libcrypto 3.x .. so there are two options: use a newer mongodb version which runs on your linux version or use an older linux version with support for libcrypto 1.1.

michaelmosmann commented 3 months ago

@patriciayogi i will close this issue.. reopen if needed.

rafaneri commented 3 weeks ago

@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?