Reputation: 1
When we configure the data service with the mongoDB, and we try to execute an operation for the collection as follows. We are getting the below error.
<query id="mongoinsert" useConfig="MongoDB">
<expression>TestCollection1.subcollection1.insert("{_id:#, name:#}")</expression>
<param name="_id" paramType="SCALAR" sqlType="INTEGER" type="IN" optional="false" />
<param name="name" paramType="SCALAR" sqlType="STRING" type="IN" optional="false" />
</query>
Error Logs:
`[2024-05-08 08:43:18,265] [EI-Core] ERROR - DBInOnlyMessageReceiver Error in in-only message receiver DS Fault Message: Error in DS non result invoke. DS Code: UNKNOWN_ERROR Nested Exception:- javax.xml.stream.XMLStreamException: DS Fault Message: Error in MongoQuery.runQuery: DS Fault Message: Unknown MongoDB operation 'subcollection1.insert' DS Code: UNKNOWN_ERROR
DS Code: UNKNOWN_ERROR Source Data Service:- Name: MongoDB Location: /home/wso2/INTEGRATION_SUPPORT/SUPPORT_TICKETS/ARCANAJAZZSUB-792/SETUPS/wso2ei-6.5.0/wso2/tmp/carbonapps/-1234/1715137972863SampleRestDataService1CompositeExporter_1.0.0-SNAPSHOT.car/MongoDB_1.0.0/MongoDB-1.0.0.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: _postinsert Current Params: {name=Shavindu1, id=1} Nested Exception:- DS Fault Message: Unknown MongoDB operation 'subcollection1.insert' DS Code: UNKNOWN_ERROR
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:118)
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processRequest(SingleDataServiceRequest.java:67)
at org.wso2.carbon.dataservices.core.dispatch.DataServiceRequest.dispatch(DataServiceRequest.java:359)
at org.wso2.carbon.dataservices.core.DataServiceProcessor.dispatch(DataServiceProcessor.java:41)
at org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:53)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:338)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:383)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:152)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in MongoQuery.runQuery: DS Fault Message: Unknown MongoDB operation 'subcollection1.insert'`
Attempting to connect to MongoDB, but encountering authentication mechanism failure. Below is the configuration:
<config id="MongoDB">
<property name="mongoDB_servers">127.0.0.1:27017</property>
<property name="mongoDB_database">TestDatabase</property>
<property name="mongoDB_authentication_type">SCRAM-SHA-1</property>
<property name="username">myadmin2</property>
<property name="password">myadmin2</property>
<property name="mongoDB_ssl_enabled">false</property>
<property name="mongoDB_auth_source">ConsumerDatabase</property>
</config>
When mongoDB_authentication_type is set to SCRAM-SHA-1, an authentication mechanism error occurs. However, if mongoDB_authentication_type is set to SCRAM-SHA-256, MongoDB version 6.0.6 supports it, but WSO2 EI (6.5.0) does not. Expecting to connect to MongoDB version 6.0.6 with WSO2 EI (6.5.0) data service.
Additionally, attempted to include mongoDB_auth_source and mongoDB_ssl_enabled properties in the configuration:
<config enableOData="false" id="MongoDB">
<property name="mongoDB_servers">mongodb.domain.com</property>
<property name="mongoDB_database">accountmanagement</property>
<property name="mongoDB_authentication_type">SCRAM-SHA-1</property>
<property name="username">username</property>
<property name="password">pass123</property>
<property name="mongoDB_ssl_enabled">false</property>
<property name="mongoDB_auth_source">TestDatabase</property>
<property name="mongoDB_read_preference">PRIMARY</property>
</config>
Expected to successfully connect with MongoDB 6.0.6 using WSO2 6.5.0.
Upvotes: 0
Views: 35