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.
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$
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$
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$
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
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)
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.
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
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)
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)
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.
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:
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)
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.
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)
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
Hi,
Hi,
You can read the Quick start from here:
https://gurux.fi/Gurux.DLMS.AMI4
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$
Mr Kurumi,do you have any
Mr Kurumi,do you have any comments for the new problem?
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
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$
Hi,
Hi,
Have you checked this?
https://youtu.be/xm83-j0iDGg
What OS are you using in the VirtualBox?
BR,
Mikko
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
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
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
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
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
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)
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
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)
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
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?
Hi, Gurux.DLMS.AMI will…
Hi,
Gurux.DLMS.AMI will create all the tables for the database. What error you are receiving?
BR,
Mikko
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
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
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