question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when running with docker and in-memory database

See original GitHub issue

Hello- I cloned the repo from the master branch today and attempted to build and run it using the instructions in readme. I’m using a reasonably fresh install of Windows 10 Pro and VS 2019 Pro, with Docker Desktop for Windows. Here are the steps I took: 1.Cloned this repo from the master branch 2. Installed Docker Desktop for Windows 3. Built the solution 4. Ran docker-compose build which seems to have completed successfully 5. Ran docker-compose up which failed:

docker-compose up Starting eshoponweb_eshopwebmvc_1 … done Attaching to eshoponweb_eshopwebmvc_1 eshopwebmvc_1 | fail: Microsoft.eShopWeb.Infrastructure.Data.CatalogContextSeed[0] eshopwebmvc_1 | The entity type ‘Address’ requires a primary key to be defined.

The error was repeated 10 times.

Next I tried just hitting “play” and running with IIS Express (no docker). It prompted me to trust the IIS Express certificate and then seemed to work fine. I haven’t tried running with a persistent SQL Server instance yet.

Thank you for the e-book (which I’ve just finished and will probably read at least one more time) and this sample app!

Jared

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
efleming18commented, Aug 23, 2019

@JaredPhelps Just an update for you, I’ve identified what the issue is, I’m just working on the proper fix for it. I hope to have something in, in the next couple days. I’ll explain more after I come up with the best solution but basically the the OwnsOne method on the OrderConfiguration should be treating Address like a value object, but it is trying to treat it as an entity.

Explicitly adding the [Owned] attribute to the Address model “fixes” it but I’m not sure why the fluent mapping isn’t working in the container. This is what I want to investigate further before closing it out.

Hope to have an update to you soon.

1reaction
efleming18commented, Aug 21, 2019

Hey @JaredPhelps - thanks for raising the issue. I was able to reproduce only in running from Docker. I will take a look tomorrow for sure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Running SQL Lite In-Memory Unit Tests in Docker ...
I ran into similar problem when using mcr.microsoft.com/dotnet/core/sdk:3.1. In order to run SaptiaLite in my test cases, I have to install ...
Read more >
Unable to save in-memory data in docker container: Invalid ...
I'm running mosquitto in a docker container. Log files can be stored without problems, but errors occur when trying to save in-memory data...
Read more >
Unable to restore database with in-memory optimized ...
Hi, I'm running mcr.microsoft.com/mssql/server docker image on macOS 12.4. ... in-memory optimized tables I receive the following error:.
Read more >
Database Connection Error on Ist run, not on subsequent ...
I am using get-started sample application for compose understanding so written following dockerfile and compose file. I have NOT created any ...
Read more >
Troubleshooting SQL Server Docker containers
If you get errors for any docker commands, make sure that the docker service is running, and try to run with elevated permissions....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found