Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. Gurux.DLMS.AMI4

Gurux.DLMS.AMI4

By Sourabh, 5 September, 2023
Forums
Gurux.DLMS.AMI

Giving me error as below
Windows:
docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=localhost;Database=testDb;UID=new_user;Password=password" -e "IdentityServer:Key:Type=Development" -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="NewPasswd" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v $env:USERPROFILE.aspnet/https:/https/guruxorg/guruxdlmsamiserver:latest

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 ---

and Mysql is working fine

sh-4.4# mysql -h localhost -u new_user -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 8.0.32 MySQL Community Server - GPL
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.

Please helpe me to run the container

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, Your MySQL server is not…

Hi,

Your MySQL server is not available for the docker. Are you running MySQL on the docker? Have you created testDb database and added access right for the user?

BR,
Mikko

Sourabh

2 years 2 months ago

Thanks Mikko i am able to…

Thanks Mikko i am able to now connect to testdb . i am running MySQL outside the docker and when i provide my machin Ip address in the HOST it resolved the issue

arobles

2 years ago

Hi, I am deploying this…

Hi,

I am deploying this docker instance to Gurux.DLMS.AMI and I have the following error with Mysql

C:\Users\Andres.Robles>docker run --rm -it -e "Database:Type=MySQL" -e "Database:Settings=Server=172.21.224.1;Database=ami;UID=ami;Password=password" -e "IdentityServer:Key:Type=Development" -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="AMI1234" -e ASPNETCORE_Kestrel__Certificates__Default__Path=/https/Gurux.DLMS.AMI.Server.pfx -v %USERPROFILE%\.aspnet\https:/https/ guruxorg/guruxdlmsamiserver:latest
Creating tables.
Unhandled exception. MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'gxsystemlog' already exists
at MySql.Data.MySqlClient.MySqlStream.ReadPacketAsync(Boolean execAsync)
at MySql.Data.MySqlClient.NativeDriver.GetResultAsync(Int32 affectedRow, Int64 insertedId, Boolean execAsync)
at MySql.Data.MySqlClient.Driver.GetResultAsync(Int32 statementId, Int32 affectedRows, Int64 insertedId, Boolean execAsync)
at MySql.Data.MySqlClient.Driver.NextResultAsync(Int32 statementId, Boolean force, Boolean execAsync)
at MySql.Data.MySqlClient.MySqlDataReader.NextResultAsync(Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlDataReader.NextResultAsync(Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
at Gurux.Service.Orm.GXDbConnection.ExecuteNonQuery(IDbConnection connection, IDbTransaction transaction, String query)
at Gurux.Service.Orm.GXDbConnection.TableCreation(IDbConnection connection, Boolean create, IDbTransaction transaction, GXTableCreateQuery table, List`1 created)
at Gurux.Service.Orm.GXDbConnection.CreateTable(IDbConnection connection, IDbTransaction transaction, Type type, Dictionary`2 tables)
at Gurux.Service.Orm.GXDbConnection.CreateTable(IDbTransaction transaction, Type type, Boolean relations, Boolean overwrite)
at Gurux.DLMS.AMI.Server.ServerSettings.ConnectToDb(WebApplicationBuilder builder, ILogger`1 logger) in /src/Gurux.DLMS.AMI/Server/ServerSettings.cs:line 809
at Program.<Main>$(String[] args) in /src/Gurux.DLMS.AMI/Server/Program.cs:line 95
at Program.<Main>(String[] args)

thanks,

arobles

2 years ago

Hi, I have solved the…

Hi,

I have solved the problem related to Mysql, I have created a username to access the Gurux.AMI web interface but it tells me that There was an error trying to log you in: ''

Do I need to do something? or what could it be?

Profile picture for user Kurumi

Kurumi

2 years ago

Hi arobles, Please, create a…

Hi arobles,

Please, create a new topic when you have a new question.

Have you registered your user?

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 12/02/2025 - 10:21
    gurux.dlms.c 9.0.2512.0201
  • Mon, 12/01/2025 - 13:55
    Gurux.DLMS.Python 1.0.193
  • Thu, 11/13/2025 - 15:23
    Gurux.DLMS.Python 1.0.192
  • Thu, 11/13/2025 - 14:55
    gurux.dlms.java 4.0.84
  • Wed, 10/29/2025 - 08:51
    gurux.dlms.c 9.0.2510.2901

New forum topics

  • Incomplete Firmware Upgrade Process
  • SNRM byte mening
  • P384 Client Certificate incorrect issuer CN
  • Confirmed push service support
  • DLMS Stack hang during Firmware Upgrade
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin