Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

CRX2OAK mongodb to tarmk

Avatar

Level 1

We want to use the migrate tool to export data from AEM 6.0 with MongoDB to an AEM 6.3 instances on another site.

For that we need to export all data from the MongoDB, transfer the data to the new site and import in the new instances.

As the size is exceeding the 4GB we cannot use the package manager in crxde. In the past we also used the vlt, currently both instances are not able to communicate with each other. So we are using the crx2oak migration tool from the author server and the following command(connection string as set in AEM used):

java -jar crx2oak-1.8.6-all-in-one.jar "mongodb://CN\=Servername Author,OU\=OU NAME,O\=DOMAIN.LOCAL@PRIMARY server,Secondary server,Arbiter server/author?authMechanism\=MONGODB-X509&ssl\=true&replicaSet\=prod" /export/repository --include-path=/content/dam

and returns the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: Password can not be null when the authentication mechanism is unspecified

        at com.mongodb.MongoCredential.<init>(MongoCredential.java:286)

        at com.mongodb.MongoCredential.createCredential(MongoCredential.java:142)

        at com.mongodb.ConnectionString.createCredentials(ConnectionString.java:519)

        at com.mongodb.ConnectionString.<init>(ConnectionString.java:311)

        at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:201)

        at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:183)

        at org.apache.jackrabbit.oak.upgrade.cli.node.MongoFactory.<init>(MongoFactory.java:44)

        at org.apache.jackrabbit.oak.upgrade.cli.parser.StoreType$5.createFactory(StoreType.java:114)

        at org.apache.jackrabbit.oak.upgrade.cli.parser.StoreArguments$StoreDescriptor.getFactory(StoreArguments.java:254)

        at org.apache.jackrabbit.oak.upgrade.cli.parser.StoreArguments.srcUsesEmbeddedDatastore(StoreArguments.java:113)

        at com.adobe.granite.crx2oak.oak.OakUtils.updateSecondaryHeavyOakTopics(OakUtils.java:60)

        at com.adobe.granite.crx2oak.oak.OakUtils.updateAllOakTopics(OakUtils.java:41)

        at com.adobe.granite.crx2oak.core.MigrationSpecGenerator.preprocess(MigrationSpecGenerator.java:48)

        at com.adobe.granite.crx2oak.pipeline.InputAggregatingComponent.process(InputAggregatingComponent.java:38)

        at com.adobe.granite.crx2oak.pipeline.Pipeline.run(Pipeline.java:103)

        at com.adobe.granite.crx2oak.CRX2Oak.run(CRX2Oak.java:66)

        at com.adobe.granite.crx2oak.CRX2Oak.main(CRX2Oak.java:51)

We are not using password authentication but certificates i guess we need to give the certificates as a parameter?

Unfortunately I couldn't identify the proper documentation on this for so far hoping somebody can direct me in the right direction.

Other suggestions are also welcome.

2 Replies

Avatar

Level 1

Hi smacdonald2008,

Yes i have looked at that page. Using the command on that page to connect to the mongodb it fails. I expect we need to give authentication parameters.

We are getting the error: com.mongodb.MongoSocketReadException: Prematurely reached end of stream

Full error:

# java -jar crx2oak-1.8.6-all-in-one.jar "mongodb://PRIMARY server/author?replicaset=prod" /export/repository --include-path=/content/dam

10.12.2018 09:36:09.792 INFO   c.a.g.c.CRX2Oak: started with args: [mongodb://PRIMARY server/author?replicaset=prod, /export/repository, --include-path=/content/dam]

10.12.2018 09:36:09.909 INFO   c.a.g.c.c.VersionPrinter: CRX2Oak version: 1.8.6 (STANDALONE mode)

10.12.2018 09:36:10.282 INFO   c.a.g.c.c.VersionPrinter: crx2oak-1.8.6-all-in-one.jar (version: 1.8, checksum: c326e9150ba060ad89aa84f817ea3e501615d4d26354ae2e41adac992a7154284940e470beef28457f56d75220b879f41ae6e5168f838bb545fdc9e9e7eaa8f8)

10.12.2018 09:36:10.299 INFO   c.a.g.c.p.ProfileHandler: Applying partly the command line (before loading a profile): [mongodb://PRIMARY server/author?replicaset=prod, /export/repository, --include-path=/content/dam]

10.12.2018 09:36:10.301 INFO   c.a.g.c.p.ProfileHandler: The following template tags has been defined: {}

10.12.2018 09:36:10.302 INFO   c.a.g.c.p.ProfileHandler: The command line (after loading a profile): [--include-paths, /content/dam, mongodb://PRIMARY server/author?replicaset=prod, /export/repository]

10.12.2018 09:36:10.304 INFO   c.a.g.c.c.MigrationSpecGenerator: The effective command line for migration: [--include-paths, /content/dam, mongodb://PRIMARY server/author?replicaset=prod, /export/repository]

10.12.2018 09:36:10.624 INFO   o.m.d.cluster: Cluster created with settings {hosts=[PRIMARY server], mode=MULTIPLE, requiredClusterType=REPLICA_SET, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500, requiredReplicaSetName='prod'}

10.12.2018 09:36:10.624 INFO   o.m.d.cluster: Adding discovered server PRIMARY server:27017 to client view of cluster

10.12.2018 09:36:10.739 INFO   o.m.d.cluster: Exception in monitor thread while connecting to server PRIMARY server:27017

com.mongodb.MongoSocketReadException: Prematurely reached end of stream

        at com.mongodb.connection.SocketStream.read(SocketStream.java:88)

        at com.mongodb.connection.InternalStreamConnection.receiveResponseBuffers(InternalStreamConnection.java:494)

        at com.mongodb.connection.InternalStreamConnection.receiveMessage(InternalStreamConnection.java:224)

        at com.mongodb.connection.CommandHelper.receiveReply(CommandHelper.java:134)

        at com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:121)

        at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)

        at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:85)

        at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:45)

        at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:116)

        at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113)

        at java.lang.Thread.run(Thread.java:748)

10.12.2018 09:36:10.739 INFO   o.m.d.cluster: No server chosen by ReadPreferenceServerSelector{readPreference=primary} from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=PRIMARY server:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out

Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address=PRIMARY server:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadException: Prematurely reached end of stream}}]

        at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:377)

        at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:104)

        at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75)

        at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71)

        at com.mongodb.binding.ClusterBinding.getReadConnectionSource(ClusterBinding.java:63)

        at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:402)

        at com.mongodb.operation.ListCollectionsOperation.execute(ListCollectionsOperation.java:173)

        at com.mongodb.operation.ListCollectionsOperation.execute(ListCollectionsOperation.java:81)

        at com.mongodb.Mongo.execute(Mongo.java:836)

        at com.mongodb.Mongo$2.execute(Mongo.java:823)

        at com.mongodb.OperationIterable.iterator(OperationIterable.java:47)

        at com.mongodb.OperationIterable.forEach(OperationIterable.java:70)

        at com.mongodb.MappingIterable.forEach(MappingIterable.java:50)

        at com.mongodb.MappingIterable.into(MappingIterable.java:60)

        at com.mongodb.DB.getCollectionNames(DB.java:266)

        at com.mongodb.DB.collectionExists(DB.java:544)

        at org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.initBlobCollection(MongoBlobStore.java:165)

        at org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.<init>(MongoBlobStore.java:74)

        at org.apache.jackrabbit.oak.plugins.document.mongo.MongoBlobStore.<init>(MongoBlobStore.java:64)

        at org.apache.jackrabbit.oak.upgrade.cli.node.MongoFactory.hasExternalBlobReferences(MongoFactory.java:85)

        at org.apache.jackrabbit.oak.upgrade.cli.node.StoreFactory.hasExternalBlobReferences(StoreFactory.java:67)

        at org.apache.jackrabbit.oak.upgrade.cli.parser.StoreArguments.srcUsesEmbeddedDatastore(StoreArguments.java:113)

        at com.adobe.granite.crx2oak.oak.OakUtils.updateSecondaryHeavyOakTopics(OakUtils.java:60)

        at com.adobe.granite.crx2oak.oak.OakUtils.updateAllOakTopics(OakUtils.java:41)

        at com.adobe.granite.crx2oak.core.MigrationSpecGenerator.preprocess(MigrationSpecGenerator.java:48)

        at com.adobe.granite.crx2oak.pipeline.InputAggregatingComponent.process(InputAggregatingComponent.java:38)

        at com.adobe.granite.crx2oak.pipeline.Pipeline.run(Pipeline.java:103)

        at com.adobe.granite.crx2oak.CRX2Oak.run(CRX2Oak.java:66)

        at com.adobe.granite.crx2oak.CRX2Oak.main(CRX2Oak.java:51)