Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4861

hatch failing with Permission denied on macOS

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      hatch failing with Permission denied on macOS

       [2024/10/11 12:10:16.257] + run_hatch test:test-eg
       [2024/10/11 12:10:16.257] + python -m hatch run test:test-eg
       [2024/10/11 12:10:16.257] Creating environment: test
       [2024/10/11 12:10:16.475] ╭───────────────────── Traceback (most recent call last) ──────────────────────╮
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/cli/__init__.py:221 in main               │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   218                                                                        │
       [2024/10/11 12:10:16.475] │   219 def main():  # no cov                                                  │
       [2024/10/11 12:10:16.475] │   220 │   try:                                                               │
       [2024/10/11 12:10:16.475] │ ❱ 221 │   │   hatch(prog_name='hatch', windows_expand_args=False)            │
       [2024/10/11 12:10:16.475] │   222 │   except Exception:  # noqa: BLE001                                  │
       [2024/10/11 12:10:16.475] │   223 │   │   import sys                                                     │
       [2024/10/11 12:10:16.475] │   224                                                                        │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:1157 in __call__                  │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:1078 in main                      │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:1688 in invoke                    │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:1434 in invoke                    │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:783 in invoke                     │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/decorators.py:33 in new_func              │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/cli/run/__init__.py:147 in run            │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   144 │   elif not env_name:                                                 │
       [2024/10/11 12:10:16.475] │   145 │   │   env_name = 'system'                                            │
       [2024/10/11 12:10:16.475] │   146 │                                                                      │
       [2024/10/11 12:10:16.475] │ ❱ 147 │   ctx.invoke(                                                        │
       [2024/10/11 12:10:16.475] │   148 │   │   run_command,                                                   │
       [2024/10/11 12:10:16.475] │   149 │   │   args=[command, *final_args],                                   │
       [2024/10/11 12:10:16.475] │   150 │   │   env_names=[env_name],                                          │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/core.py:783 in invoke                     │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/click/decorators.py:45 in new_func              │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/cli/env/run.py:134 in run                 │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   131 │   elif not matrix_selected and (included_variables or excluded_varia │
       [2024/10/11 12:10:16.475] │   132 │   │   app.abort(f'Variable selection is unsupported for non-matrix e │
       [2024/10/11 12:10:16.475] │   133 │                                                                      │
       [2024/10/11 12:10:16.475] │ ❱ 134 │   for context in app.runner_context(                                 │
       [2024/10/11 12:10:16.475] │   135 │   │   environments,                                                  │
       [2024/10/11 12:10:16.475] │   136 │   │   ignore_compat=ignore_compat or matrix_selected,                │
       [2024/10/11 12:10:16.475] │   137 │   │   display_header=matrix_selected,                                │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/cli/application.py:224 in runner_context  │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   221 │   │   │   │   context = ExecutionContext(environment)                │
       [2024/10/11 12:10:16.475] │   222 │   │   │   │   yield context                                          │
       [2024/10/11 12:10:16.475] │   223 │   │   │   │                                                          │
       [2024/10/11 12:10:16.475] │ ❱ 224 │   │   │   │   self.prepare_environment(environment)                  │
       [2024/10/11 12:10:16.475] │   225 │   │   │   │   with EnvVars(context.env_vars):                        │
       [2024/10/11 12:10:16.475] │   226 │   │   │   │   │   self.run_shell_commands(context)                   │
       [2024/10/11 12:10:16.475] │   227                                                                        │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/cli/application.py:111 in                 │
       [2024/10/11 12:10:16.475] │ prepare_environment                                                          │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   108 │   │   │   self.env_metadata.reset(environment)                       │
       [2024/10/11 12:10:16.475] │   109 │   │   │                                                              │
       [2024/10/11 12:10:16.475] │   110 │   │   │   with environment.app_status_creation():                    │
       [2024/10/11 12:10:16.475] │ ❱ 111 │   │   │   │   environment.create()                                   │
       [2024/10/11 12:10:16.475] │   112 │   │   │                                                              │
       [2024/10/11 12:10:16.475] │   113 │   │   │   if not environment.skip_install:                           │
       [2024/10/11 12:10:16.475] │   114 │   │   │   │   if environment.pre_install_commands:                   │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/env/virtual.py:158 in create              │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   155 │   │   │   │   )                                                      │
       [2024/10/11 12:10:16.475] │   156 │   │                                                                  │
       [2024/10/11 12:10:16.475] │   157 │   │   with self.expose_uv():                                         │
       [2024/10/11 12:10:16.475] │ ❱ 158 │   │   │   self.virtual_env.create(self.parent_python, allow_system_p │
       [2024/10/11 12:10:16.475] │   159 │                                                                      │
       [2024/10/11 12:10:16.475] │   160 │   def remove(self):                                                  │
       [2024/10/11 12:10:16.475] │   161 │   │   self.virtual_env.remove()                                      │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/venv/core.py:49 in create                 │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │    46 │   │   # WARNING: extremely slow import                               │
       [2024/10/11 12:10:16.475] │    47 │   │   from virtualenv import cli_run                                 │
       [2024/10/11 12:10:16.475] │    48 │   │                                                                  │
       [2024/10/11 12:10:16.475] │ ❱  49 │   │   self.directory.ensure_parent_dir_exists()                      │
       [2024/10/11 12:10:16.475] │    50 │   │                                                                  │
       [2024/10/11 12:10:16.475] │    51 │   │   command = [str(self.directory), '--no-download', '--no-periodi │
       [2024/10/11 12:10:16.475] │    52                                                                        │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Users/ec2-user/data/mci/46fb6f1fd231c5ab6397fe19892a2771/src/hatchenv-2635/ │
       [2024/10/11 12:10:16.475] │ lib/python3.10/site-packages/hatch/utils/fs.py:55 in                         │
       [2024/10/11 12:10:16.475] │ ensure_parent_dir_exists                                                     │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │    52 │   │   self.mkdir(parents=True, exist_ok=True)                        │
       [2024/10/11 12:10:16.475] │    53 │                                                                      │
       [2024/10/11 12:10:16.475] │    54 │   def ensure_parent_dir_exists(self) -> None:                        │
       [2024/10/11 12:10:16.475] │ ❱  55 │   │   self.parent.mkdir(parents=True, exist_ok=True)                 │
       [2024/10/11 12:10:16.475] │    56 │                                                                      │
       [2024/10/11 12:10:16.475] │    57 │   def expand(self) -> Path:                                          │
       [2024/10/11 12:10:16.475] │    58 │   │   return Path(os.path.expanduser(os.path.expandvars(self)))      │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │ /Library/Frameworks/Python.Framework/Versions/3.10/lib/python3.10/pathlib.py │
       [2024/10/11 12:10:16.475] │ :1173 in mkdir                                                               │
       [2024/10/11 12:10:16.475] │                                                                              │
       [2024/10/11 12:10:16.475] │   1170 │   │   Create a new directory at this given path.                    │
       [2024/10/11 12:10:16.475] │   1171 │   │   """                                                           │
       [2024/10/11 12:10:16.475] │   1172 │   │   try:                                                          │
       [2024/10/11 12:10:16.475] │ ❱ 1173 │   │   │   self._accessor.mkdir(self, mode)                          │
       [2024/10/11 12:10:16.475] │   1174 │   │   except FileNotFoundError:                                     │
       [2024/10/11 12:10:16.475] │   1175 │   │   │   if not parents or self.parent == self:                    │
       [2024/10/11 12:10:16.475] │   1176 │   │   │   │   raise                                                 │
       [2024/10/11 12:10:16.475] ╰──────────────────────────────────────────────────────────────────────────────╯
       [2024/10/11 12:10:16.475] PermissionError: [Errno 13] Permission denied:
       [2024/10/11 12:10:16.475] '/Users/ec2-user/Library/Application Support/hatch/env/virtual/pymongo/LmJw0Y8H'
      

      https://evergreen.mongodb.com/task/mongo_python_driver_test_macos__platform~macos_auth~auth_ssl~ssl_test_latest_sharded_cluster_4eeaa4b7be9e814fd207166904f42556c10ce63b_24_10_11_18_56_43

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: