Skip to content
Health check issue
saastern
OP

a year ago

$1 Bounty

37 Replies

Railway
BOT

a year 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

a year ago

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


saastern
OP

a year 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

a year ago


saastern
OP

a year ago

didnt solve


clashing

a year ago

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


saastern
OP

a year ago

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

saastern

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

clashing

a year ago

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


saastern
OP

a year 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

a year 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
OP

a year ago

yet im facing issue it didnt solve my error


clashing

a year ago

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


saastern
OP

a year ago

this?


clashing

a year ago

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


saastern
OP

a year ago

im using two

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

saastern
OP

a year 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

a year ago

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


saastern
OP

a year ago

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


clashing

a year 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


saastern
OP

a year ago

i added


clashing

a year ago

Did that helped then?


saastern
OP

a year ago

nope


clashing

a year ago

Any error in the HTTP/Deploy logs


saastern

im using two ```python path('health/', health_check, name='health_with_slash'), path('health', health_check, name='health_without_slash'), ```

clashing

a year 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
OP

a year ago

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


saastern

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

clashing

a year 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
OP

a year ago

nope in logs only deplou build no helath


clashing

a year ago

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


saastern
OP

a year ago

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


clashing

a year ago

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


saastern
OP

a year ago

working sucessfully


saastern

working sucessfully

clashing

a year ago

Can you provide the endpoint URL which is working?


saastern
OP

a year ago

i meant deployed sucessfully


saastern

i meant deployed sucessfully

clashing

a year ago

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


saastern
OP

a year ago

whyyy?


saastern

whyyy?

clashing

a year ago

Then please solve it at your own


saastern
OP

a year ago

okok

security issues


Welcome!

Sign in to your Railway account to join the conversation.

Loading...