System.NotSupportedException: This protocol version is not supported

System.NotSupportedException: This protocol version is not supported

Postby palmi » Fri 14 Jul 2017 13:38

Hi Support,

when I try to call context.Database.EnsureCreated() or context.Database.Migrate() in the Startup.cs of my ASP .NET Core (v1.1.2) project with EF Core (v1.1.2) and Docker Support activated I get following Error from Devart:

System.NotSupportedException: This protocol version is not supported

NuGet packages:
Devart.Data.Oracle v9.4.314
Devart.Data.Oracle.EFCore v9.4.314

Oracle DB:
Oracle Standard Edition 12c Release 1

Here the Stack Trace:
" at Devart.Data.Oracle.c.a(Int32 A_0)\n at Devart.Data.Oracle.d.a(String A_0, String A_1, String A_2, String A_3, String A_4)\n at Devart.Data.Oracle.c1.a(b0 A_0, Boolean A_1)\n at Devart.Data.Oracle.c1.a(b0 A_0, cy A_1)\n at Devart.Data.Oracle.OracleInternalConnection..ctor(b0 connectionOptions, OracleInternalConnection proxyConnection)\n at Devart.Data.Oracle.bz.a(g A_0, Object A_1, DbConnectionBase A_2)\n at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, g A_1, DbConnectionBase A_2)\n at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)\n at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)\n at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)\n at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)\n at Devart.Common.DbConnectionBase.Open()\n at Devart.Data.Oracle.OracleConnection.Open()\n at Devart.Data.Oracle.Entity.ax.a(DbConnection A_0, OracleServerType& A_1, Nullable`1& A_2)\n at Devart.Data.Oracle.Entity.ax.b(DbConnection A_0)\n at Devart.Data.Oracle.Entity.ao..ctor(IRelationalConnection A_0)\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)\n at Microsoft.EntityFrameworkCore.Storage.DatabaseProviderServices.GetService[TService]()\n at Microsoft.EntityFrameworkCore.Infrastructure.RelationalServiceCollectionExtensions.<>c.<AddRelational>b__0_11(IServiceProvider p)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactoryService(FactoryService factoryService, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)\n at Microsoft.EntityFrameworkCore.Storage.DatabaseProviderServices.GetService[TService]()\n at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.<>c.<AddEntityFramework>b__0_13(IServiceProvider p)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactoryService(FactoryService factoryService, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)\n at Microsoft.EntityFrameworkCore.Storage.DatabaseProviderServices.GetService[TService]()\n at Microsoft.EntityFrameworkCore.Infrastructure.RelationalServiceCollectionExtensions.<>c.<AddRelational>b__0_8(IServiceProvider p)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactoryService(FactoryService factoryService, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(IServiceCallSite callSite, TArgument argument)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)\n at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)\n at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)\n at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)\n at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)\n at ContinuousEverything.Models.DbInitializer.Initialize(BloggingContext context) in D:\\Git\\Continous Everything\\ContinuousEverything\\ContinuousEverything\\Models\\DbInitializer.cs:line 21\n at ContinuousEverything.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, BloggingContext context) in D:\\...\\Startup.cs:line 64"
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby Shalex » Tue 18 Jul 2017 09:47

Please specify here or send us the full content of sqlnet.ora used by your Oracle Server 12c.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Tue 18 Jul 2017 14:54

Hi. In my case there is no sqlnet.ora in the ORACLE_HOME/network/admin folder.
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Thu 20 Jul 2017 12:48

Any news?
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby Shalex » Thu 20 Jul 2017 15:18

We cannot reproduce the issue in our test environment at the moment.

1. Please create a new project Console Application (.NET Core), install package Devart.Data.Oracle, try to open a connection:
Code: Select all
    using (var conn = new Devart.Data.Oracle.OracleConnection())
    {
        conn.ConnectionString = @"direct=true;server=...;sid=orcl;uid=c##scott;pwd=tiger;License Key=...;";
        conn.Open();
    }
Are you getting the same error "This protocol version is not supported"?

2. Now try the same with .NET Framework: create a new project Console Application (.NET Framework), reference Devart.Data.dll and Devart.Data.Oracle.dll from GAC (or from provider installation folder), try to open a connection:
Code: Select all
    using (var conn = new Devart.Data.Oracle.OracleConnection())
    {
        conn.ConnectionString = @"direct=true;server=...;sid=orcl;uid=c##scott;pwd=tiger;";
        conn.Open();
    }
Are you getting the same error "This protocol version is not supported"?

3. Please confirm that ORACLE_HOME/network/admin/sqlnet.ora is missing at the server side (not client side) where Oracle Server is installed.

4. Tell us:
a) the full version of your Oracle Standard Edition 12c Release 1
b) the name of distributive and its version where Oracle Server is installed
c) are you connecting to CDB or PDB instance of your Oracle 12c?
d) is it possible to establish connection directly to your Oracle server from our network? If so, please create a test Oracle user which has the CONNECT privilege (provide credentials via our contact form)
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Thu 20 Jul 2017 17:30

1. Same error
2. Same error
3. Yes. It is missing on the server side.
4. You can easily test it and examine it yourself since my Oracle DB is a Docker container:
Here is the respective Docker image:
https://hub.docker.com/r/sath89/oracle-12c/
Here is the docker-compose file of my docker supported ASP.NET Core application:
version: '2'

services:

testapp:
image: testapp
build:
context: ./TestApp
dockerfile: Dockerfile

oracledb:
image: sath89/oracle-12c
ports:
- "1521:1521"

And here is the connection string I connect to the DB:
Server=(DESCRIPTION = (ADDRESS = (PROTOCOL=TCP) (HOST=LOCALHOST) (PORT=1521)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=xe))); Direct = true; User Id = system; Password = oracle; Unicode = true; License Key = ...
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Tue 25 Jul 2017 19:25

Any news on this issue?
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby Shalex » Wed 26 Jul 2017 15:50

We still cannot reproduce the error.

The steps I followed are:

1) installed Visual Studio Code on my Ubuntu 16.04 x64

2) pulled and ran https://hub.docker.com/r/sath89/oracle-12c/
docker pull sath89/oracle-12c
docker run -d -p 8080:8080 -p 1521:1521 sath89/oracle-12c


3) ran local VS Code
sudo code --user-data-dir=/home/test/.code-root-user-data

4) created a new console project within my folder and downloaded a Devart package
sudo dotnet new console
dotnet add package devart.data.oracle


5) successfully executed the code
Code: Select all
    var conn = new Devart.Data.Oracle.OracleConnection();
    conn.ConnectionString = @"direct=true;server=(DESCRIPTION = (ADDRESS = (PROTOCOL=TCP) (HOST=LOCALHOST) (PORT=1521)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=xe)));uid=system;pwd=oracle;unicode=true;license key=...;";
    conn.Open();
    Console.WriteLine(conn.ServerVersion.ToString());

Do exactly the same steps in your environment lead to the error "This protocol version is not supported"?
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Mon 31 Jul 2017 17:59

Thanks.

I sent you a sample project to reproduce the issue via your contact formular.
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Thu 03 Aug 2017 00:30

Any news on this? I haven't gotten any confirmation or response.
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby Shalex » Thu 03 Aug 2017 14:25

We have received your email and are processing the request. Sorry for the delay.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Thu 03 Aug 2017 15:25

No problem. I just wanted to make sure you received it.
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby palmi » Wed 09 Aug 2017 01:53

Any news on this issue?
palmi
 
Posts: 20
Joined: Thu 16 Feb 2017 16:52

Re: System.NotSupportedException: This protocol version is not supported

Postby Shalex » Wed 09 Aug 2017 13:05

We have reproduced the error, its full stack trace in our environment is the following:
Code: Select all
System.AggregateException: One or more errors occurred. (This protocol version is not supported.) ---> System.NotSupportedException: This protocol version is not supported.
   at System.Net.Sockets.Socket.BeginConnect(IPAddress address, Int32 port, AsyncCallback requestCallback, Object state)
   at System.Net.Sockets.SocketTaskExtensions.<>c.<ConnectAsync>b__3_0(IPAddress targetAddress, Int32 targetPort, AsyncCallback callback, Object state)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2](Func`5 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, Object state, TaskCreationOptions creationOptions)
   at System.Threading.Tasks.TaskFactory.FromAsync[TArg1,TArg2](Func`5 beginMethod, Action`1 endMethod, TArg1 arg1, TArg2 arg2, Object state)
   at System.Net.Sockets.SocketTaskExtensions.ConnectAsync(Socket socket, IPAddress address, Int32 port)
   at System.Net.Sockets.TcpClient.<ConnectAsyncCorePrivate>d__67.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Net.Sockets.TcpClient.<ConnectAsyncCorePrivate>d__67.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
   at System.Net.Sockets.TcpClient.<ConnectAsyncCorePrivate>d__65.MoveNext()
   --- End of inner exception stack trace ---
   at Devart.Data.Oracle.c.a(Int32 A_0)
   at Devart.Data.Oracle.d.a(String A_0, String A_1, String A_2, String A_3, String A_4)
   at Devart.Data.Oracle.c1.a(b0 A_0, Boolean A_1)
   at Devart.Data.Oracle.c1.a(b0 A_0, cy A_1)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(b0 connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.bz.a(g A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, g A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at DevartTest.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in C:\...\DevartTest\DevartTest\Startup.cs:line 46

We consider that this is a bug in the implementation of the BeginConnect method in the System.Net.Sockets.Socket class.

Please open \DevartTest\docker-compose.override.yml and replace LOCALHOST with your IP (or DNS name) in the HOST connection string parameter. That fixed the error in our environment. A similar case is discussed at https://groups.google.com/forum/#!topic/rabbitmq-users/M9YtRkbzQ0I.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle