MattJeanes / TeslaMateAgile

Integration to automatically fill in prices for charge data captured by TeslaMate for smart energy providers
MIT License
76 stars 9 forks source link

Container running, costs not updating #11

Closed chamsters closed 3 years ago

chamsters commented 3 years ago

Hi Matt,

I'm running the container independently, have all connection parameters etc set up just fine.

Logs = blank, no errors reported.

Geofence is set correctly; the charge is showing with a 0 cost - but it just never updates.

Any ideas what could be wrong??

Few things that don't look right:

MattJeanes commented 3 years ago

Hi there, can you share logs from the container?

If the cost is explicitly set to zero TeslaMateAgile will not touch it but it will edit ones that have a null cost - TeslaMate shows these as zero though in the UI but in the database they are null, maybe worth checking to see if the entries are 0 or null in your TeslaMate database.

chamsters commented 3 years ago

Hey Matt,

When I view logs: "No logs available"

Entries are null int he TM database -- just checked. Can't see what's wrong, logs aren't spitting out anything and the container seems to be in a non stop reboot loop...

chamsters commented 3 years ago

Just disabled auto reboot. I'm now seeing error 139 when trying to boot up the container....

MattJeanes commented 3 years ago

Try running docker run -it --rm mattjeanes/teslamateagile and passing in the appropriate environment variables with -e etc, see what it comes back with.

What hardware are you trying to run the image on? It's a multi-arch image so shouldn't be a problem unless you're trying to run under Linux x86? The project supports ARM, ARM64 (Raspberry Pis) and x64

chamsters commented 3 years ago

Hey Matt,

Hm can't get it to work using that and an environments variable file. I get a 'failed to resize tty, using default size' error and then it just stops - no running container.

Hardware - it's a western digital ex2 ultra NAS, which is an ARMv7.

MattJeanes commented 3 years ago

Is there any other output at all? What happens if you just run that command above directly with no environment variables at all?

For me, that results in this output:

(base) C:\_git> docker run -it --rm mattjeanes/teslamateagile
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /src/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /src/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /src/TeslaMateAgile/Program.cs:line 22
   at TeslaMateAgile.Program.<Main>()

This output at least indicates that .NET Core has started properly and is running the program code, I wonder if it's not even getting this far.

Also can you run uname -a in a terminal window and send me the output please?

chamsters commented 3 years ago

This is what I get...

root@Cloud root # docker run -it --rm mattjeanes/teslamateagile
failed to resize tty, using default size

Seems like a .NET issue?

root@Cloud root # uname -a
Linux Cloud 3.10.39 #1 SMP Thu Aug 29 20:35:52 PDT 2019 2014T30p5 Build-gitad56653 armv7l GNU/Linux
MattJeanes commented 3 years ago

That's very odd, armv7 is one of the supported architectures of TeslaMateAgile and I've tried it on my Raspberry Pi 2B with the same armv7l architecture and it's running fine.

matt@raspberrypi-2b-01:~ $ sudo docker run -it --rm mattjeanes/teslamateagile
Unable to find image 'mattjeanes/teslamateagile:latest' locally
latest: Pulling from mattjeanes/teslamateagile
2dd003996c9a: Pull complete
52ae7ebf826a: Pull complete
d1cb8ce1104e: Pull complete
4b57ddfbb902: Pull complete
fa01df3dbf85: Pull complete
9a5786a9c701: Pull complete
Digest: sha256:1f276ef5e2ffea30b5cc1516a96e3d359a8a5d414e854c8cd3c81d44b100b800
Status: Downloaded newer image for mattjeanes/teslamateagile:latest
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /src/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /src/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /src/TeslaMateAgile/Program.cs:line 22
   at TeslaMateAgile.Program.<Main>()
matt@raspberrypi-2b-01:~ $ uname -a
Linux raspberrypi-2b-01 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

Try running one of the dotnet sample containers: docker run --rm mcr.microsoft.com/dotnet/core/samples see what that does

