Bug 1246153 - MongoDB metadata import fails with NPE
Summary: MongoDB metadata import fails with NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Virtualization 6
Classification: JBoss
Component: Teiid, Documentation
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.3.0
Assignee: David Le Sage
QA Contact: Filip Elias
David Le Sage
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-23 14:48 UTC by Andrej Smigala
Modified: 2016-08-11 05:04 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-08-11 05:04:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker TEIID-3589 0 Major Closed MongoDB metadata import fails with NPE 2017-09-19 07:32:42 UTC
Red Hat Issue Tracker TEIID-3715 0 Major Closed MongoDB metadata import fails 2017-09-19 07:32:42 UTC
Red Hat Issue Tracker TEIID-4218 0 Major Resolved MongoDB metadata import fails when user has insufficient permissions 2017-09-19 07:32:42 UTC

Description Andrej Smigala 2015-07-23 14:48:28 UTC
Deploying the following dynamic vdb fails with a NullPointerException:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="mongo" version="1">
	<description>Importer VDB</description>
	<property name="UseConnectorMetadata" value="true" />
	<property name="deployment-name" value="mongo-vdb.xml" />
	<model name="importVDBSrcModel">
		<source name="importVDBSrcModel" translator-name="mongodb" connection-jndi-name="java:/mongoDS" />
	</model>
</vdb>


The resource adapter is defined as:

                <resource-adapter id="mongoDS">
                    <module slot="main" id="org.jboss.teiid.resource-adapter.mongodb"/>
                    <transaction-support>NoTransaction</transaction-support>
                    <connection-definitions>
                        <connection-definition class-name="org.teiid.resource.adapter.mongodb.MongoDBManagedConnectionFactory" jndi-name="java:/mongoDS" enabled="true" use-java-context="true" pool-name="mongoDS">
                            <config-property name="Database">
                                bqt
                            </config-property>
                            <config-property name="RemoteServerList">
                                vmgdb01.mw.lab.eng.bos.redhat.com:27017
                            </config-property>
                            <config-property name="Username">
                                dv
                            </config-property>
                            <config-property name="Password">
                                dv
                            </config-property>
                        </connection-definition>
                    </connection-definitions>
                </resource-adapter>



Server log:

16:46:49,793 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "mongo-vdb.xml" (runtime-name: "mongo-vdb.xml")
16:46:49,809 DEBUG [org.teiid.RUNTIME] (MSC service thread 1-5) VDB mongo-vdb.xml has been parsed.
16:46:49,835 INFO  [org.teiid.RUNTIME] (MSC service thread 1-1) TEIID50029 VDB mongo.1 model "importVDBSrcModel" metadata is currently being loaded. Start Time: 7/23/15 4:46 PM
16:46:49,869 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015859: Deployed "mongo-vdb.xml" (runtime-name : "mongo-vdb.xml")
16:46:50,626 WARN  [org.teiid.RUNTIME] (teiid-async-threads - 3) TEIID50036 VDB mongo.1 model "importVDBSrcModel" metadata failed to load. Reason:java.lang.NullPointerException: java.lang.NullPointerException
        at org.teiid.translator.mongodb.MongoDBMetadataProcessor.addTable(MongoDBMetadataProcessor.java:92)
        at org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:57)
        at org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:38)
        at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:935) [teiid-api-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
        at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:73) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
        at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55) [teiid-engine-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
        at org.teiid.jboss.VDBService$6.run(VDBService.java:395) [teiid-jboss-integration-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
        at org.teiid.jboss.VDBService$7.run(VDBService.java:442) [teiid-jboss-integration-8.7.1.6_2-redhat-3.jar:8.7.1.6_2-redhat-3]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

Comment 2 JBoss JIRA Server 2015-07-23 19:25:29 UTC
Ramesh Reddy <rareddy> updated the status of jira TEIID-3589 to Resolved

Comment 3 Filip Elias 2015-08-12 13:08:53 UTC
This issue is not fixed in DV 6.2 ER4.

Comment 4 Van Halbert 2015-08-12 13:21:43 UTC
Any details as to what you are seeing, maybe any exceptions in the server log?

Comment 5 Filip Elias 2015-08-12 13:25:03 UTC
The exception is in the first comment.

Comment 6 JBoss JIRA Server 2015-08-12 13:32:08 UTC
Van Halbert <vhalbert> updated the status of jira TEIID-3589 to Reopened

Comment 7 JBoss JIRA Server 2015-08-12 17:07:01 UTC
Ramesh Reddy <rareddy> updated the status of jira TEIID-3589 to Resolved

Comment 8 Andrej Smigala 2015-09-04 12:41:18 UTC
The vdb deployment now fails with the following errror:

14:26:08,810 WARN  [org.teiid.RUNTIME] (teiid-async-threads - 3) TEIID50036 VDB mongo.1 model "importVDBSrcModel" metadata failed to load. Reason:not authorized for query on bqt.system.users: com.mongodb.MongoEx
ception: not authorized for query on bqt.system.users
        at com.mongodb.MongoException.parse(MongoException.java:82)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:292)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
        at com.mongodb.DBCursor._check(DBCursor.java:368)
        at com.mongodb.DBCursor._hasNext(DBCursor.java:459)
        at com.mongodb.DBCursor.hasNext(DBCursor.java:484)
        at org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:58)
        at org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:39)
        at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:935) [teiid-api-8.7.1.6_2-redhat-5.jar:8.7.1.6_2-redhat-5]
        at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:73) [teiid-engine-8.7.1.6_2-redhat-5.jar:8.7.1.6_2-redhat-5]
        at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55) [teiid-engine-8.7.1.6_2-redhat-5.jar:8.7.1.6_2-redhat-5]
        at org.teiid.jboss.VDBService$6.run(VDBService.java:395) [teiid-jboss-integration-8.7.1.6_2-redhat-5.jar:8.7.1.6_2-redhat-5]
        at org.teiid.jboss.VDBService$7.run(VDBService.java:442) [teiid-jboss-integration-8.7.1.6_2-redhat-5.jar:8.7.1.6_2-redhat-5]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
        at org.jboss.threads.JBossThread.run(JBossThread.java:122)



The user dv does not have access to the system tables, but there is no way to exclude those tables from the import (like with the JDBC importer).

Comment 9 JBoss JIRA Server 2015-09-04 12:51:36 UTC
Van Halbert <vhalbert> updated the status of jira TEIID-3589 to Reopened

Comment 11 JBoss JIRA Server 2015-09-23 18:09:30 UTC
Ramesh Reddy <rareddy> updated the status of jira TEIID-3589 to Resolved

Comment 12 Van Halbert 2015-10-26 20:35:52 UTC
As indicated by the engineers, this needs to be tested on DV 6.3 to determine the status of this BZ.

Comment 13 JBoss JIRA Server 2016-01-27 21:25:04 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3589 to Closed

Comment 14 JBoss JIRA Server 2016-02-16 20:24:13 UTC
Ramesh Reddy <rareddy> updated the status of jira TEIID-3715 to Resolved

Comment 15 Jan Stastny 2016-05-24 14:58:00 UTC
The NullpointerException issue is resolved.

The issue described in https://bugzilla.redhat.com/show_bug.cgi?id=1246153#c8 is observable in DV 6.3.0 ER3 too.

The root cause of the issue is in insufficient permissions assigned to the mongodb user used to access the mongodb database. If there's a collection which cannot be accessed by the user, metadata import would fail with mentioned message.

The resolution of this issue would require more development done, new enhancement JIRA will be created.

We need to document the fact for the time being.

Comment 17 JBoss JIRA Server 2016-06-03 22:43:32 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3715 to Closed

Comment 18 Lucie Fabrikova 2016-08-05 07:54:04 UTC
The release note does not contain info about mongodb metadata import.

Comment 19 David Le Sage 2016-08-08 05:43:09 UTC
Added to known issues in release notes.

URL:  https://access.qa.redhat.com/documentation/en/red-hat-jboss-data-virtualization/6.3/single/release-notes


Note You need to log in before you can comment on or make changes to this bug.