• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cannot Configure MongoDB Datasource

New Here ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

ColdFusion 2023 Licensed Standard Edition (also tried on Enterprise Edition trial).

 

We have a MongoDB NoSQL Database we wish to access from ColdFusion. We have a known-good connection string to the database which we can use with NoSQLBooster and MongoDBCompass on the server. What I cannot get to work is the datasource in ColdFusion. I can configure a datasource using 3rd party JDBC drivers, but these come with a hefty annual fee. ColdFusion advertises support for MongoDB, so cannot justify this unbudgeted expense.

 

In earlier versions of ColdFusion it was necessary to download and install MongoDB separately. I've attempted to follow the instructions to use cfpm.bat with the 'install cfmongodb' command but the server responds with 'cfmongodb (2023.0.05.330608) package is already installed'. Support for MongoDB appears to be present.

 

The message returned by CF Admin NoSQL Datasources is:

  • Data source could not be verified. Unable to connect to the MongoDB datasource with host hkcc-pro<snip>/, port 27017. To connect successfully, enter a valid host and port

 

The hostname is the same as we use with NoSQLBooster and MongoDBCompas.

 

 

Can anyone provide guidance on how to get a MongoDB database configured in CF 2023?

 

 

TOPICS
Database access

Views

395

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

First, when you say those two query tools work fine, are you running them on the same machine that's running cf? If not, you may find they'd fail also (if installed there), which would seem to indicate a firewall/network config issue on either end: either the db server/service not allowing the call in from the cf machine, or the cf machine/network config not allowing the call out to that db host or port.

 

Even if you don't want to/can't install those tools, there are other ways you could simply check the port connectivity from the the cf machine (without installing those query tools), such as using old school telnet or other options I offer in a blog post on alternatives to that.

 

Let us know if those get you going, or not. 

 

Finally, FWIW, while the cfpm tool is indeed one way to view or change CF's packages, note that you can also do that from within the cf admin. It's at the bottom of the same page used for applying cf updates. (You didn't mention it, so I just want to make sure you or other readers are aware.)


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

Hi Charlie. Thank you for your suggestions.

 

Yes, the tools run successfully on the server where ColdFusion 2023 Enterprise Trial is running. See attachment beginning 01. (the tools also run successfully on another server with licensed ColdFusion 2023 Standard).

 

Test-NetConnection tests to all 3 hosts in the MongoDB SRV record are successful. See attachment beginning 12.

 

Noted your comment about using the CF admin interface in place of cfpm.

 

Thanks again for your reply.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

The most likely problem, I think, is DNS name resolution failure. I recommend trying with the IP address instead of the hostname, or putting the name and address in your hosts file.

 

Dave Watts, Eidolon LLC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

FWIW, they had noted, "The hostname is the same as we use with NoSQLBooster and MongoDBCompas".  But if you may be proposing the dns lookup on the server may be a different result, it's possible. The diagnostics I proposed might tell us either way. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

I don't know what kind of server registration if any exists in those tools, but chances are you're correct.

 

Dave Watts, Eidolon LLC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 02, 2024 Jan 02, 2024

Copy link to clipboard

Copied

LATEST

Dave and Charlie:

 

If I use CData's JDBC MongoDB driver with the same connection string, the data source connection is successful. See attachments beginning 02 and 03.

 

Connection details as shown by NoSQLBooster are in attachment beginning 04.

 

DNS lookups for SRV, TXT, A and PTR records for the hosts are shown in attachments beginning 07 and 08.

 

If I replace the DNS name with a specific host IP address (with and without a Replica Set Name defined), the connection tests also fail. See attachments beginning 09, 10 and 11.

 

Thanks in advance for any further ideas you may have on this.

 

Rob

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation