Form Recognizer Custom docker containers fail to start

Alan 1 Reputation point
2021-10-05T00:39:36.04+00:00

I am following the instructions on https://learn.microsoft.com/en-us/azure/applied-ai-services/form-recognizer/containers/form-recognizer-container-install-run?tabs=custom to deploy on-premise Form Recognizer Custom docker containers.

The steps I followed are on the Custom tab: settng up the .env, nginx.conf, docker-compose.yml, output and shared folders, sample data, etc

However when I run the docker-compose script, both custom-api and custom-supervised containers fail to launch with this error:

azure-cognitive-service-custom-api | Unhandled exception. System.UnauthorizedAccessException: Access to the path '/proc/1/map_files' is denied.
azure-cognitive-service-custom-api | ---> System.IO.IOException: Operation not permitted
azure-cognitive-service-custom-api | --- End of inner exception stack trace ---
azure-cognitive-service-custom-api | at System.IO.Enumeration.FileSystemEnumerator1.FindNextEntry(Byte* entryBufferPtr, Int32 bufferLength) azure-cognitive-service-custom-api | at System.IO.Enumeration.FileSystemEnumerator1.MoveNext()
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.RunningInstance.AddDirectoryWatchUnlocked(WatchedDirectory parent, String directoryName)
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.RunningInstance..ctor(FileSystemWatcher watcher, SafeFileHandle inotifyHandle, String directoryPath, Boolean includeSubdirectories, NotifyFilters notifyFilters, CancellationToken cancellationToken)
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.StartRaisingEvents()
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
azure-cognitive-service-custom-api | at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
azure-cognitive-service-custom-api | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
azure-cognitive-service-custom-api | at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
azure-cognitive-service-custom-api | at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
azure-cognitive-service-custom-api | at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b_1_0()
azure-cognitive-service-custom-api | at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration1..ctor(Func1 changeTokenProducer, Action1 changeTokenConsumer, TState state) azure-cognitive-service-custom-api | at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func1 changeTokenProducer, Action changeTokenConsumer)
azure-cognitive-service-custom-api | at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
azure-cognitive-service-custom-api | at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
azure-cognitive-service-custom-api | at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
azure-cognitive-service-custom-api | at Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.<>c_DisplayClass2_0.<UseKeyVault>b_0(WebHostBuilderContext context, IConfigurationBuilder config)
azure-cognitive-service-custom-api | at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c_DisplayClass8_0.<ConfigureAppConfiguration>b_0(HostBuilderContext context, IConfigurationBuilder builder)
azure-cognitive-service-custom-api | at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()
azure-cognitive-service-custom-api | at Microsoft.Extensions.Hosting.HostBuilder.Build()
azure-cognitive-service-custom-api | at Microsoft.CloudAI.Containers.Program.Main(String[] args)

The images used are
mcr.microsoft.com/azure-cognitive-services/form-recognizer/custom-api
mcr.microsoft.com/azure-cognitive-services/form-recognizer/custom-supervised

What has gone wrong here?

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,524 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,615 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andy Green 1 Reputation point
    2022-09-22T09:10:46.93+00:00

    I believe this is caused by running with the working directory being the root of the file system causing the AspNetCore web host to look for config files in system directories.
    Set the current working directory to be somewhere safe and the problem should go away.

    0 comments No comments