matt@raspberrypi-2b-01:~ $ docker run --rm mcr.microsoft.com/dotnet/core/samples
Unable to find image 'mcr.microsoft.com/dotnet/core/samples:latest' locally
latest: Pulling from dotnet/core/samples
a7c65856610c: Pull complete
bc0cd8e4bd0a: Pull complete
368b638cf0b3: Pull complete
53f1388c2c02: Pull complete
32128a0e7a69: Pull complete
de45a445c655: Pull complete
Digest: sha256:f7bd0f9e02d7d0aa0705de0a11fe18d4cda985b6448bf7f24c62303803bcdf0b
Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/samples:latest

      Hello from .NET Core!
      __________________
                        \
                        \
                            ....
                            ....'
                            ....
                          ..........
                      .............'..'..
                  ................'..'.....
                .......'..........'..'..'....
                ........'..........'..'..'.....
              .'....'..'..........'..'.......'.
              .'..................'...   ......
              .  ......'.........         .....
              .                           ......
              ..    .            ..        ......
            ....       .                 .......
            ......  .......          ............
              ................  ......................
              ........................'................
            ......................'..'......    .......
          .........................'..'.....       .......
      ........    ..'.............'..'....      ..........
    ..'..'...      ...............'.......      ..........
    ...'......     ...... ..........  ......         .......
  ...........   .......              ........        ......
  .......        '...'.'.              '.'.'.'         ....
  .......       .....'..               ..'.....
    ..       ..........               ..'........
            ............               ..............
          .............               '..............
          ...........'..              .'.'............
        ...............              .'.'.............
        .............'..               ..'..'...........
        ...............                 .'..............
        .........                        ..............
          .....

Environment:
.NET Core 3.1.8
Linux 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018

Also try removing -it from the command above so docker run --rm mattjeanes/teslamateagile

chamsters commented 3 years ago

That's very odd, armv7 is one of the supported architectures of TeslaMateAgile and I've tried it on my Raspberry Pi 2B with the same armv7l architecture and it's running fine.

matt@raspberrypi-2b-01:~ $ sudo docker run -it --rm mattjeanes/teslamateagile
Unable to find image 'mattjeanes/teslamateagile:latest' locally
latest: Pulling from mattjeanes/teslamateagile
2dd003996c9a: Pull complete
52ae7ebf826a: Pull complete
d1cb8ce1104e: Pull complete
4b57ddfbb902: Pull complete
fa01df3dbf85: Pull complete
9a5786a9c701: Pull complete
Digest: sha256:1f276ef5e2ffea30b5cc1516a96e3d359a8a5d414e854c8cd3c81d44b100b800
Status: Downloaded newer image for mattjeanes/teslamateagile:latest
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /src/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /src/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /src/TeslaMateAgile/Program.cs:line 22
   at TeslaMateAgile.Program.<Main>()
matt@raspberrypi-2b-01:~ $ uname -a
Linux raspberrypi-2b-01 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

Try running one of the dotnet sample containers: docker run --rm mcr.microsoft.com/dotnet/core/samples see what that does

matt@raspberrypi-2b-01:~ $ docker run --rm mcr.microsoft.com/dotnet/core/samples
Unable to find image 'mcr.microsoft.com/dotnet/core/samples:latest' locally
latest: Pulling from dotnet/core/samples
a7c65856610c: Pull complete
bc0cd8e4bd0a: Pull complete
368b638cf0b3: Pull complete
53f1388c2c02: Pull complete
32128a0e7a69: Pull complete
de45a445c655: Pull complete
Digest: sha256:f7bd0f9e02d7d0aa0705de0a11fe18d4cda985b6448bf7f24c62303803bcdf0b
Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/samples:latest

      Hello from .NET Core!
      __________________
                        \
                        \
                            ....
                            ....'
                            ....
                          ..........
                      .............'..'..
                  ................'..'.....
                .......'..........'..'..'....
                ........'..........'..'..'.....
              .'....'..'..........'..'.......'.
              .'..................'...   ......
              .  ......'.........         .....
              .                           ......
              ..    .            ..        ......
            ....       .                 .......
            ......  .......          ............
              ................  ......................
              ........................'................
            ......................'..'......    .......
          .........................'..'.....       .......
      ........    ..'.............'..'....      ..........
    ..'..'...      ...............'.......      ..........
    ...'......     ...... ..........  ......         .......
  ...........   .......              ........        ......
  .......        '...'.'.              '.'.'.'         ....
  .......       .....'..               ..'.....
    ..       ..........               ..'........
            ............               ..............
          .............               '..............
          ...........'..              .'.'............
        ...............              .'.'.............
        .............'..               ..'..'...........
        ...............                 .'..............
        .........                        ..............
          .....

Environment:
.NET Core 3.1.8
Linux 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018

Also try removing -it from the command above so docker run --rm mattjeanes/teslamateagile

Hm, so no error message when i remove -it. It executes the command but then nothing... if i check docker -ls I don't see anything running (other than my other containers).

MattJeanes commented 3 years ago

Did the dotnet sample container work or did it do the same thing? -it just means interactive which is why that message comes up, we don't need an interactive shell so removed that bit.

chamsters commented 3 years ago

Did the dotnet sample container work or did it do the same thing? -it just means interactive which is why that message comes up, we don't need an interactive shell so removed that bit.

I haven't tried the dotnet sample container - sorry I'm not a pro with this (clearly!). How would I go about this?

MattJeanes commented 3 years ago

That's okay, I'm very curious as to why it's returning absolutely no output for you!

Run this for the dotnet sample container: docker run --rm mcr.microsoft.com/dotnet/core/samples

Also after trying to run the TeslaMateAgile one, try running echo $? - this should return a number which is the exit code of the container, might help us work out the issue.

Also could you return the output of docker ps --all? Feel free to omit anything that's not TeslaMateAgile related as this will contain a list of all your containers.

chamsters commented 3 years ago

That's okay, I'm very curious as to why it's returning absolutely no output for you!

Run this for the dotnet sample container: docker run --rm mcr.microsoft.com/dotnet/core/samples

Also after trying to run the TeslaMateAgile one, try running echo $? - this should return a number which is the exit code of the container, might help us work out the issue.

Also could you return the output of docker ps --all? Feel free to omit anything that's not TeslaMateAgile related as this will contain a list of all your containers.

OK here goes!

root@ZimausClaud root # docker run --rm mcr.microsoft.com/dotnet/core/samples Unable to find image 'mcr.microsoft.com/dotnet/core/samples:latest' locally latest: Pulling from dotnet/core/samples a7c65856610c: Pull complete bc0cd8e4bd0a: Pull complete 368b638cf0b3: Pull complete 53f1388c2c02: Pull complete 32128a0e7a69: Pull complete de45a445c655: Pull complete Digest: sha256:f7bd0f9e02d7d0aa0705de0a11fe18d4cda985b6448bf7f24c62303803bcdf0b Status: Downloaded newer image for mcr.microsoft.com/dotnet/core/samples:latest

That exits without any error, but nothing new in my running container. running your echo command after this yields 0.

Here's another: root@ZimausClaud root # docker run --rm mattjeanes/teslamateagile root@ZimausClaud root # echo $? 139

the ps -all still does not show me any containers related to agile / .net.

MattJeanes commented 3 years ago

Fascinating, so exit code 0 means 'OK' so the sample completed successfully and 139 means an unhandled exception which is expected for TeslaMateAgile without all the various environment variables so it appears to be working just not showing any output weirdly!

Try running the container in the background without removing it, follow along these commands:

(of course the id it gives you will be something else, use that one in the logs command!)

(base) C:\_git> docker run -d mattjeanes/teslamateagile
10a2d610e5ab280d8d6000de13c4940fb2f82434cc845a963085fee8e8400290
(base) C:\_git> docker logs -f 10a2d610e5ab280d8d6000de13c4940fb2f82434cc845a963085fee8e8400290
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /src/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /src/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /src/TeslaMateAgile/Program.cs:line 22
   at TeslaMateAgile.Program.<Main>()

The docker ps --all should then show something too for TeslaMateAgile

chamsters commented 3 years ago

Fascinating, so exit code 0 means 'OK' so the sample completed successfully and 139 means an unhandled exception which is expected for TeslaMateAgile without all the various environment variables so it appears to be working just not showing any output weirdly!

Try running the container in the background without removing it, follow along these commands:

(of course the id it gives you will be something else, use that one in the logs command!)

(base) C:\_git> docker run -d mattjeanes/teslamateagile
10a2d610e5ab280d8d6000de13c4940fb2f82434cc845a963085fee8e8400290
(base) C:\_git> docker logs -f 10a2d610e5ab280d8d6000de13c4940fb2f82434cc845a963085fee8e8400290
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /src/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /src/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /src/TeslaMateAgile/Program.cs:line 22
   at TeslaMateAgile.Program.<Main>()

The docker ps --all should then show something too for TeslaMateAgile

Here's the run, executes OK:

root@ZimausClaud root # docker run -d mattjeanes/teslamateagile 4b2566a631b0cdff72136eeadb619b388842460b8a259d40f5922f6e27af82eb

Running the log command for above code is just blank - no response.

Docker ps --all shows: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4b2566a631b0 mattjeanes/teslamateagile "dotnet TeslaMateAgi…" About a minute ago Exited (139) 35 seconds ago naughty_khayyam

MattJeanes commented 3 years ago

Okay, thank you - you can remove that stopped container now docker rm naughty_khayyam

Can you just try the most basic hello world image? It seems they are running but not showing any output for some reason

docker run --rm hello-world

That should result in something like this:

(base) C:\_git> docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
chamsters commented 3 years ago

Okay, thank you - you can remove that stopped container now docker rm naughty_khayyam

Can you just try the most basic hello world image? It seems they are running but not showing any output for some reason

docker run --rm hello-world

That should result in something like this:

(base) C:\_git> docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Hello world docker worked perfectly - no issues reported!

root@ZimausClaud root # docker run --rm hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
4ee5c797bcd7: Pull complete 
Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm32v7)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
MattJeanes commented 3 years ago

Okay thank you, this is very weird.

Considering the default .NET Core Hello World application doesn't work I don't think the logging issue is to do with my application itself.

