You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "jayceslesar (via GitHub)" <gi...@apache.org> on 2023/10/04 13:16:36 UTC

[I] Writing to AWS S3 fails when using `aws sso` [arrow]

jayceslesar opened a new issue, #38013:
URL: https://github.com/apache/arrow/issues/38013

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   My org recently switched to using aws sso to configure all of our access and when making the swap, we noticed that we are no longer able to write to S3 when using these types of credentials.  When explicitly setting the `AWS_SECRET_ACCESS_KEY` and `AWS_ACCESS_KEY_ID` with previous IAM User accounts, the problem does not exist. For reference, once authenticating with `aws sso login` and attempting to write some data, I am thrown the following error:
   
   ```
     File "pyarrow/_dataset.pyx", line 3844, in pyarrow._dataset._filesystemdataset_write
     File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
   OSError: When testing for existence of bucket 'my-s3-bucket': AWS Error ACCESS_DENIED during HeadBucket operation: No response body.
   ```
   
   
   ### Component(s)
   
   Parquet


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "drauschenbach (via GitHub)" <gi...@apache.org>.
drauschenbach commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-2037861434

   C++ hack:
   
   ```sh
   $ eval $(aws configure export-credentials --format env)
   ```
   
   ```c++
   std::string access_key = std::getenv("AWS_ACCESS_KEY_ID");
   std::string secret_key = std::getenv("AWS_SECRET_ACCESS_KEY");
   std::string session_token = std::getenv("AWS_SESSION_TOKEN");
   
   arrow::fs::S3Options options;
   options.ConfigureAccessKey(access_key, secret_key, session_token)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "jayceslesar (via GitHub)" <gi...@apache.org>.
jayceslesar commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1771570955

   Thanks @rdbisme! it also looks like explicitly passing in an initialized `s3fs.S3FileSystem` class works as well


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "rdbisme (via GitHub)" <gi...@apache.org>.
rdbisme commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1762031334

   I have a similar problem: `OSError: When resolving region for bucket 's3': AWS Error UNKNOWN (HTTP status 400) during HeadBucket operation: No response body.`
   
   This started happening after I've updated `aws cli` and re-configured the SSO.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "rdbisme (via GitHub)" <gi...@apache.org>.
rdbisme commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1762034525

   I have a similar problem that started happening after I've updated `aws cli` and reconfigured my sso session.
   
   ```
     File "/home/xxx/git/xxx-xxx-ci/xxx_xxx_ci/auto_check/xxx.py", line 28, in compute_xxxs_from_artifact
       historical_xxxs = pd.read_parquet(historical_xxxs_path)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/home/xxx/.cache/pypoetry/virtualenvs/xxx-xxx-ci-0hW5Yow_-py3.11/lib/python3.11/site-packages/pandas/io/parquet.py", line 670, in read_parquet
       return impl.read(
              ^^^^^^^^^^
     File "/home/xxx/.cache/pypoetry/virtualenvs/xxx-xxx-ci-0hW5Yow_-py3.11/lib/python3.11/site-packages/pandas/io/parquet.py", line 265, in read
       path_or_handle, handles, filesystem = _get_path_or_handle(
                                             ^^^^^^^^^^^^^^^^^^^^
     File "/home/xxx/.cache/pypoetry/virtualenvs/xxx-xxx-ci-0hW5Yow_-py3.11/lib/python3.11/site-packages/pandas/io/parquet.py", line 116, in _get_path_or_handle
       fs, path_or_handle = pa_fs.FileSystem.from_uri(path)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "pyarrow/_fs.pyx", line 470, in pyarrow._fs.FileSystem.from_uri
     File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
     File "pyarrow/error.pxi", line 115, in pyarrow.lib.check_status
   OSError: When resolving region for bucket 's3': AWS Error UNKNOWN (HTTP status 400) during HeadBucket operation: No response body.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "rdbisme (via GitHub)" <gi...@apache.org>.
rdbisme commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1764307519

   Wrapping the call around `fsspec` should work. But it's potentially slower and more memory hungry. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "jayceslesar (via GitHub)" <gi...@apache.org>.
jayceslesar commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-2805027264

   > C++ hack:
   > 
   > $ eval $(aws configure export-credentials --format env)
   > std::string access_key = std::getenv("AWS_ACCESS_KEY_ID");
   > std::string secret_key = std::getenv("AWS_SECRET_ACCESS_KEY");
   > std::string session_token = std::getenv("AWS_SESSION_TOKEN");
   > 
   > arrow::fs::S3Options options;
   > options.ConfigureAccessKey(access_key, secret_key, session_token)
   
   This works fine for any local development and I have been using for a while at this point


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "rdbisme (via GitHub)" <gi...@apache.org>.
rdbisme commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1771539103

   ```
   s3_path = "s3://my-bucket/path"
   with fsspec.open(s3_path, "wb") as file_stream:
                 df.to_parquet(file_stream)
   ```
   
   should work (didn't test, but I think it does). @jayceslesar let me know!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "jayceslesar (via GitHub)" <gi...@apache.org>.
jayceslesar commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-1771490448

   > Wrapping the call around `fsspec` should work. But it's potentially slower and more memory hungry.
   
   @rdbisme can you share what you mean with an example?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [C++] Writing to AWS S3 fails when using `aws sso` (13.0.0) [arrow]

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on issue #38013:
URL: https://github.com/apache/arrow/issues/38013#issuecomment-2091035263

   As a starting point, someone should post in that issue 1) what they are doing precisely 2) how it can/should be made to work. Currently the discussion seems to assume Arrow developers are S3 experts, which they are not.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org