mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.35k stars 1.22k forks source link

FileStorage on core aspnet image #1243

Open jkaberli opened 5 years ago

jkaberli commented 5 years ago

This works locally on my windows 10 machine. Was originally developed on an ubuntu 19.04 machine.

Trying to move this up to host inside a docker image: mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine, it appears all the Find queries to the FileStorage collection are not working. Other query operations that are not FileStorage seem to work ok. I can add/query/edit documents in other collections.

The two queries I am primarly using (from LiteStorage) are:

LiteDB.LiteStorage.OpenRead(String id) //throws LiteException (File '$/attachments/3/test.jpg' not found.)
IEnumerable<LiteFileInfo> Find(string startsWith) //always returns empty

LiteDB version: 4.1.4

target framework: netcoreapp2.2

stack trace:

at LiteDB.LiteStorage.OpenRead(String id)
...

I can see the files are there in LiteDbExplorer. If I move my local database up to the docker host, none of the files in FileStorage work, yet I can query other collections without issue.

jkaberli commented 5 years ago

I managed to get around this by switching to an ubuntu image and installing dotnet core runtime myself following the manual install instructions here: https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/runtime-current