You could try downloading it manually - the current release for ARM32 can be found below, it's a self-contained build so after extracting it all you will have to do is make the file executable and then run it - I wonder if this will show the logs - maybe once you have it all configured you can move it back into docker as I believe it is running just not showing any logs so you can't see why it's crashing

https://github.com/MattJeanes/TeslaMateAgile/releases/download/latest/TeslaMateAgile-linux-arm.zip

chamsters commented 3 years ago

Hi Matt,

I've downloaded and extracted the zip. I have a folder full of files - not sure how to execute manually? I've tried running "TeslaMateAgile" using sh but just see a TeslaMateAgile: line 1: syntax error: unexpected word (expecting ")") error!

MattJeanes commented 3 years ago

So I've just tried this on my raspberry pi, I basically ran this sequence of commands:

mkdir TeslaMateAgile
cd TeslaMateAgile
wget https://github.com/MattJeanes/TeslaMateAgile/releases/download/v1.3.1/TeslaMateAgile-linux-arm.zip
unzip TeslaMateAgile-linux-arm.zip
chmod +x ./TeslaMateAgile
./TeslaMateAgile

That resulted in this output:

matt@raspberrypi-2b-01:~ $ ./TeslaMateAgile
Unhandled exception. System.ArgumentNullException: Configuration 'DATABASE_HOST' or 'ConnectionStrings__TeslaMate' is required (Parameter 'DATABASE_HOST')
   at TeslaMateAgile.Program.<>c__DisplayClass0_0.<Main>g__getDatabaseVariable|4(String variableName) in /home/runner/work/TeslaMateAgile/TeslaMateAgile/TeslaMateAgile/Program.cs:line 46
   at TeslaMateAgile.Program.<>c.<Main>b__0_2(HostBuilderContext hostContext, IServiceCollection services) in /home/runner/work/TeslaMateAgile/TeslaMateAgile/TeslaMateAgile/Program.cs:line 50
   at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.RunConsoleAsync(IHostBuilder hostBuilder, CancellationToken cancellationToken)
   at TeslaMateAgile.Program.Main() in /home/runner/work/TeslaMateAgile/TeslaMateAgile/TeslaMateAgile/Program.cs:line 80
   at TeslaMateAgile.Program.<Main>()
Aborted

This is the ARM32 build same processor architecture as your NAS drive - armv7l so it should work unless somehow your OS on the NAS drive just isn't compatible with .NET Core applications which it seems like it could be since you couldn't run the .NET Core hello world example either from docker, or at least see it's output.

What does that same sequence of commands do for you, assuming that wasn't what you already did pretty much?

chamsters commented 3 years ago

Yeah definitely something weird here :(

root@ZimausClaud TeslaMateAgile # chmod +x ./TeslaMateAgile
root@ZimausClaud TeslaMateAgile # ./TeslaMateAgile
-sh: ./TeslaMateAgile: not found
root@ZimausClaud TeslaMateAgile # sh TeslaMateAgile
TeslaMateAgile: line 1: syntax error: unexpected word (expecting ")")
root@ZimausClaud TeslaMateAgile # 
chamsters commented 3 years ago

Hey Matt,

Finally got down to a reinstall on a more standard centos box after migrating out of the NAS. This is a more usual x64 buid.

Still no luck in updating values, but this may be easier to troubleshoot? I can actually see logs now :)

--- End of stack trace from previous location where exception was thrown ---

   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken)

   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnectionAsync(Boolean errorsExpected, CancellationToken cancellationToken)

   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)

   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)

   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)

   at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)

   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()

   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)

   at TeslaMateAgile.PriceHelper.Update() in /src/TeslaMateAgile/Helpers/PriceHelper.cs:line 39

   at TeslaMateAgile.PriceService.DoWork() in /src/TeslaMateAgile/PriceService.cs:line 68

info: TeslaMateAgile.PriceService[0]

      Waiting 300 seconds until next update`
chamsters commented 3 years ago

Solved this in really odd way.

if i used hostname = database, it doesn't work, despite it being on the same network as teslamate container which is updating just fine. If i hardcode environment variable of the database host to the IP of the database container instance, still no go. BUT using the host ip address of the docker server, it works fine?!

MattJeanes commented 3 years ago

Ah okay so if you're using the docker-compose install and adding it to the same YAML that TeslaMate itself is installed with then hostname resolution will work but otherwise it won't. How are you running TeslaMate and how are you running TeslaMateAgile? That's good to see you've got it working so far though, it was super weird before.

MattJeanes commented 3 years ago

Closing due to inactivity, but glad you got it working 😄

chamsters commented 3 years ago

Sorry - yes, got it working! Whole thing now running in docker (i use portainer), and through explicit pointing of the ip address (static) it works as hoped - been working fine last few weeks.

Thanks so much for the awesome tool!