Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Problem When Run DLMS.AMI

Problem when run DLMS.AMI

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By qink2008 , 18 November, 2022
Forums
Gurux.DLMS.AMI

Dear,

I download the docker of Gurux.DLMS.AMI4 from github, when i run Gurux.DLMS.AMI4, it reports the below problem. Do you have any idea? Please kindly help me.

k@k-VirtualBox:~/dlms/Gurux.DLMS.AMI4$ sudo docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=HOST;Database=192.168.122.66;UID=root;Password=root" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v %USERPROFILE%.aspnet\https:/https/ guruxdlmsamiserver
Unable to find image 'guruxdlmsamiserver:latest' locally

docker: Error response from daemon: pull access denied for guruxdlmsamiserver, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
k@k-VirtualBox:~/dlms/Gurux.DLMS.AMI4$

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hello,

Hello,

Linux command line is missing from the documentation. It's updated there, but the command line parameters should be:

docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=HOST;Database=DATABASE_SERVER;UID=USER_ID;Password=DATABASE_PASSWORD" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="YOUR_CREDENTIAL_PASSWORD" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v %USERPROFILE%.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latest

Get the latest version first.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

You can read the Quick start from here:
https://gurux.fi/Gurux.DLMS.AMI4

qink2008

3 years 6 months ago

Thank you very much ,Mr

Thank you very much ,Mr Kurumi.
It seems the command already take effect, but it report another error as below. Would you please help me to check what's problem.

k@k-VirtualBox:~/dlms/Gurux.DLMS.AMI4$
docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.122.66;Database=mysql;UID=root;Password=root" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v root.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=192.168.122.66;Database=mysql;UID=root;Password=root
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
info: Duende.IdentityServer.Startup[0]
Starting Duende IdentityServer version 5.2.0+1c3f1fadb0fa7a4bea3f4a6f7028cbfcff3b9918 (.NET 6.0.11)
warn: Duende.IdentityServer[0]
You do not have a valid license key for Duende IdentityServer. This is allowed for development and testing scenarios. If you are running in production you are required to have a licensed version. Please start a conversation with us: https://duendesoftware.com/contact
info: Microsoft.Extensions.DependencyInjection.ConfigureApiResources[2]
Configuring local API resource 'Gurux.DLMS.AMI.ServerAPI'.
info: Duende.IdentityServer.Startup[0]
Using explicitly configured authentication scheme Identity.Application for IdentityServer
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {16dda764-2b78-4758-9b08-99b902a855e8} may be persisted to storage in unencrypted form.
info: Gurux.DLMS.AMI.Scheduler.GXSchedulerService[0]
Scheduler service is starting.
info: Gurux.DLMS.AMI.Server.Cron.GXCronService[0]
Cron is starting.
Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
at Internal.Cryptography.Pal.OpenSslX509CertificateReader.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName)
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 386
at Program.<Main>(String[] args)
k@k-VirtualBox:~/dlms/Gurux.DLMS.AMI4$

qink2008

3 years 6 months ago

In reply to Hi, by Kurumi

Mr Kurumi,do you have any

Mr Kurumi,do you have any comments for the new problem?

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

It seems like you don't have a certificate. Have you run those?

dotnet dev-certs https -ep \https\Gurux.DLMS.AMI.Server.pfx -p 123456
dotnet dev-certs https --trust

BR,
Mikko

qink2008

3 years 6 months ago

In reply to Hi, by Kurumi

Yes, i already run the

Yes, i already run the commands as below.

k@k-VirtualBox:~/dlms/dlms1128$ dotnet dev-certs https -ep kkk.aspnet\https\Gurux.DLMS.AMI.Server.pfx -p 123456

The HTTPS developer certificate was generated successfully.
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$ dotnet dev-certs https --trust
Trusting the HTTPS development certificate was requested. Trusting the certificate on Linux distributions automatically is not supported. For instructions on how to manually trust the certificate on your Linux distribution, go to https://aka.ms/dev-certs-trust
A valid HTTPS certificate is already present.
k@k-VirtualBox:~/dlms/dlms1128$ docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.122.66;Database=mysql;UID=root;Password=root" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v kkk.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=192.168.122.66;Database=mysql;UID=root;Password=root
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
info: Duende.IdentityServer.Startup[0]
Starting Duende IdentityServer version 5.2.0+1c3f1fadb0fa7a4bea3f4a6f7028cbfcff3b9918 (.NET 6.0.11)
warn: Duende.IdentityServer[0]
You do not have a valid license key for Duende IdentityServer. This is allowed for development and testing scenarios. If you are running in production you are required to have a licensed version. Please start a conversation with us: https://duendesoftware.com/contact
info: Microsoft.Extensions.DependencyInjection.ConfigureApiResources[2]
Configuring local API resource 'Gurux.DLMS.AMI.ServerAPI'.
info: Duende.IdentityServer.Startup[0]
Using explicitly configured authentication scheme Identity.Application for IdentityServer
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {21811012-a92b-425e-a63f-dcfa95f73283} may be persisted to storage in unencrypted form.
info: Gurux.DLMS.AMI.Scheduler.GXSchedulerService[0]
Scheduler service is starting.
info: Gurux.DLMS.AMI.Server.Cron.GXCronService[0]
Cron is starting.
Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
at Internal.Cryptography.Pal.OpenSslX509CertificateReader.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName)
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 386
at Program.<Main>(String[] args)
k@k-VirtualBox:~/dlms/dlms1128$
k@k-VirtualBox:~/dlms/dlms1128$ docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.122.66;Database=mysql;UID=root;Password=root" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v /home/k/dlms/dlms1128/kkk.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=192.168.122.66;Database=mysql;UID=root;Password=root
warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
info: Duende.IdentityServer.Startup[0]
Starting Duende IdentityServer version 5.2.0+1c3f1fadb0fa7a4bea3f4a6f7028cbfcff3b9918 (.NET 6.0.11)
warn: Duende.IdentityServer[0]
You do not have a valid license key for Duende IdentityServer. This is allowed for development and testing scenarios. If you are running in production you are required to have a licensed version. Please start a conversation with us: https://duendesoftware.com/contact
info: Microsoft.Extensions.DependencyInjection.ConfigureApiResources[2]
Configuring local API resource 'Gurux.DLMS.AMI.ServerAPI'.
info: Duende.IdentityServer.Startup[0]
Using explicitly configured authentication scheme Identity.Application for IdentityServer
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {ebd8d8a1-1956-4c79-90ee-9771ce130df8} may be persisted to storage in unencrypted form.
info: Gurux.DLMS.AMI.Scheduler.GXSchedulerService[0]
Scheduler service is starting.
info: Gurux.DLMS.AMI.Server.Cron.GXCronService[0]
Cron is starting.
Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
at Internal.Cryptography.Pal.OpenSslX509CertificateReader.FromFile(String fileName, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String fileName, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Certificates.CertificateConfigLoader.LoadCertificate(CertificateConfig certInfo, String endpointName)
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.LoadDefaultCert()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Reload()
at Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader.Load()
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 386
at Program.<Main>(String[] args)
k@k-VirtualBox:~/dlms/dlms1128$ ls
kkk.aspnethttps kkk.aspnethttpsGurux.DLMS.AMI.Server.pfx
k@k-VirtualBox:~/dlms/dlms1128$ pwd
/home/k/dlms/dlms1128
k@k-VirtualBox:~/dlms/dlms1128$

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

Have you checked this?
https://youtu.be/xm83-j0iDGg

What OS are you using in the VirtualBox?

BR,
Mikko

qink2008

3 years 6 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

I have checked the video.
My OS version using in the VirtualBox as below.

k@k-VirtualBox:~/dlms/dlms1128$ uname -a
Linux k-VirtualBox 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

BR

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

Check that you have created the certificate. You can found it from here:

ls ${HOME}/.aspnet/https/Gurux.DLMS.AMI.Server.pfx

BR,
Mikko

qink2008

3 years 6 months ago

In reply to Hi, by Kurumi

Hi Mr Mikko,

Hi Mr Mikko,

Thank you very much for your support. I have run DLMS.AMI4 successful using below commands.
Because the system i used in the virtualbox is LINUX Ubuntu20, so the commands in the github page is not suitable for me, these commands seems use for Windows.(https://github.com/Gurux/Gurux.DLMS.AMI4)

dotnet dev-certs https -ep /home/tf/.aspnet/https/Gurux.DLMS.AMI.Server.pfx -p 123456

dotnet dev-certs https --trust

sudo docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.3.72;Database=mysql;UID=root;Password=password" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v /home/tf/.aspnet/https:/https/ guruxorg/guruxdlmsamiserver:latest

BTW, where can i get the device templates and objects templates import files? Thank you in advance.

BR,
Karl

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

You are right. The Linux command line parameters are in docker.com, but not in GitHub. It's updated there at the next release.

Connect to your meter with GXDLMSDirector. Remove objects that you don't want to read and save the device template file. Then import it for Gurux.DLMS.AMI.

BR,
Mikko

arobles

3 years 5 months ago

Error when trying to start

Error when trying to start Gurux.DLMS.AMI with docker

Is it necessary to have MSSQL installed to be able to start the Gurux.DLMS.AMI in windows?

when I try to start the image I get this:

Connecting: Server=MSI;Database=msdb;User ID=sa;Password=password
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server: Could not open a connection to SQL Server)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken, DbConnectionPool pool)
at Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
at Microsoft.Data.SqlClient.SqlConnection.Open()
at Gurux.Service.Orm.GXDbConnection..ctor(DbConnection[] connections, String tablePrefix)
at Gurux.DLMS.AMI.Server.ServerSettings.ConnectToDb(WebApplicationBuilder builder) in /src/Gurux.DLMS.AMI/Server/ServerSettings.cs:line 593
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 53
at Program.<Main>(String[] args)
ClientConnectionId:00000000-0000-0000-0000-000000000000

