Docker causing exception in .netcore based image


Recommended Posts

I am a C# developer which runs Unraid at home. I use docker on Unraid to (for example) run an API so that I can test some stuff, but ever since the fixes for the SQLite corruption (not related, but for time frame, I think version 6.8 ?) my Docker can not start .netcore projects anymore.

 

I have been debugging this for the last couple of days now, but in the end it seems that even the most basic empty project causes the same exceptions. 

Unhandled exception. System.IO.IOException: Input/output error
at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry(Byte* entryBufferPtr, Int32 bufferLength)
at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
at System.IO.FileSystemWatcher.RunningInstance..ctor(FileSystemWatcher watcher, SafeFileHandle inotifyHandle, String directoryPath, Boolean includeSubdirectories, NotifyFilters notifyFilters, CancellationToken cancellationToken)
at System.IO.FileSystemWatcher.StartRaisingEvents()
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__1_0()
at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at UnraidFail.Program.Main(String[] args) in /app/UnraidFail/Program.cs:line 16

I also have been testing this, running Docker on my Macbook, where the Docker I created for this, runs without a hitch. (source code here: https://git.x77.nl/depl0y/UnraidFail/src/branch/master ). In that repository is a Dockerfile that can be used to test this. It downloads the source of that repository to the Docker itself, compiles it and creates a runnable application. The application is actually an example project from Visual Studio itself.

 

I cannot downgrade to an earlier version of Unraid, because that will break my Plex and Sonarr. I also tried upgrading to the latest 6.9.0-beta1 version, but that didn't help either.

 

I know this is a very specific case and googling for anything like this results in nothing usable. Maybe someone can try running this, so I know it isn't my Unraid install?

 

titan-diagnostics-20200609-0714.zip

Edited by depl0y
Help!
Link to comment

Update time: I finally gave up and opened an account at a Docker hosting service. When running my docker there, I also received an exception, but there the exception was a lot more descriptive:

 

Unhandled Exception: System.UnauthorizedAccessException: Access to the path '/proc/1/map_files' is denied. ---> System.IO.IOException: Operation not permitted,
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher(),
   at System.IO.FileSystemWatcher.RunningInstance..ctor(FileSystemWatcher watcher, SafeFileHandle inotifyHandle, String directoryPath, Boolean includeSubdirectories, NotifyFilters notifyFilters, CancellationToken cancellationToken),
   at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName),
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed(),
   at System.IO.FileSystemWatcher.StartRaisingEvents(),
   at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value),
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter),
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer),
   at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source),
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors),
   at ChangeCore.Program.Main(String[] args) in F:\ChangeCore\ChangeCore\Program.cs:line 17,
   at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build(),
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build(),
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder),
   at System.IO.Enumeration.FileSystemEnumerator`1.FindNextEntry(),
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext(),
   --- End of inner exception stack trace ---

 

Googling that message gave me the following github issue: https://github.com/dotnet/dotnet-docker/issues/485

 

It seems that since a certain version of Docker, it seems necessary to add a WORKDIR to the Dockerfile, which I only did for the building of the application and not the running.

 

So, problem solved.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.