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

Marten failure with Npgsql 4.1.0: System.MissingMethodException #2642

Closed
senzacionale opened this issue Sep 27, 2019 · 2 comments

Comments

@senzacionale
Copy link

commented Sep 27, 2019

After upgrade I am getting strange error:

System.Exception: Error trying to fetch w/ sql 'SELECT schemaname, relname FROM pg_stat_user_tables WHERE relname LIKE ? AND schemaname = ANY(?);'
 ---> System.MissingMethodException: Method not found: 'Npgsql.NpgsqlDataReader Npgsql.NpgsqlCommand.ExecuteReader()'.
   at Marten.Util.CommandExtensions.Fetch[T](NpgsqlCommand cmd, String sql, Func`2 transform, Object[] parameters)
   at Marten.Storage.TenantExtensions.<>c__DisplayClass4_0`1.<Fetch>b__0(NpgsqlConnection conn)
   --- End of inner exception stack trace ---
   at Marten.Storage.TenantExtensions.<>c__DisplayClass4_0`1.<Fetch>b__0(NpgsqlConnection conn)
   at Marten.Storage.TenantExtensions.execute[T](ITenant tenant, Func`2 func)
   at Marten.Storage.TenantExtensions.Fetch[T](ITenant tenant, String sql, Func`2 transform, Object[] parameters)
   at Marten.Schema.DbObjects.SchemaTables()
   at Marten.Schema.DocumentCleaner.CompletelyRemoveAll()
   at CryptoAnalysis.Auth.Api.Startup.InitializeDatabase() in /src/CryptoAnalysis.Auth.Api/Startup.cs:line 207
   at CryptoAnalysis.Auth.Api.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env) in /src/CryptoAnalysis.Auth.Api/Startup.cs:line 179
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()

Any ideas why?

@manigandham

This comment has been minimized.

Copy link

commented Sep 27, 2019

The stack trace tells you exactly what's wrong:

 ---> System.MissingMethodException: Method not found: 'Npgsql.NpgsqlDataReader Npgsql.NpgsqlCommand.ExecuteReader()'.
   at Marten.Util.CommandExtensions.Fetch[T](NpgsqlCommand cmd, String sql, Func`2 transform, Object[] parameters)
   at Marten.Storage.TenantExtensions.<>c__DisplayClass4_

The ExecuteReader() method doesn't exist. What did you upgrade? npgsql? Which version? Looks like Marten isn't compatible with it. You should post your issue there with more details on versions: https://github.com/JasperFx/marten

@YohDeadfall

This comment has been minimized.

Copy link
Member

commented Sep 27, 2019

Closing in favor of #2626.

roji added a commit that referenced this issue Sep 30, 2019
* Revert NpgsqlStatement.Rows from ulong back to uint (#2150)
* Revert NpgsqlBinaryImporterComplete to return void (#2112)
* Moved NpgsqlTimeout from namespace Npgsql.Util back to Npgsql
* Various other minor missing cancellation token overloads

Fixes #2626
Fixes #2655
Fixes #2642
@roji roji reopened this Sep 30, 2019
@roji roji changed the title System.Exception: Error trying to fetch w/ sql 'SELECT schemaname, relname FROM pg_stat_user_tables WHERE relname LIKE ? AND schemaname = ANY(?);' Marten failure with Npgsql 4.1.0: System.MissingMethodException Sep 30, 2019
@roji roji self-assigned this Sep 30, 2019
@roji roji added the bug label Sep 30, 2019
@roji roji added this to the 4.1.1 milestone Sep 30, 2019
roji added a commit that referenced this issue Sep 30, 2019
* Revert NpgsqlStatement.Rows from ulong back to uint (#2150)
* Revert NpgsqlBinaryImporterComplete to return void (#2112)
* Moved NpgsqlTimeout from namespace Npgsql.Util back to Npgsql
* Various other minor missing cancellation token overloads

Fixes #2626
Fixes #2655
Fixes #2642
@roji roji closed this Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.