migrating-ravens / RavenMigrations

A small migrations framework to help you manage your RavenDB Instance.
MIT License
53 stars 24 forks source link

Upgrading Raven Migrations throws error in Raven Client #64

Closed mfonnesbeck closed 7 months ago

mfonnesbeck commented 1 year ago

Hello,

I have been working on upgrading my project from 3.X to 5.X of Raven Client API, and when upgrading Raven Migrations on our migrations project I encounter an error thrown when I call the Run method on the Migration Runner.

I am using Raven Client 5.4.104 and Raven Migrations 4.3.0, which I need to use for my current .Net version. Any help would be appreciated.

Exception thrown : System.MissingFieldException HResult=0x80131511 Message=Field not found: 'Raven.Client.Documents.Operations.CompareExchange.CompareExchangeValue`1.Index'. Source=Raven.Migrations

StackTrace: at Raven.Migrations.MigrationRunner.SetExclusiveMigrationLock() at Raven.Migrations.MigrationRunner.Run() at EmpoweredHoa.DataMigrations.Program.RunMigrations() in C:\Projects\EmpoweredHoa.DataMigrations\Program.cs:line 48 at EmpoweredHoa.DataMigrations.Program.Main(String[] args) in C:\Projects\EmpoweredHoa.DataMigrations\Program.cs:line 28

JudahGabriel commented 1 year ago

Hey @mfonnesbeck

What's the version of Raven that you're running against?

JudahGabriel commented 1 year ago

Also, I see you're using an older version of Raven Migrations. Is there a reason you can't use the latest Raven Migrations?

mfonnesbeck commented 1 year ago

As I mentioned in my question, I am using Raven Client 5.4.104 and the database servers are the same version. We just recently successfully migrated to this version. And I chose Raven Migrations 4.3.0, because it matches my current .Net version - which we are not ready to upgrade. I tried other newer versions, and my projects failed to build due to our version of .Net. All things seemed to be fine with that until I ran and received the error message. Thus my question and issue.

JudahGabriel commented 1 year ago

I suspect the problem is that Raven Migrations 4.3 uses a different Raven.Client version than the one you're using, so it fails.

One thing you could try is, grab the latest Raven Migrations code, build it for the version of .NET that you're using, and see if that works?

JudahGabriel commented 7 months ago

Closing for inactivity.