azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

MacOsx upgrade from 3.0.3442 to 3.0.3477 introduces /dev/shm/AzureFunctions warning message

Open sceniclife opened this issue 3 years ago • 23 comments

Version 3.0.3442 starts without any warning (yellow) messages

Azure Functions Core Tools
Core Tools Version:       3.0.3442 Commit hash: 6bfab24b2743f8421475d996402c398d2fe4a9e0  (64-bit)

Version 3.0.3477 now starts with Operation not permitted message

Azure Functions Core Tools
Core Tools Version:       3.0.3477 Commit hash: 5fbb9a76fc00e4168f2cc90d6ff0afe5373afc6d  (64-bit)
Function Runtime Version: 3.0.15584.0

[2021-05-21T21:42:28.276Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-05-21T21:42:28.276Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

sceniclife avatar May 21 '21 21:05 sceniclife

Also seeing this.

Since /dev/shm does not exist on macOS I think the core tools should either not try to use it on macOS, or fail more gracefully/silently (i.e. not print a warning since this is pretty much to be expected on macOS).

Printing this warning only makes the experience noisier and risks distracting from legitimate warnings IMO.

DaRosenberg avatar May 22 '21 18:05 DaRosenberg

@pragnagopa @gohar94 this might be a scenario that wasn't completely covered. Wondering if shared memory should be completely disabled in local run scenarios.

fabiocav avatar May 25 '21 20:05 fabiocav

@fabiocav I think the use of this is disabled but the initialization attempt happens anyway. I agree, we should do the initialization only when this is enabled.

gohar94 avatar May 25 '21 20:05 gohar94

Thanks! Flagging this for consideration in sprint 103

fabiocav avatar May 26 '21 00:05 fabiocav

Moving to 105 as we're still iterating on the PR.

fabiocav avatar Jun 24 '21 20:06 fabiocav

Full stacktrace form the worker - we'll add a check on the worker as well to prevent this happening if the shared memory directory is not supported on any platform

Job host started
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-functions-core-tools@3/3.0.3477/workers/python/3.9/OSX/X64/azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_unix.py", line 127, in _get_valid_mem_map_dirs
    os.makedirs(dir_path)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 215, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 1] Operation not permitted: '/dev/shm'
Host lock lease acquired by instance ID '0000000000000000000000001A4849C5'.

vrdmr avatar Jun 24 '21 20:06 vrdmr

Some update about this problem... I have same issue...

Core Tools Version:       3.0.3568 Commit hash: e30a0ede85fd498199c28ad699ab2548593f759b  (64-bit)
Function Runtime Version: 3.0.15828.0

[2021-06-30T00:56:39.800Z] Found /Users/gildo.araujo/Projects/TesteTrigger/TesteTrigger/TesteTrigger.csproj. Using for user secrets file configuration.
[2021-06-30T00:56:40.836Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-06-30T00:56:40.836Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

Thanks

ggaj avatar Jun 30 '21 01:06 ggaj

Moving to 106 as we're still iterating on the PR

fabiocav avatar Jul 14 '21 20:07 fabiocav

For those who want to force installation of v3.0.3442, the following might help:

cd $(brew --repository)/Library/Taps/azure/homebrew-functions
git checkout Update_3.0.3442
HOMEBREW_NO_AUTO_UPDATE=1  brew install azure-functions-core-tools@3

stdtom avatar Jul 30 '21 21:07 stdtom

Taking ownership of this to complete the associated PR. Keeping in sprint 106 as we should still be able to make that date.

fabiocav avatar Aug 04 '21 20:08 fabiocav

Hi Team, I couldn't able to run func start --build on my mac os Big Sur v11.5.1

Due to issue

[2021-08-31T04:53:35.104Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions [2021-08-31T04:53:35.104Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

Any help?

janidama avatar Aug 31 '21 05:08 janidama

Hello all, just for information, same problem here even with the newest updates:

Extension bundle specified, skip install extension
Using port : ***

Azure Functions Core Tools
Core Tools Version:       3.0.3734 Commit hash: 61192bb28820be76916f85209916152801483456  (64-bit)
Function Runtime Version: 3.1.4.0

[2021-09-21T22:53:42.591Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-09-21T22:53:42.591Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

murilobeltrame avatar Sep 21 '21 23:09 murilobeltrame

Hello All, I have the same problem with CoreToolsVersion 3.0.3734

Azure Functions Core Tools
Core Tools Version:       3.0.3734 Commit hash: 61192bb28820be76916f85209916152801483456  (64-bit)
Function Runtime Version: 3.1.4.0

[2021-09-22T18:28:09.069Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-09-22T18:28:09.069Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

mdantuluru avatar Sep 22 '21 18:09 mdantuluru

Hi,

I have the same problem with asp.net Core

Azure Functions Core Tools
Core Tools Version:       3.0.3785 Commit hash: db6fe71b2f05d09757179d5618a07bba4b28826f  (64-bit)
Function Runtime Version: 3.2.0.0

lhpvolpi avatar Oct 15 '21 14:10 lhpvolpi

@michaelpeng36 can provide an update on when this will be fixed.

anthonychu avatar Oct 16 '21 23:10 anthonychu

Hi guys,

I have the same issue:

Found Python version 3.9.7 (python3).

Azure Functions Core Tools
Core Tools Version:       3.0.3785 Commit hash: db6fe71b2f05d09757179d5618a07bba4b28826f  (64-bit)
Function Runtime Version: 3.2.0.0

[2021-10-18T17:49:15.868Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-10-18T17:49:15.869Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.

MacOS Catalina 10.15.7 Any update on the fix? thank u 😊

IvanFerrante92 avatar Oct 18 '21 17:10 IvanFerrante92

I have the same issue on v3.0.3904

Azure Functions Core Tools
Core Tools Version:       3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206  (64-bit)
Function Runtime Version: 3.3.1.0

[2021-10-27T10:23:53.593Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-10-27T10:23:53.593Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
[2021-10-27T10:23:54.813Z] Debugger listening on ws://127.0.0.1:5858/b6324543-61b3-4459-90b0-bb94d4ce75a8

phillipharding avatar Oct 27 '21 10:10 phillipharding

Same issue.

**Mac M1 Pro - Monterrey **

`Core Tools Version: 3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206 (64-bit) Function Runtime Version: 3.3.1.0

[2022-02-14T19:30:49.444Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions [2022-02-14T19:30:49.449Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.`

andresogando avatar Feb 14 '22 19:02 andresogando

Same issue, has the really been an issue since May 2021, when will it be fixed ?

Mac M1 Pro - Monterrey

`Azure Functions Core Tools Core Tools Version: 3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206 (64-bit) Function Runtime Version: 3.3.1.0

[2022-02-17T16:24:35.901Z] Found /Users/peteth/javaprojects/Capgemini2016/BST/AZ204-course/AZ204-course.csproj. Using for user secrets file configuration.

[2022-02-17T16:24:36.487Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions [2022-02-17T16:24:36.488Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted. [2022-02-17T16:24:36.489Z] Valid directories for shared memory usage: `

PeteTh avatar Feb 18 '22 16:02 PeteTh

Hi, I fixed it by upgrading to core tools v4. follow these steps. go and make sure you click the docs for V4 https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Cmacos%2Ccsharp%2Cportal%2Cbash

andresogando avatar Feb 18 '22 18:02 andresogando

I get the same error with v4:

Core Tools Version: 4.0.4426 Commit hash: N/A (64-bit) Function Runtime Version: 4.1.3.17473

[2022-04-12T08:13:04.117Z] Traceback (most recent call last):
[2022-04-12T08:13:04.118Z]   File "/usr/local/Cellar/azure-functions-core-tools@4/4.0.4426/workers/python/3.9/OSX/X64/azure_functions_worker/bindings/shared_memory_data_transfer/file_accessor_unix.py", line 127, in _get_valid_mem_map_dirs
[2022-04-12T08:13:04.118Z]     os.makedirs(dir_path)
[2022-04-12T08:13:04.118Z]   File "/Users/tconte/.pyenv/versions/3.9.9/lib/python3.9/os.py", line 215, in makedirs
[2022-04-12T08:13:04.118Z]     makedirs(head, exist_ok=exist_ok)
[2022-04-12T08:13:04.118Z]   File "/Users/tconte/.pyenv/versions/3.9.9/lib/python3.9/os.py", line 225, in makedirs
[2022-04-12T08:13:04.118Z]     mkdir(name, mode)
[2022-04-12T08:13:04.118Z] PermissionError: [Errno 1] Operation not permitted: '/dev/shm'

tomconte avatar Apr 12 '22 08:04 tomconte

same here...

fmilagres avatar Apr 22 '22 19:04 fmilagres

Hi, I also get this error with v4:

Found Python version 3.9.9 (python3).

Azure Functions Core Tools Core Tools Version: 4.0.4483 Commit hash: N/A (64-bit) Function Runtime Version: 4.1.3.17473

LucasOleksak avatar Apr 27 '22 09:04 LucasOleksak