Orchard Core 2.0.2 - Error after some calls to the API endpoints: Status:BadRequest Error: {\"status\":\"Error: - The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.\",\"item\":null}
#17231
Replies: 3 comments 7 replies
-
I’m not sure if overwriting the appsettings and reloading them in var builder = WebApplication.CreateBuilder(args);
// builder.Configuration.Sources.Clear(); // Remove current configuration sources - REMOVED because Docker was returning error with this
builder.Configuration
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: false) // Add the appsettings.json file without reloadOnChange
.AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true, reloadOnChange: false) // As last configuration load the one based on the Environment
.AddEnvironmentVariables();
builder.Services
.AddOrchardCms()
.ConfigureServices(services =>
{
ConfigurationModel config = builder.Configuration.Get<ConfigurationModel>();
if (config == null)
{
throw new Exception("Was impossible to retrieve the appsettings.json configuration, that are necessary to instantiate the Handler classes. Please check the appsettings file.");
}
[...]
|
Beta Was this translation helpful? Give feedback.
-
You could try increasing the limit of the container so it's higher than 128. Are you running lots of tenants on the server where you encounter this problem? Does your application cause lots of tenant reloads? You should write the application logs to a mounted volume so they are not lost during a crash and then check out the app logs for more clues to see why there are lots of file change notifications are happening. Does this happen with a specific tenant or all tenants? |
Beta Was this translation helpful? Give feedback.
-
have you tried using
|
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
in my Books microservice, which is a headless Orchard Core 2.0.2 app (I need to update it to the latest), I have some API endpoints used to retrieve books. However, after a few calls from the frontend, Orchard Core stops working and throws this error:
Status:BadRequest Error: {\"status\":\"Error: - The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.\",\"item\":null}
To make it working again I need to recreate the Docker container.
After searching online, it seems this issue is caused by the
reloadOnChanges
option for AppSettings being set totrue
(see this explanation). Additionally, it appears to primarily occur in non-Windows environments (see this). I'm using a Linux Docker container to host my Books microservice.Does anyone know how I can set
reloadOnChanges
tofalse
in myProgram.cs
?@Piedone @MikeAlhayek, any suggestions? 🙏
Thank you
Below is my
Program.cs
where I retrieve the configuration to pass it to my handler:Beta Was this translation helpful? Give feedback.
All reactions