arobles

3 years 5 months ago

Hi Mr Mikko,

Hi Mr Mikko,

I have tried to run Gurux.DLMS.AMI on Ubuntu, but now I have this error. I have installed MySql and successfully installed the digital certificate as mentioned in the instructions:

sudo docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.30.49;Database=mysql;UID=root;Password=password" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v /home/tf/.aspnet/https:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=192.168.30.49;Database=mysql;UID=root;Password=password
Unhandled exception. MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
---> System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
at System.Net.Sockets.TcpClient.CompleteConnectAsync(Task task)
at MySql.Data.MySqlClient.NativeDriver.<>c.<Open>b__40_0(Exception ex)
at System.AggregateException.Handle(Func`2 predicate)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at Gurux.Service.Orm.GXDbConnection..ctor(DbConnection[] connections, String tablePrefix)
at Gurux.DLMS.AMI.Server.ServerSettings.ConnectToDb(WebApplicationBuilder builder) in /src/Gurux.DLMS.AMI/Server/ServerSettings.cs:line 605
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 53
at Program.<Main>(String[] args)

Profile picture for user Kurumi

Kurumi

3 years 5 months ago

Hi,

Hi,

Check your MySQL server address. I believe it's wrong.
"Database:Settings=Server=192.168.30.49

Check also that there aren't any firewalls that might block the connection.

BR,
Mikko

arobles

3 years 2 months ago

Hi Mr Kurumi, I have this…

Hi Mr Kurumi,

I have this error, the digital certificate is correctly installed but I don't know what else to do

user-ami@userami-VirtualBox:~$ sudo docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=userami-VirtualBox;Database=amidb;UID=root;Password=Gurux123" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v ${HOME}/.aspnet/https:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=userami-VirtualBox;Database=amidb;UID=root;Password=Gurux123
Unhandled exception. MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ValueStopwatch stopwatch)
at System.Net.Dns.<>c.<GetHostEntryOrAddressesCoreAsync>b__33_0(Object s, ValueStopwatch stopwatch)
at System.Net.Dns.<>c__DisplayClass39_0`1.<RunAsync>b__0(Task <p0>, Object <p1>)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
at MySql.Data.MySqlClient.NativeDriver.<>c.<Open>b__40_0(Exception ex)
at System.AggregateException.Handle(Func`2 predicate)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at Gurux.Service.Orm.GXDbConnection..ctor(DbConnection[] connections, String tablePrefix)
at Gurux.DLMS.AMI.Server.ServerSettings.ConnectToDb(WebApplicationBuilder builder) in /src/Gurux.DLMS.AMI/Server/ServerSettings.cs:line 605
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 53
at Program.<Main>(String[] args)

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, You SQL settings are…

Hi,

You SQL settings are like this fro MySQL:

Server=SQL_SERVER;Database=DATABASE;User ID=USER_ID;Password=USER_PASSWORD;TrustServerCertificate=True

Where:
SQL_SERVER: is the name or IP address of the SQL server.
DATABASE: Is the name of the database.
USER_ID is the name of the user.
USER_PASSWORD: Is the name of the user password.

BR,
Mikko

arobles

3 years 2 months ago

I have modified the…

I have modified the instructions with the data of my virtual machine, but I still have the same error, I will try to run it better in a Windows virtual machine, but I still do not understand the problem of denial of connections at the firewall level, at the iptables level I have allowed all connections in all three profiles with ALL:

sudo docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.10.20;Database=mysql;UID=root;Password=password" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v /home/user-ami/.aspnet/https/:/https/ guruxorg/guruxdlmsamiserver:latest

At the database level, should I create something in mysql? create some special instance to simulate my AMI infrastructure?

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

In reply to I have modified the… by arobles

Hi, Gurux.DLMS.AMI will…

Hi,

Gurux.DLMS.AMI will create all the tables for the database. What error you are receiving?

BR,
Mikko

arobles

3 years 2 months ago

In reply to Hi, Gurux.DLMS.AMI will… by Kurumi

This is the error: root…

This is the error:

root@userami-VirtualBox:/home/user-ami# docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=192.168.10.20;Database=mysql;UID=root;Password=password" -p 8000:80 -p 8001:443 -e ASPNETCORE_URLS="https://+;http://+" -e ASPNETCORE_HTTPS_PORT=8001 -e ASPNETCORE_ENVIRONMENT=Development -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v /home/user-ami/.aspnet/https/:/https/ guruxorg/guruxdlmsamiserver:latest
Database type: MySQL
Connecting: Server=192.168.10.20;Database=mysql;UID=root;Password=password
Unhandled exception. MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.
---> System.Net.Sockets.SocketException (111): Connection refused
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
at System.Net.Sockets.TcpClient.CompleteConnectAsync(Task task)
at MySql.Data.MySqlClient.NativeDriver.<>c.<Open>b__40_0(Exception ex)
at System.AggregateException.Handle(Func`2 predicate)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
at MySql.Data.MySqlClient.MySqlPool.GetConnection()
at MySql.Data.MySqlClient.MySqlConnection.Open()
at Gurux.Service.Orm.GXDbConnection..ctor(DbConnection[] connections, String tablePrefix)
at Gurux.DLMS.AMI.Server.ServerSettings.ConnectToDb(WebApplicationBuilder builder) in /src/Gurux.DLMS.AMI/Server/ServerSettings.cs:line 605
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 53
at Program.<Main>(String[] args)

I do not know what else to do

thanks,

regards

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

In reply to This is the error: root… by arobles

Hi, Unable to connect to any…

Hi,

Unable to connect to any of the specified MySQL hosts.

This means that the AMI can't connect you MySQL server.

Check that you have MySQL installed and there is no firewall that might block the connection. You can try to connect to the MySql server using mysql command line client.

BR,
Mikko

arobles

3 years 2 months ago

In reply to Hi, Unable to connect to any… by Kurumi

hi mr Kurumi! yes, i can…

hi mr Kurumi!

yes, i can connect to mysql without problem:

user-ami@userami-VirtualBox:~$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 8.0.32-0ubuntu0.22.04.2 (Ubuntu)

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0,03 sec)

mysql>

at the firewall level everything is allowed:

user-ami@userami-VirtualBox:~$ sudo iptables -L -n -v
Chain INPUT (policy ACCEPT 2025 packets, 1167K bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 1758 packets, 525K bytes)
pkts bytes target prot opt in out source destination

Chain DOCKER (0 references)
pkts bytes target prot opt in out source destination

Chain DOCKER-ISOLATION-STAGE-1 (0 references)
pkts bytes target prot opt in out source destination

Chain DOCKER-ISOLATION-STAGE-2 (0 references)
pkts bytes target prot opt in out source destination

Chain DOCKER-USER (0 references)
pkts bytes target prot opt in out source destination

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin