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

Issue with S3Boto3StorageHealthCheck Failing After Upgrading to django-health-check 3.18.0 on Django 5.0 #412

Closed
krystofbe opened this issue Jan 30, 2024 · 5 comments

Comments

@krystofbe
Copy link
Contributor

Hello,

I've recently encountered an issue with the django-health-check package, specifically version 3.18.0. After upgrading from 3.17.0 to 3.18.0, the S3Boto3StorageHealthCheck started failing, despite functioning correctly in the previous version.

Upon investigating the source code, I noticed that the failure seems to be occurring at this line in backends.py. It appears that self.storage_alias is None when used with S3Boto3StorageHealthCheck.

I am wondering if anyone else has experienced this issue after the upgrade and if there are any known workarounds or fixes. Any insights or assistance in resolving this would be greatly appreciated.

Thank you!

@yanivtoledano
Copy link

Seeing the same issue. Error did not exist previously (i.e., on 3.17.0).

@itsjef
Copy link

itsjef commented Feb 2, 2024

same issue. Here my traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/health_check/storage/backends.py", line 75, in check_status
    file_name = self.check_save(file_name, file_content)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/health_check/storage/backends.py", line 54, in check_save
    file_name = storage.save(file_name, ContentFile(content=file_content))
                ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'save'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/health_check/backends.py", line 30, in run_check
    self.check_status()
  File "/usr/local/lib/python3.11/site-packages/health_check/storage/backends.py", line 79, in check_status
    raise ServiceUnavailable("Unknown exception") from e
health_check.exceptions.ServiceUnavailable: unavailable: Unknown exception

@krystofbe
Copy link
Contributor Author

I submitted a pull request here: #415

until this is merged you can use my PR via poetry add git+https://github.com/krystofbe/django-health-check or stick to 3.17.0

@50-Course
Copy link

@krystofbe off to take a look

@browniebroke
Copy link
Contributor

I submitted a pull request here: #415

That PR is merged and (I think) released. Should this issue be marked as resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants