GithubHelp home page GithubHelp logo

Comments (7)

alcaeus avatar alcaeus commented on July 21, 2024 2

Hi @Jaimin-Devhero,

after some more trial and error I was able to reproduce the issue you mentioned. The error is indeed caused by libmongoc. I've reported the bug upstream and will provide an update once this is fixed. If you have a MongoDB Jira account you can subscribe for updates to CDRIVER-4499 to see when the upstream issue is fixed.

from mongo-php-library.

alcaeus avatar alcaeus commented on July 21, 2024

@Jaimin-Devhero it would be helpful to post the actual exception message, along with a minimal aggregation pipeline that triggers this error in 1.14. We can't take a look at this issue without this information. Please note that the bug report template suggests providing this information for this exact reason.

from mongo-php-library.

Jaimin-Devhero avatar Jaimin-Devhero commented on July 21, 2024

Hello @alcaeus

The error message and stace are given in the issue description and even the simple query like below is now working.

It's not like we face this issue in aggregation only, even a simple Find query is not working.

db.order.aggregate([])

below is our code if that would be helpful to you.

$orders = Order::raw( function ($collection) { $pipeline = []; return $collection->aggregate($pipeline); } );

from mongo-php-library.

alcaeus avatar alcaeus commented on July 21, 2024

I can see the trace for the exception, which indicates that the exception occurs when the driver is executing the aggregate command on the server. However, you did not post an exception message that would help pinpoint the issue.

As for find not working, please note that the code you posted above does not run find, but rather aggregate. You can test a find query by calling Order::all or Order::find. To figure out whether this is an issue related to the driver, you should connect to your server using the shell (I recommend mongosh as the legacy mongo shell is no longer distributed with newer server versions) and try running the command that fails in the driver. If it passes in the shell there's definitely a driver issue, but an error in the shell points to something else being the problem.

Another question here: you say downgrading to driver version 1.13 works - are you referring to the version of ext-mongodb? Can you please post both versions (ext-mongodb and mongodb/mongodb) that work or don't work? I'll assume you mean ext-mongoldb, as there is no 1.14 release for mongodb/mongodb (and there won't be as we're skipping 1.14 and jumping straight to 1.15 to avoid this version number confusion in the future).

from mongo-php-library.

Jaimin-Devhero avatar Jaimin-Devhero commented on July 21, 2024

Hello @alcaeus

If we downgrade Extention ext-mongodb (pecl) to 1.13.0 then it works fine. but whenever we upgrade it to 1.14 it does not work.

We have also tried the below code, but it returns null in the response.

require 'vendor/autoload.php';
$client = new MongoDB\Client($mongodbUri);
$db = $client->bloompost;
$dbs = $client->listDatabases();
$result = $db->order->findOne([]);
var_dump($dbs);

Please find the below image for the error.

image

from mongo-php-library.

alcaeus avatar alcaeus commented on July 21, 2024

Hi @Jaimin-Devhero,

apologies for not noticing the empty error message sooner. This is indeed strange, but I wasn't able to reproduce it. However, it does point to an internal error with libmongoc returning an empty error struct, which is certainly strange.

To debug this, we'll need some more information, namely debug logs. You can use the mongodb.debug INI setting to enable that.

Using the code you posted above, here's how you can enable the debug log for the aggregate operation only:

require 'vendor/autoload.php';
$client = new MongoDB\Client($mongodbUri);
$db = $client->bloompost;

// Enable debug logging to /tmp/php-mongodb-log/ - ensure the directory exists
ini_set('mongodb.debug', '/tmp/php-mongodb-log/');

$result = $db->order->findOne([]);

// Disable debug logging
ini_set('mongodb.debug', 'off');

After running the corresponding script, you'll find a new log file in the directory specified in the first call to ini_set. Be aware that this log file may contain sensitive information (e.g. credentials)! Please ensure to redact such information before sharing the file, or reach out to me if you need to share the file in a private channel. The debug log will allow us to investigate what's happening behind the scenes to figure out where the empty error is coming from.

from mongo-php-library.

jmikola avatar jmikola commented on July 21, 2024

CDRIVER-4499, which @alcaeus referenced above, what actually a superficial issue masking a lower-level bug that prevented connections to Atlas Data Lake. That lower-level bug was reported in CDRIVER-4502 and has been fixed and released in libmongoc 1.22.2.

We just tagged 1.14.2, which includes the fix for CDRIVER-4502.

CDRIVER-4499 will be addressed in a future release.

from mongo-php-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.