question

AbbieWeisenbloom-9406 avatar image
7 Votes"
AbbieWeisenbloom-9406 asked JonathanCrockett-6381 published

Azure Functions Core Tools error (OSX) : /dev/shm/AzureFunctions - shared memory usage

I'm running on OSX and am getting the following error when running func start in VSCODE terminal on a function project. Why is Azure Functions trying to create a shared memory directory on /dev/shm when there's no write access to /dev directory? I realized that the function still runs but the error persists.

 (.venv) (base) Me@me-mbp CreateAnAzureFunction % func start          
 Found Python version 3.7.2 (python3).
 Azure Functions Core Tools
 Core Tools Version:       3.0.3477 Commit hash: <hash> (64-bit)
 Function Runtime Version: 3.0.15584.0
 [2021-05-16T05:44:42.667Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
 [2021-05-16T05:44:42.669Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
 [2021-05-16T05:44:44.209Z] Traceback (most recent call last):
 [2021-05-16T05:44:44.209Z]   File "/usr/local/Cellar/azure-functions-core-tools@3/3.0.3477/workers/python/3.7/OSX/X64/azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_unix.py", line 127, in _get_valid_mem_map_dirs
 [2021-05-16T05:44:44.209Z]     os.makedirs(dir_path)
 [2021-05-16T05:44:44.209Z]   File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 211, in makedirs
 [2021-05-16T05:44:44.209Z]     makedirs(head, exist_ok=exist_ok)
 [2021-05-16T05:44:44.209Z]   File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 221, in makedirs
 [2021-05-16T05:44:44.209Z]     mkdir(name, mode)
 [2021-05-16T05:44:44.209Z] PermissionError: [Errno 1] Operation not permitted: '/dev/shm'
 [2021-05-16T05:44:44.306Z] Worker process started and initialized.
 Functions:
         Review: [GET,POST] http://localhost:7071/api/Review


azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PramodValavala-MSFT avatar image
1 Vote"
PramodValavala-MSFT answered JonathanCrockett-6381 published

@AbbieWeisenbloom-9406 This is part of the python worker as part of this feature that adds support for shared memory between the runtime and the worker.

The log that you see is a warning (check this line) and considering the worker does eventually start, another location worked.


· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


 WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
 You should consider upgrading via the '/Users/vinay/Documents/_projects/azure/newFunctionProject/.venv/bin/python -m pip install --upgrade pip' command.
    
 > Executing task: . .venv/bin/activate && func host start <
    
 Found Python version 3.9.1 (python3).
    
 Azure Functions Core Tools
 Core Tools Version:       3.0.3568 Commit hash: e30a0ede85fd498199c28ad699ab2548593f759b  (64-bit)
 Function Runtime Version: 3.0.15828.0
    
 [2021-06-19T07:20:46.190Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
 [2021-06-19T07:20:46.190Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
 Value cannot be null. (Parameter 'provider')
2 Votes 2 ·

I get stuck here, what is the solution to this?

1 Vote 1 ·

Go to the host.json file in your project, remove the section of "extensionBundle" and run it again.

0 Votes 0 ·

Thank you for clarifying that for me!

0 Votes 0 ·

Is anyone fix the issue ? I have the same problem.

0 Votes 0 ·

I am seeing this issue as well using Node on Mac OS.

0 Votes 0 ·
AndrewJunzki-0769 avatar image
0 Votes"
AndrewJunzki-0769 answered

I've lookup /dev in my macOS, and there is no device named /dev/shm found.

Searched web for answers, /dev/shm maps shared memory, and it seems to have some difference between Linux and macOS on mapping shared memory.

https://stackoverflow.com/questions/31278519/location-of-dev-shm-on-mac-os-x

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.