Comments (7)
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.
@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.
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.
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.
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.
from mongo-php-library.
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.
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)
- PHP+MongoDB: "Return value must be of type MongoDB\Driver\Server, null returned" HOT 3
- Can we drop `jean85/pretty-package-versions:1.2`? HOT 4
- Decision about `mongo-orchestration` folder and `Makefile` HOT 3
- [Documentation] Syntax highlighting in the method reference is not ideal HOT 1
- A never-ending query after upgrade to MongoDB 6.0.3 HOT 6
- Memory leak on updateOne in the loop HOT 1
- Deprecated: Return type of MongoDB\Model\BSONDocument::bsonSerialize() HOT 2
- The StreamWrapper class is currently unusable without the bucket HOT 4
- Performance issue with PHP 8.2 HOT 2
- Extract mongodb-1.6.2.tgz error HOT 1
- MacOs M1 Cannot connect to Atlas After upgrade driver HOT 7
- This is a test
- $unset not properly work on multiple field? HOT 1
- Docs: missing `]` character in database->aggregate documentation HOT 1
- Can't connect. To mongo db remote in can bost HOT 1
- Non blocking io HOT 1
- $where is not allowed in this context HOT 2
- TLS connection with mongo cluster failed (while single host works) HOT 2
- getting result from mongodb with toArray() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongo-php-library.