Giter Site home page Giter Site logo

autouri's People

Contributors

leepc12 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

vsmalladi

autouri's Issues

Issues with updating GCS object

I am using caper, which I have integrated into my own application as a library in order to provide a convenient API around Cromwell.

While submitting a workflow to Cromwell using , using a local WDL file, and an inputs JSON file located in Google Cloud Storage, I am having some issues that I have traced to AutoURI that perhaps you could help me with.

For some reason, the PUT call from the following code returns a 403 Forbidden (Access Denied) error from the Google Cloud Storage APIs. This is strange, because the principal trying to make the call, has full roles/storage.admin (Storage Admin) permissions on the Google Cloud Project. The Google Cloud Policy Analyzer confirms that it should have no issues accessing/updating the object.

autouri/autouri/gcsuri.py

Lines 270 to 274 in 73d97ac

dest_uri.mkdir_dirname()
# mtime is not updated without update().
src_blob.update()
src_blob.download_to_filename(dest_uri._uri)
return True

I also know that this shouldn't be failing like this, because a few milliseconds seconds earlier, my application makes a number of successful requests to the bucket, including a POST request that uploads the inputs JSON file.

I believe this might have to do with the object having just been uploaded a few seconds earlier. I suspect that the a-time (which is I assume what the comment means) cannot be updated when the upload time is so soon.

I was wondering if you had any insight into this? I know it's definitely a Google Cloud Error, but I'm wondering if this is an issue that you might have seen before.

Here's a full stack trace showing the interaction with caper:

  File "/opt/dashboard/server/handlers/submit_handler.py", line 216, in post
    submitted = server.submit_client.submit(wdl=str(wdl_path), inputs=config_path)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/caper/caper_client.py", line 343, in submit
    inputs = AutoURI(maybe_remote_file).localize_on(work_dir)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/autouri/autouri.py", line 409, in localize_on
    return AutoURI.localize(
           ^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/autouri/autouri.py", line 646, in localize
    src_uri.cp(
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/autouri/autouri.py", line 338, in cp
    if not self._cp(dest_uri=d):
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/autouri/gcsuri.py", line 272, in _cp
    src_blob.update()
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/google/cloud/storage/_helpers.py", line 433, in update
    api_response = client._put_resource(
                   ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/google/cloud/storage/client.py", line 555, in _put_resource
    return self._connection.api_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/google/cloud/storage/_http.py", line 72, in api_request
    return call()
           ^^^^^^
  File "/opt/dashboard/server/venv/lib/python3.11/site-packages/google/cloud/_http/__init__.py", line 494, in api_request
    raise exceptions.from_http_response(response)
google.api_core.exceptions.Forbidden: 403 PUT https://storage.googleapis.com/storage/v1/b/my-bucket/o/config%input.json?generation=1704960651986132&projection=full&prettyPrint=false: Access denied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.