Skip to content

Download issue #744

Description

@joehart2001

Summary

error when downloading data:

ml_peg download --key app/data/data.tar.gz  --filename data.tar.gz
╭──────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────╮
│ /Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/ml_peg/cli/cli.py:625 in download                     │
│                                                                                                                                                                           │
│   622 │   """                                                                                                                                                             │
│   623 │   from ml_peg.data.data import download as download_data                                                                                                          │
│   624 │                                                                                                                                                                   │
│ ❱ 625 │   download_data(                                                                                                                                                  │
│   626 │   │   key=key,                                                                                                                                                    │
│   627 │   │   filename=filename,                                                                                                                                          │
│   628 │   │   bucket=bucket,                                                                                                                                              │
│                                                                                                                                                                           │
│ /Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/ml_peg/data/data.py:59 in download                    │
│                                                                                                                                                                           │
│    56 │   # Ensure directory exists before download                                                                                                                       │
│    57 │   Path(filename).parent.mkdir(parents=True, exist_ok=True)                                                                                                        │
│    58 │                                                                                                                                                                   │
│ ❱  59 │   object_size = s3.head_object(Bucket=bucket, Key=key)["ContentLength"]                                                                                           │
│    60 │   with tqdm.tqdm(                                                                                                                                                 │
│    61 │   │   total=object_size, unit="B", unit_scale=True, desc=str(filename)                                                                                            │
│    62 │   ) as pbar:                                                                                                                                                      │
│                                                                                                                                                                           │
│ /Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/.venv/lib/python3.12/site-packages/botocore/client.py │
│ :606 in _api_call                                                                                                                                                         │
│                                                                                                                                                                           │
│    603 │   │   │   │   │   f"{py_operation_name}() only accepts keyword arguments."                                                                                       │
│    604 │   │   │   │   )                                                                                                                                                  │
│    605 │   │   │   # The "self" in this scope is referring to the BaseClient.                                                                                             │
│ ❱  606 │   │   │   return self._make_api_call(operation_name, kwargs)                                                                                                     │
│    607 │   │                                                                                                                                                              │
│    608 │   │   _api_call.__name__ = str(py_operation_name)                                                                                                                │
│    609                                                                                                                                                                    │
│                                                                                                                                                                           │
│ /Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/.venv/lib/python3.12/site-packages/botocore/context.p │
│ y:123 in wrapper                                                                                                                                                          │
│                                                                                                                                                                           │
│   120 │   │   │   with start_as_current_context():                                                                                                                        │
│   121 │   │   │   │   if hook:                                                                                                                                            │
│   122 │   │   │   │   │   hook()                                                                                                                                          │
│ ❱ 123 │   │   │   │   return func(*args, **kwargs)                                                                                                                        │
│   124 │   │                                                                                                                                                               │
│   125 │   │   return wrapper                                                                                                                                              │
│   126                                                                                                                                                                     │
│                                                                                                                                                                           │
│ /Users/joehart/Desktop/0_Cambridge/0_MPhil_Scientific_Computing/MPhil_project/mlipx_testing/new_format/mlip-testing/.venv/lib/python3.12/site-packages/botocore/client.py │
│ :1094 in _make_api_call                                                                                                                                                   │
│                                                                                                                                                                           │
│   1091 │   │   │   │   'error_code_override'                                                                                                                              │
│   1092 │   │   │   ) or error_info.get("Code")                                                                                                                            │
│   1093 │   │   │   error_class = self.exceptions.from_code(error_code)                                                                                                    │
│ ❱ 1094 │   │   │   raise error_class(parsed_response, operation_name)                                                                                                     │
│   1095 │   │   else:                                                                                                                                                      │
│   1096 │   │   │   return parsed_response                                                                                                                                 │
│   1097                                                                                                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden

Platform

macOS

Python version

3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions