Npgsql: Attempted to read past the end of the stream


i have a postgresql Docker container that my Blazor server-app is trying to connect to. I had it working at one point but for some reason can't seem to get around this issue. The Docker container... contains my userstore as well as other stuff, so generally my "flow" has been:

  1. docker run -d -p 5005:5005 --name postgres_db -e POSTGRES_PASSWORD=${Password} postgres
  2. Start the Blazor app
  3. Try to login
  4. Fail:
fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
      An error occurred using the connection to database 'postgres' on server 'tcp://'.
fail: Microsoft.EntityFrameworkCore.Query[10100]
      An exception occurred while iterating over the results of a query for context type '${Context}'.
      System.InvalidOperationException: An exception has been raised that is likely due to a transient failure.
       ---> Npgsql.NpgsqlException (0x80004005): Exception while reading from stream
       ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.

My connection string is: "DelosConnection": "Server=;Port=5005;User Id=postgres;Password=${Password};Database=postgres;Command Timeout=300;No Reset On Close=True" I've tried a few different ports, 80, 81, 49154, 5001, now 5005. I'm pretty new to Docker in general so if there's something obvious I'm missing, please let me know lol.

asked on Stack Overflow Feb 23, 2021 by Sean

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0