Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

Docker container crashes on "view in browser" #525

Closed
AlexChesser opened this issue Dec 3, 2015 · 5 comments
Closed

Docker container crashes on "view in browser" #525

AlexChesser opened this issue Dec 3, 2015 · 5 comments

Comments

@AlexChesser
Copy link
Contributor

Note that this error can be replicated on a system with docker installed and using the contents of the following repo:

https://github.com/alexchesser/aspnet-docker-sample

steps:

  1. clone repo (or run yo aspnet with WebApplication as the destination)
  2. cd WebApplication
  3. EDIT ./Dockerfile - replace FROM microsoft/aspnet:1.0.0-rc1 with FROM microsoft/latest
  4. run docker build -t chesser-is-super-cool . (OK, the tag is optional)
  5. run docker run -P -d chesser-is-super-cool
  6. curl http://192.168.100.99:5000 (from host system) or run on docker as demonstrated below
PS C:\Users\Alex\www\aspnet-docker\WebApplication> dk run -p 5000:5000 aspnet_boilerplate
info: Microsoft.Data.Entity.Storage.Internal.RelationalCommandBuilderFactory[1]
      Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      PRAGMA foreign_keys=ON;
info: Microsoft.Data.Entity.Storage.Internal.RelationalCommandBuilderFactory[1]
      Executed DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
      User profile is available. Using '/root/.local/share/ASP.NET/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Production
Now listening on: http://*:5000/
Application started. Press Ctrl+C to shut down.
PS C:\Users\Alex\www\aspnet-docker\WebApplication> dm ssh default
                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015
Docker version 1.9.1, build a34a1d5
docker@default:~$ curl http://localhost:5000
curl: (52) Empty reply from server
docker@default:~$

SEE ERROR RESULTS:

info: Microsoft.Data.Entity.Storage.Internal.RelationalCommandBuilderFactory[1]
      Executed DbCommand (3ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      PRAGMA foreign_keys=ON;
info: Microsoft.Data.Entity.Storage.Internal.RelationalCommandBuilderFactory[1]
      Executed DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
      SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
      User profile is available. Using '/root/.local/share/ASP.NET/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
Hosting environment: Production
Now listening on: http://*:5000/
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
      Request starting HTTP/1.1 GET http://localhost/  

Unhandled Exception:
System.EntryPointNotFoundException: sqlite3_close_v2
  at (wrapper managed-to-native) Microsoft.Data.Sqlite.Interop.NativeMethods:sqlite3_close_v2 (intptr)
  at Microsoft.Data.Sqlite.Interop.Sqlite3Handle.ReleaseHandle () [0x00000] in <filename unknown>:0 
  at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0 
  at System.Runtime.InteropServices.SafeHandle.Finalize () [0x00000] in <filename unknown>:0 
@AlexChesser
Copy link
Contributor Author

FYI - a search for the error message reveals this is a SQLLITE error dotnet/efcore#3089

which appears to be solved by updating the sqlite image on the operating system.

Possible solution is to update the aspnet dockerfile OR update the dockerfile generator in this package.

I'll go looking for the aspnet docker image maintainers to see if I can fix the image.

@sayedihashimi
Copy link
Member

@glennc where should issues like this be reported?

@AlexChesser
Copy link
Contributor Author

It is tough to say actually. It appears this particular issue is caused by a dependency of the OmniSharp framework's generator image (https://github.com/aspnet/aspnet-docker) but is caused by an error in Entity Framework (dotnet/efcore#3089) but at the end of the day, it is THIS generator that doesn't work.. which, as a day-one entry point for new developers is actually pretty critical that it works without error. Otherwise novice & kick-the-can day 1 users may throw the entire framework out as "hopelessly broken" during that all important try-it-out phase. (like baby ducklings imprinting on a mamma, if the framework works, new developers are going to feel confident in rolling with it!)

So really at the end of the day, it's the generator's responsibility to both (a) test itself and (b) work.

Anyways - that's not me trying to be facetious or a jerk, I'm actually on a "hot lead" right now and may be able to fix this in a little bit (assuming a bit of luck and no whammies).

The PR will probably go to the aspnet-docker repository with and explanation and reference to the specific fixes listed here so your maintainers can decide whether to incorporate the fixes in as a workaround while waiting for the aspnet-docker team to get the code in.

EDIT: ... aannnd I just noticed you were asking someone other than me where to put this :) ooops.

@peterblazejewicz
Copy link
Member

THIS generator that doesn't work

The problem is simple. Ubuntu does not came with sqlite3 and default aspnet-docker image does not install it as not envisioned for x-platform usage (at least yet).
The other containers (projects) just works. The project uses default aspnet-docker images as in aspnet/home samples (the samples are not using EntityFramework)

peterblazejewicz added a commit that referenced this issue Dec 8, 2015
Issue #525 - Install sqlite3 at version required by EntityFramework.
This PR patches official aspnet-docker image with sqlite3 required by EntityFramework in web projects
Thanks @AlexChesser!
@peterblazejewicz
Copy link
Member

closed via: AlexChesser@af3cc85

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants