Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [flytekit] pyflyte register fails for Azure Blob Storage (Missing Headers) #5762

Open
2 tasks done
olandr opened this issue Sep 19, 2024 · 3 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@olandr
Copy link

olandr commented Sep 19, 2024

Describe the bug

When trying to register a launchplan to Azure Blob Storage, using:

pyflyte --verbose register -p usecase -d development --image myacr.azurecr.io/myimage:123 launch_plan.py

I get the error (excerpt):

│                                                                                                  │
│    84 │   │   │   if not resp.ok:                                                                │
│    85 │   │   │   │   raise AssertionError(f"Failed to upload file {self._filename} to {res.si   │
│    86 │   │   except Exception as e:                                                             │
│ ❱  87 │   │   │   raise AssertionError(f"Failed to upload file {self._filename} reason {e}")     │
│    88                                                                                            │
│    89                                                                                            │
│    90 def get_flyte_fs(remote: FlyteRemote) -> typing.Type[FlyteFS]:                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AssertionError: Failed to upload file 00000 reason Failed to upload file 00000 to 
https://mystorageaccount.blob.core.windows.net/flyte/usecase/development/00000/1
235bj1u5351959x94?se=2024-09-19T12%3A56%3A12Z&sig=LesP283512395Rdyf%2FKm5135GVcg%aaaaa9Qnnf3%2
1431mM%3D&sp=aw&spr=https&sr=b&st=2024-09-19T11%3A26%3A12Z&sv=2024-
05-04 reason An HTTP header that's mandatory for this request is not specified.

Related Issues, PRs

#3942
flyteorg/flytekit#1784

Expected behavior

When running:

pyflyte --verbose register -p usecase -d development --image myacr.azurecr.io/myimage:123 launch_plan.py

It should not fail and the workflow should register properly.

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@olandr olandr added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Sep 19, 2024
Copy link

welcome bot commented Sep 19, 2024

Thank you for opening your first issue here! 🛠

@olandr
Copy link
Author

olandr commented Sep 19, 2024

After some discussion with @Tom-Newton, the workaround for now seems to be the following:

https://github.com/flyteorg/flytekit/blob/2452c74fba00b21a4428d548fe4100966d779c72/flytekit/remote/remote_fs.py#L83

            FlytePathResolver.add_mapping(self.path, res.native_url)
-           resp = requests.put(res.signed_url, data=data)
+           resp = requests.put(res.signed_url, data=data, headers={"x-ms-blob-type": "BlockBlob"})
            if not resp.ok:
                raise AssertionError(f"Failed to upload file {self._filename} to {res.signed_url} reason {resp.reason}")
        except Exception as e:
            raise AssertionError(f"Failed to upload file {self._filename} reason {e}")

@kumare3
Copy link
Contributor

kumare3 commented Sep 19, 2024

You can do this specifically for Azure (in the fs layer)

@eapolinario eapolinario added flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Sep 19, 2024
@eapolinario eapolinario self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
Status: Backlog
Development

No branches or pull requests

3 participants