Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction numbers are only allowed on a replica set member or mongos #1874

Closed
jeremiarm opened this issue Nov 17, 2019 · 3 comments
Closed

Comments

@jeremiarm
Copy link

jeremiarm commented Nov 17, 2019

Hello
so i create a simple CRUD with env and database config just like the guide. I can do READ, Update, and Delete but getting this error(of the title) when do INSERT with ->save().

this is the config/database.php

'mongodb' => [
'driver' => 'mongodb',
'host' => env('DB_HOST', '192.168.16.53'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'options' => [
'database' => 'admin',
]
],

and the .env

DB_CONNECTION=mongodb
DB_HOST=192.168.16.53
DB_PORT=27017
DB_DATABASE=shoes
DB_USERNAME=mongo-admin
DB_PASSWORD=password

i am using vagrant server for mongodb, and following https://www.linode.com/docs/databases/mongodb/build-database-clusters-with-mongodb/ tutorial for database clustering. only create not working, update read delete works

@masitings
Copy link

i got the same issue when trying to queue a lot of files. Does anyone have a clue about this ?
image

@alcaeus
Copy link
Member

alcaeus commented Sep 13, 2023

This error occurs if you are using transactions or retryable writes on a standalone server. From the trace excerpt you screenshotted, I can see a find operation being involved, so my guess would be on transactions.

However, there is not enough information to help you with this problem. If you'd like for us to help you investigate this, please create a new issue including information about the versions of this library and the MongoDB driver being used, version and topology of the MongoDB deployment you are connecting to, and the full trace of the error. Without this information, there's nothing we can do.

@masitings
Copy link

This error occurs if you are using transactions or retryable writes on a standalone server. From the trace excerpt you screenshotted, I can see a find operation being involved, so my guess would be on transactions.

However, there is not enough information to help you with this problem. If you'd like for us to help you investigate this, please create a new issue including information about the versions of this library and the MongoDB driver being used, version and topology of the MongoDB deployment you are connecting to, and the full trace of the error. Without this information, there's nothing we can do.

But it really strange tho, im not evolving any find operation in this but in this case im using Laravel Excel to do the jobs, so i think it must be somewhere in there. Well thanks a lot for the reply. I think im good enough knowing this so no need to create a new issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants