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

Postgres as database throws exception #5162

Closed
gen2fish opened this issue Aug 20, 2024 · 4 comments
Closed

Postgres as database throws exception #5162

gen2fish opened this issue Aug 20, 2024 · 4 comments

Comments

@gen2fish
Copy link

Summary

Running 4.44.1 docker image from linuxserver on kubernetes with the following database.json causes an unhandled exception

{
    "OmbiDatabase": {
        "Type": "Postgres",
        "ConnectionString": "Host=ombi-rw;Port=5432;Database=ombi;Username=ombi;Password=XXXX"
    },
    "SettingsDatabase": {
        "Type": "Postgres",
        "ConnectionString": "Host=ombi-rw;Port=5432;Database=ombi;Username=obmi;Password=XXXX"
    },
    "ExternalDatabase": {
        "Type": "Postgres",
        "ConnectionString": "Host=ombi-rw;Port=5432;Database=ombi;Username=ombi;Password=XXXX"
    }
}

This is the same in the 4.45 development version

Ombi Version

4.44.1

What platform(s) does this occur on?

Docker

What database are you using?

SQLite (Default)

Relevant log output

Unhandled exception. System.TypeLoadException: Could not load type 'Microsoft.EntityFrameworkCore.Storage.IRelationalValueBufferFactoryFactory' from assembly 'Microsoft.EntityFrameworkCore.Relational, Version=8.0.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Microsoft.Extensions.DependencyInjection.NpgsqlServiceCollectionExtensions.AddEntityFrameworkNpgsql(IServiceCollection serviceCollection)
   at Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.NpgsqlOptionsExtension.ApplyServices(IServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.ApplyServices(IDbContextOptions options, ServiceCollection services)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<GetOrAdd>g__BuildServiceProvider|4_1(IDbContextOptions _, ValueTuple`2 arguments)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.<>c.<GetOrAdd>b__4_0(IDbContextOptions contextOptions, ValueTuple`2 tuples)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
   at Microsoft.EntityFrameworkCore.Internal.ServiceProviderCache.GetOrAdd(IDbContextOptions options, Boolean providerRequired)
   at Microsoft.EntityFrameworkCore.DbContext..ctor(DbContextOptions options)
   at Ombi.Store.Context.SettingsContext..ctor(DbContextOptions options) in /home/runner/work/Ombi/Ombi/src/Ombi.Store/Context/SettingsContext.cs:line 22
   at Ombi.Store.Context.Postgres.SettingsPostgresContext..ctor(DbContextOptions`1 options) in /home/runner/work/Ombi/Ombi/src/Ombi.Store/Context/Postgres/SettingsPostgresContext.cs:line 8
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Ombi.Program.Main(String[] args) in /home/runner/work/Ombi/Ombi/src/Ombi/Program.cs:line 74
   at Ombi.Program.<Main>(String[] args)
@D0cR3d
Copy link

D0cR3d commented Aug 23, 2024

I'm having the same issue. I posted on the Pull Request but got no response.

@tidusjar
Copy link
Member

tidusjar commented Aug 23, 2024

Can you try https://github.com/Ombi-app/Ombi/releases/tag/v4.46.0?

I just connected PostgreSQL 16.4 (Just using the postgres:latest) and I'm not seeing this issue.

Reason being between 4.44.1 and 4.46.0 I updated the Postgres database connectors in Ombi, which is likely why I can no longer reproduce the issue

@tidusjar
Copy link
Member

Reverting to an older version of Ombi before the connector updates I can reproduce the issue. So I'm confident it's now been resolved

@gen2fish
Copy link
Author

Yup, working on 4.46, thank you!

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