Health check issue
saastern
HOBBYOP

6 months ago

$1 Bounty

37 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


clashing
HOBBY

6 months ago

This issue is closed almost 2 years back! What is the issue that you are facing now?


saastern
HOBBYOP

6 months ago

Path: /health

Retry window: 5m0s

Attempt #1 failed with service unavailable. Continuing to retry for 4m59s

Attempt #2 failed with service unavailable. Continuing to retry for 4m57s

Attempt #3 failed with service unavailable. Continuing to retry for 4m55s

Attempt #4 failed with service unavailable. Continuing to retry for 4m50s

Attempt #5 failed with service unavailable. Continuing to retry for 4m42s

Attempt #6 failed with service unavailable. Continuing to retry for 4m25s

Attempt #7 failed with service unavailable. Continuing to retry for 3m55s

Attempt #8 failed with service unavailable. Continuing to retry for 3m24s

Attempt #9 failed with service unavailable. Continuing to retry for 2m54s

Attempt #10 failed with service unavailable. Continuing to retry for 2m23s

Attempt #11 failed with service unavailable. Continuing to retry for 1m53s

Attempt #12 failed with service unavailable. Continuing to retry for 1m22s

Attempt #13 failed with service unavailable. Continuing to retry for 52s

Attempt #14 failed with service unavailable. Continuing to retry for 21s

1/1 replicas never became healthy!

Healthcheck failed!

this is my issue!!


clashing
HOBBY

6 months ago


saastern
HOBBYOP

6 months ago

didnt solve


clashing
HOBBY

6 months ago

Can you paste in your health checkup endpoint that you have defined in your server file!


saastern
HOBBYOP

6 months ago

path('health/', health_check, name='health'),

saastern

path('health/', health_check, name='health'),

clashing
HOBBY

6 months ago

This doesn't tell anything about the same! Can you please provide the entire server file!


saastern
HOBBYOP

6 months ago

@csrf_exempt

def health_check(request):

return HttpResponse("OK", status=200, content_type='text/plain')

urlpatterns = [

path('admin/', admin.site.urls),

path('api/auth/', include('apps.users.urls')),

path('health/', health_check, name='health_with_slash'),

path('health', health_check, name='health_without_slash'),


clashing
HOBBY

6 months ago

The post whose link I provided, was for node JS server. If I am not wrong, you are using django for your server. So, I am not sure how to write that out correctly, but the one I provided you would work, if you can understand its gist.


saastern
HOBBYOP

6 months ago

yet im facing issue it didnt solve my error


clashing
HOBBY

6 months ago

Please provide the snippet of your service, like the one I provided

Attachments


saastern
HOBBYOP

6 months ago

this?

Attachments


clashing
HOBBY

6 months ago

Yes, try removing slash from the endpoint: path('health', health_check, name='health')


saastern
HOBBYOP

6 months ago

im using two

 path('health/', health_check, name='health_with_slash'),
    path('health', health_check, name='health_without_slash'),

saastern
HOBBYOP

6 months ago

i have a doubt should my env have this "DJANGO_ALLOWED_HOSTS="*,.railway.app,localhost,127.0.0.1"

"

or this DJANGO_ALLOWED_HOSTS="healthcheck.railway.app"


clashing
HOBBY

6 months ago

Nope, you just need to have the PORT variable set to the port at which your server is listening to!


saastern
HOBBYOP

6 months ago

i didnt get you so what should i change in allowed host env variable


clashing
HOBBY

6 months ago

If your server is listening to the PORT 4500 (if you have defined a pre-defined port in your server), then you have to add that in the variables section of that service

Attachments


saastern
HOBBYOP

6 months ago

i added


clashing
HOBBY

6 months ago

Did that helped then?


saastern
HOBBYOP

6 months ago

nope


clashing
HOBBY

6 months ago

Any error in the HTTP/Deploy logs


saastern

im using twopath('health/', health_check, name='health_with_slash'), path('health', health_check, name='health_without_slash'),

clashing
HOBBY

6 months ago

Also, you can remove the one without slash because by defaullt Django has a setting called APPEND_SLASH set to True.

With APPEND_SLASH=True, if someone accesses /health (no trailing slash), Django will automatically redirect (HTTP 301) to /health/ (with trailing slash).


saastern
HOBBYOP

6 months ago

gey where to chekc http logs i cant get them??


saastern

gey where to chekc http logs i cant get them??

clashing
HOBBY

6 months ago

I have provided the screenshot. Just select the service in Railway, go to Deployments -> View Logs & then you can see those.


What you can also do is, try commenting out the health checkup config in the toml file for once, and see whether the server is up and running or not! I guess it won't because an error might be coming, which might be blokcing the health checkup endpoint request.


saastern
HOBBYOP

6 months ago

nope in logs only deplou build no helath


clashing
HOBBY

6 months ago

Try removing the health checkup config from the toml file, and redeploy the application


saastern
HOBBYOP

6 months ago

im trying but its a deep issue right if i do that


clashing
HOBBY

6 months ago

I don't think so. Just provide me the update after removing the health endpoint!


saastern
HOBBYOP

6 months ago

working sucessfully


saastern

working sucessfully

clashing
HOBBY

6 months ago

Can you provide the endpoint URL which is working?


saastern
HOBBYOP

6 months ago

i meant deployed sucessfully


saastern

i meant deployed sucessfully

clashing
HOBBY

6 months ago

Yes, I know. I am asking for the URL via which I can access that server!!


saastern
HOBBYOP

6 months ago

whyyy?


saastern

whyyy?

clashing
HOBBY

6 months ago

Then please solve it at your own grin emoji


saastern
HOBBYOP

6 months ago

okok

security issues


Loading...