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

Upgrade mongodb to 4.2.1 #85

Closed
pawan-regoti opened this issue Oct 25, 2019 · 3 comments
Closed

Upgrade mongodb to 4.2.1 #85

pawan-regoti opened this issue Oct 25, 2019 · 3 comments

Comments

@pawan-regoti
Copy link

pawan-regoti commented Oct 25, 2019

Currently, I am getting following error while using mongo2go:

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

Usage:
 var mongoCollection = GetDeliveryNoteCollection(connection.MongoConnection);
 var notesFromSession = mongoCollection.Aggregate(connection.MongoSession)
						.Match(note => note.Id == Id)
						.ToList();

Exception:
MongoDB.Driver.MongoCommandException
  HResult=0x80131500
  Message=This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.
  Source=MongoDB.Driver.Core
  StackTrace:
   at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage)
   at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol[TResult](IWireProtocol`1 protocol, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command[TResult](ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable`1 commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action`1 postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer`1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.CommandOperationBase`1.ExecuteProtocol(IChannelHandle channel, ICoreSessionHandle session, ReadPreference readPreference, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.ReadCommandOperation`1.ExecuteAttempt(RetryableReadContext context, Int32 attempt, Nullable`1 transactionNumber, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.RetryableReadOperationExecutor.Execute[TResult](IRetryableReadOperation`1 operation, RetryableReadContext context, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.ReadCommandOperation`1.Execute(RetryableReadContext context, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.AggregateOperation`1.Execute(RetryableReadContext context, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Operations.AggregateOperation`1.Execute(IReadBinding binding, CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.ExecuteReadOperation[TResult](IReadBinding binding, IReadOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IClientSessionHandle session, IReadOperation`1 operation, ReadPreference readPreference, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.ExecuteReadOperation[TResult](IClientSessionHandle session, IReadOperation`1 operation, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.Aggregate[TResult](IClientSessionHandle session, PipelineDefinition`2 pipeline, AggregateOptions options, CancellationToken cancellationToken)
   at MongoDB.Driver.CollectionAggregateFluent`2.ToCursor(CancellationToken cancellationToken)
   at MongoDB.Driver.IAsyncCursorSourceExtensions.ToList[TDocument](IAsyncCursorSource`1 source, CancellationToken cancellationToken)
   at Reviso.DeliveryNote.Dal.Repositories.DeliveryNoteRepository.<>c__DisplayClass7_0.<GetAll>b__0() in C:\src\delivery-note-app\server\Reviso.DeliveryNote.Dal\Repositories\DeliveryNoteRepository.cs:line 56
   at Polly.Policy.<>c__DisplayClass114_0`1.<Execute>b__0(Context ctx, CancellationToken ct)
   at Polly.Retry.RetryEngine.Implementation[TResult](Func`3 action, Context context, CancellationToken cancellationToken, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates`1 shouldRetryResultPredicates, Action`4 onRetry, Int32 permittedRetryCount, IEnumerable`1 sleepDurationsEnumerable, Func`4 sleepDurationProvider)

Inner Exception 1:
MongoCommandException: Command aggregate failed: Transaction numbers are only allowed on a replica set member or mongos.
@DR9885
Copy link

DR9885 commented Apr 29, 2020

I had a similar issue with Mongo2Go, and used this -> MongoDbRunner.Start(singleNodeReplSet: true);

@staxDB
Copy link

staxDB commented May 6, 2020

I would be very happy if the MongoDB version would be updated. There are some new aggregation pipeline stages that I would like to use: https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/

@JohannesHoppe
Copy link
Member

#77 (comment) 🙂👍

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

4 participants