Title: Uploading files that share the same base filename to S3 can overwrite each other · Issue #294 · shotgunsoftware/python-api · GitHub
Open Graph Title: Uploading files that share the same base filename to S3 can overwrite each other · Issue #294 · shotgunsoftware/python-api
X Title: Uploading files that share the same base filename to S3 can overwrite each other · Issue #294 · shotgunsoftware/python-api
Description: When performing an upload via the SG API, we have multiple files that share a common filename but are in completely different paths. If we try to upload both of those simultaneously, the AWS upload URL is the same for both. In _upload_to...
Open Graph Description: When performing an upload via the SG API, we have multiple files that share a common filename but are in completely different paths. If we try to upload both of those simultaneously, the AWS upload...
X Description: When performing an upload via the SG API, we have multiple files that share a common filename but are in completely different paths. If we try to upload both of those simultaneously, the AWS upload...
Opengraph URL: https://github.com/shotgunsoftware/python-api/issues/294
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Uploading files that share the same base filename to S3 can overwrite each other","articleBody":"When performing an upload via the SG API, we have multiple files that share a common filename but are in completely different paths. If we try to upload both of those simultaneously, the AWS upload URL is the same for both.\r\n\r\nIn `_upload_to_storage()`, `os.path.basename(path)` is passed to the `_get_attachment_upload_info` call. On the AWS side, that means that no matter the parent directory, any file that shares the base name will get a duplicate upload URL.\r\n\r\nThis only occurs if the `_upload_to_storage()` call happens concurrently : I'm guessing that the SG backend uses a timestamp to differentiate calls, because currently we do this about 30 times, but only when multiple get called at the same time do we get a duplicate upload URL.\r\n\r\n[The culprit line is here](https://github.com/shotgunsoftware/python-api/blob/b3ebbb5664c01b3e98bfd8ee5ffa32da0e3e5c0c/shotgun_api3/shotgun.py#L2483C19-L2483C19).\r\n\r\nRecommend changing:\r\n`filename = os.path.basename(path)`\r\nto something like:\r\n`filename = os.path.abspath(path)`","author":{"url":"https://github.com/briansmith-epic","@type":"Person","name":"briansmith-epic"},"datePublished":"2023-08-14T08:53:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/294/python-api/issues/294"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b905becd-f3fd-1f67-b72f-a4b933a55bfa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8180:24CD64:1D66587:26FA86E:696AFF3E |
| html-safe-nonce | 198af548ab6eeca8fc8d9f8816f94a0e7a6623d907aecc0e40437cf8d2859a52 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTgwOjI0Q0Q2NDoxRDY2NTg3OjI2RkE4NkU6Njk2QUZGM0UiLCJ2aXNpdG9yX2lkIjoiMTIxNzcyMDk4MzY0MDI3Njc5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5d87832d6dc43de7f6a53cb7462e5eb36e2c18752cf8556de95984916947181 |
| hovercard-subject-tag | issue:1849325952 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/shotgunsoftware/python-api/294/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3dff5eabd22d2d93f5e6cd02f7c1d29261a024902eb5eafba5ce20f33ba4b7a4/shotgunsoftware/python-api/issues/294 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3dff5eabd22d2d93f5e6cd02f7c1d29261a024902eb5eafba5ce20f33ba4b7a4/shotgunsoftware/python-api/issues/294 |
| og:image:alt | When performing an upload via the SG API, we have multiple files that share a common filename but are in completely different paths. If we try to upload both of those simultaneously, the AWS upload... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | briansmith-epic |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/shotgunsoftware/python-api git https://github.com/shotgunsoftware/python-api.git |
| octolytics-dimension-user_id | 317894 |
| octolytics-dimension-user_login | shotgunsoftware |
| octolytics-dimension-repository_id | 748742 |
| octolytics-dimension-repository_nwo | shotgunsoftware/python-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 748742 |
| octolytics-dimension-repository_network_root_nwo | shotgunsoftware/python-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width