Azure / Azure/Azurite

500 Errors - Error: EMFILE: too many open files

Open
#1,967 20 comments 0 reactions 2 assignees Claimed by @EmmaZhu View on GitHub
bug Visual Studio
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

### Which service(blob, file, queue, table) does this issue concern?
Blob

### Which version of the Azurite was used?
3.20.1

### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
Visual Studio

### What's the Node.js version?
n/a

### What problem was encountered?
error: ErrorMiddleware: ErrorName=Error ErrorMessage=EMFILE: too many open files, open 'c:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\__blobstorage__\74924663-2a08-4213-8c52-74637ab9dd77' ErrorStack="Error: EMFILE: too many open files, open 'c:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\Extensions\\Microsoft\\Azure Storage Emulator\\__blobstorage__\\74924663-2a08-4213-8c52-74637ab9dd77'"

### Steps to reproduce the issue?
From debug log:
2023-04-19T00:09:59.105Z 831912d4-1317-445d-b45d-e9f6e62e8566 error: ErrorMiddleware: Received an error, fill error information to HTTP response
2023-04-19T00:09:59.105Z 831912d4-1317-445d-b45d-e9f6e62e8566 error: ErrorMiddleware: ErrorName=Error ErrorMessage=EMFILE: too many open files, open 'c:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\__blobstorage__\74924663-2a08-4213-8c52-74637ab9dd77' ErrorStack="Error: EMFILE: too many open files, open 'c:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\Extensions\\Microsoft\\Azure Storage Emulator\\__blobstorage__\\74924663-2a08-4213-8c52-74637ab9dd77'"
2023-04-19T00:09:59.105Z 831912d4-1317-445d-b45d-e9f6e62e8566 error: ErrorMiddleware: Set HTTP code: 500

### Have you found a mitigation/solution?
Killing and restarting Azurite resolves the issue immediately, but I'm looking for a better solution to avoid this in the first place. Is there anything that can be done to prevent this? SAS durations etc? Any way to monitor how many files it has open to see when the limit is being approached?

Still don't fully understand the issue and didn't have much look finding any existing documentation on it, any insight as to best practices and how to avoid this would be much appreciated!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.