Skip to content

/healthy request responds http 200 even some checks failing #32

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

Open
silmar-alberti opened this issue Feb 6, 2024 · 0 comments
Open

Comments

@silmar-alberti
Copy link
Contributor

Problem

The endpoint /healthy responds HTTP 200 even some checks failing.

How to simulate

  • into a empty laravel 10 project install some 4.x version

  • config checks to just use directory checker putting following file into ./config directory
    health-checker.zip

  • change directory permission in the way current user could not write there.

  • serve using ./artisan serve

  • make a request into http://{your_hostname}/healty

the return seems a HTTP 200 with following body:

{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "health_status": {
    "directory-permission": {
      "is_healthful": false,
      "message": "The directory laravel-10/public/storage/ is not writable."
    }
  }
}

Problem found

The problem seems to be into the src/Http/Controllers/HealthCheckerController.php file, where the controller gets checking results but does not do any validation using returned objects. In other hand the file comandline interface does this kind of validation.

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

1 participant