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

Fix runtime transitive dependency issue for dataservice #698

Merged

Conversation

robertbartel
Copy link
Contributor

Despite now having packages and images build correctly, the data service will not properly start due to it missing python-multipart. This appears to be a transitive dependency needed by fastapi.

nwm-master_data-service.1.1jixzman9fu0@gamer1    |   File "/usr/local/lib/python3.9/site-packages/fastapi/dependencies/utils.py", line 817, in get_body_field
nwm-master_data-service.1.1jixzman9fu0@gamer1    |     check_file_field(final_field)
nwm-master_data-service.1.1jixzman9fu0@gamer1    |   File "/usr/local/lib/python3.9/site-packages/fastapi/dependencies/utils.py", line 100, in check_file_field
nwm-master_data-service.1.1jixzman9fu0@gamer1    |     raise RuntimeError(multipart_not_installed_error) from None
nwm-master_data-service.1.1jixzman9fu0@gamer1    | RuntimeError: Form data requires "python-multipart" to be installed. 
nwm-master_data-service.1.1jixzman9fu0@gamer1    | You can install "python-multipart" with: 
nwm-master_data-service.1.1jixzman9fu0@gamer1    | 
nwm-master_data-service.1.1jixzman9fu0@gamer1    | pip install python-multipart
nwm-master_data-service.1.1jixzman9fu0@gamer1    | 

This change adds python-multipart as one of the project dependencies in the dmod.dataservice pyproject.toml file.

Fixing missing dependency on python-multipart, seemingly transitively
needed for fastapi.
@robertbartel robertbartel added bug Something isn't working maas MaaS Workstream labels Aug 6, 2024
@robertbartel robertbartel requested a review from aaraney August 6, 2024 17:54
@aaraney aaraney merged commit 6bf661e into NOAA-OWP:master Aug 6, 2024
8 checks passed
@aaraney
Copy link
Member

aaraney commented Aug 6, 2024

Thanks @robertbartel!

@robertbartel
Copy link
Contributor Author

@aaraney, as your knowledge of Python package is superior to mine, do you see a clear reason why this didn't break with the old setup.py approach but seems to have once we moved to pyproject.toml?

@aaraney
Copy link
Member

aaraney commented Aug 6, 2024

@robertbartel, is the exception raised during startup or when you submit a request?

@robertbartel
Copy link
Contributor Author

@aaraney, startup: it would just continue to display in the logs repeatedly, with the service constantly restarting due to the exception.

@aaraney
Copy link
Member

aaraney commented Aug 6, 2024

The only thing I can thing is python-multipart was being pulled in from a transitive dependency or fastapi has changed its startup behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maas MaaS Workstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants