[GH-ISSUE #3985] [bug]: while login via the app, backend hoppscotch shows as 503 service unavailable #1404

Closed
opened 2026-03-16 20:12:02 +03:00 by kerem · 5 comments
Owner

Originally created by @mrfzy00 on GitHub (Apr 18, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3985

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The backend shows as error code of 503 service unavailable
image

How do i fix it? Do you have any solutions?

Steps to reproduce

  1. We're manage to create the hoppscotch with Helm charts, so we separate the services.
  2. We also have been state our .env to configmap on K8s, here's the code:
      PORT: "3000"
      DATABASE_URL: postgresql://user_hoppscotch:password@11.12.13.14:5432/tools_hoppscotch # or replace with your database URL 
      # Auth Tokens Config
      JWT_SECRET: "secrets"
      TOKEN_SALT_COMPLEXITY: "10"
      MAGIC_LINK_TOKEN_VALIDITY: "3"
      REFRESH_TOKEN_VALIDITY: "604800000" # Default validity is 7 days (604800000 ms) in ms
      ACCESS_TOKEN_VALIDITY: "86400000" # Default validity is 1 day (86400000 ms) in ms
      SESSION_SECRET: 'Secrets'
      # Hoppscotch App Domain Config
      REDIRECT_URL: "https://hoppscotch.xxx.xxx"
      WHITELISTED_ORIGINS: "https://hoppscotch.xxx.xxx,https://hoppscotch-admin.xxx.xxx,https://hoppscotch-be.xxx.xxx"
      # Google Auth Config
      GOOGLE_CLIENT_ID: "*******"
      GOOGLE_CLIENT_SECRET: "***********"
      GOOGLE_CALLBACK_URL: "https://hoppscotch-be.xxxx.xxxx/v1/auth/google/callback"
      GOOGLE_SCOPE: "email,profile"
      # Rate Limit Config
      RATE_LIMIT_TTL: "60" # In seconds
      RATE_LIMIT_MAX: "100" # Max requests per IP
      MAILER_SMTP_URL: "smtps://user@domain.com:pass@smtp.domain.com"
      MAILER_ADDRESS_FROM: "from@example.com"
      VITE_ALLOWED_AUTH_PROVIDERS: "GOOGLE"
      VITE_BASE_URL: https://hoppscotch.xxx.xxx
      VITE_SHORTCODE_BASE_URL: https://hoppscotch.xxx.xxx
      VITE_ADMIN_URL: https://hoppscotch-admin.xxx.xxx

      # Backend URLs
      VITE_BACKEND_GQL_URL: https://hoppscotch-be.xxx.xxx/graphql
      VITE_BACKEND_WS_URL: wss://hoppscotch-be.xxx.xxx/graphql
      VITE_BACKEND_API_URL: https://hoppscotch-be.xxx.xxx/v1

      # Terms Of Service And Privacy Policy Links (Optional)
      VITE_APP_TOS_LINK: https://docs.hoppscotch.io/terms
      VITE_APP_PRIVACY_POLICY_LINK: https://docs.hoppscotch.io/privacy 

      ENABLE_SUBPATH_BASED_ACCESS: "false"
  1. After that, it was run as we expected, but only accessible is frontend, admin shows blank pages, and backend was stated above.

Environment

Production

Version

Self-hosted

Originally created by @mrfzy00 on GitHub (Apr 18, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3985 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior The backend shows as error code of 503 service unavailable <img width="1680" alt="image" src="https://github.com/hoppscotch/hoppscotch/assets/153153975/58691445-7a4e-4fd4-84c1-71c93214d00d"> How do i fix it? Do you have any solutions? ### Steps to reproduce 1. We're manage to create the hoppscotch with Helm charts, so we separate the services. 2. We also have been state our .env to configmap on K8s, here's the code: ``` PORT: "3000" DATABASE_URL: postgresql://user_hoppscotch:password@11.12.13.14:5432/tools_hoppscotch # or replace with your database URL # Auth Tokens Config JWT_SECRET: "secrets" TOKEN_SALT_COMPLEXITY: "10" MAGIC_LINK_TOKEN_VALIDITY: "3" REFRESH_TOKEN_VALIDITY: "604800000" # Default validity is 7 days (604800000 ms) in ms ACCESS_TOKEN_VALIDITY: "86400000" # Default validity is 1 day (86400000 ms) in ms SESSION_SECRET: 'Secrets' # Hoppscotch App Domain Config REDIRECT_URL: "https://hoppscotch.xxx.xxx" WHITELISTED_ORIGINS: "https://hoppscotch.xxx.xxx,https://hoppscotch-admin.xxx.xxx,https://hoppscotch-be.xxx.xxx" # Google Auth Config GOOGLE_CLIENT_ID: "*******" GOOGLE_CLIENT_SECRET: "***********" GOOGLE_CALLBACK_URL: "https://hoppscotch-be.xxxx.xxxx/v1/auth/google/callback" GOOGLE_SCOPE: "email,profile" # Rate Limit Config RATE_LIMIT_TTL: "60" # In seconds RATE_LIMIT_MAX: "100" # Max requests per IP MAILER_SMTP_URL: "smtps://user@domain.com:pass@smtp.domain.com" MAILER_ADDRESS_FROM: "from@example.com" VITE_ALLOWED_AUTH_PROVIDERS: "GOOGLE" VITE_BASE_URL: https://hoppscotch.xxx.xxx VITE_SHORTCODE_BASE_URL: https://hoppscotch.xxx.xxx VITE_ADMIN_URL: https://hoppscotch-admin.xxx.xxx # Backend URLs VITE_BACKEND_GQL_URL: https://hoppscotch-be.xxx.xxx/graphql VITE_BACKEND_WS_URL: wss://hoppscotch-be.xxx.xxx/graphql VITE_BACKEND_API_URL: https://hoppscotch-be.xxx.xxx/v1 # Terms Of Service And Privacy Policy Links (Optional) VITE_APP_TOS_LINK: https://docs.hoppscotch.io/terms VITE_APP_PRIVACY_POLICY_LINK: https://docs.hoppscotch.io/privacy ENABLE_SUBPATH_BASED_ACCESS: "false" ``` 3. After that, it was run as we expected, but only accessible is frontend, admin shows blank pages, and backend was stated above. ### Environment Production ### Version Self-hosted
kerem 2026-03-16 20:12:02 +03:00
Author
Owner

@balub commented on GitHub (Apr 23, 2024):

Hey @mrfzy00 could you share your nginx config file here ?

<!-- gh-comment-id:2071649909 --> @balub commented on GitHub (Apr 23, 2024): Hey @mrfzy00 could you share your nginx config file here ?
Author
Owner

@mrfzy00 commented on GitHub (Apr 25, 2024):

hi @balub , i'm using the nginx ingress, not using nginx here's the config:

    ingress:
      enabled: true
      className: "nginx"
      annotations:
        #kubernetes.io/ingress.class: nginx
        cert-manager.io/cluster-issuer: letsencrypt-staging
        # kubernetes.io/tls-acme: "true"
      hosts:
        - host: hoppscotch-be.xxx.xxx
          paths:
            - path: /
              pathType: ImplementationSpecific
      tls:
      - secretName: hoppscotch-be-tls
        hosts:
          - hoppscotch-be.xxx.xxx
      service:
        port: 3000
<!-- gh-comment-id:2076287700 --> @mrfzy00 commented on GitHub (Apr 25, 2024): hi @balub , i'm using the nginx ingress, not using nginx here's the config: ``` ingress: enabled: true className: "nginx" annotations: #kubernetes.io/ingress.class: nginx cert-manager.io/cluster-issuer: letsencrypt-staging # kubernetes.io/tls-acme: "true" hosts: - host: hoppscotch-be.xxx.xxx paths: - path: / pathType: ImplementationSpecific tls: - secretName: hoppscotch-be-tls hosts: - hoppscotch-be.xxx.xxx service: port: 3000 ```
Author
Owner

@balub commented on GitHub (Apr 25, 2024):

@mrfzy00 could you check if the backend service is up and active, maybe calling the ping route? When we spin up the backend for the first time we populate the DB with config props and terminate it, If it's docker we use the --restart unless-stopped flag to restart the container when we do this, maybe in your case it didn't restart automatically. Could you just check this once?

This explains why you can only see the Hoppscotch app and not the admin app and the Backend because the Hoppscotch app is cached with a service worker so you can use it offline. But can you log in and do other things related to workspaces in it though?

<!-- gh-comment-id:2078000537 --> @balub commented on GitHub (Apr 25, 2024): @mrfzy00 could you check if the backend service is up and active, maybe calling the ping route? When we spin up the backend for the first time we populate the DB with config props and terminate it, If it's docker we use the `--restart unless-stopped` flag to restart the container when we do this, maybe in your case it didn't restart automatically. Could you just check this once? This explains why you can only see the Hoppscotch app and not the admin app and the Backend because the Hoppscotch app is cached with a service worker so you can use it offline. But can you log in and do other things related to workspaces in it though?
Author
Owner

@balub commented on GitHub (May 14, 2024):

@mrfzy00 are you still facing this issue?

<!-- gh-comment-id:2109405002 --> @balub commented on GitHub (May 14, 2024): @mrfzy00 are you still facing this issue?
Author
Owner

@mrfzy00 commented on GitHub (May 14, 2024):

hi @balub , sorry of late updating, my team just resolved the issues, it has been related to our template deployment on helm charts:

apiVersion: v1
kind: Service
metadata:
  name: {{ include "hoppscotch-app.fullname" . }}
  labels:
    {{- include "hoppscotch-app.labels" . | nindent 4 }}
spec:
  type: ClusterIP
  ports:
    - port: 3000
      targetPort: http-app
      protocol: TCP
      name: http-app
  selector:
    {{- include "hoppscotch-app.selectorLabels" . | nindent 4 }}

while accessing the services, it seems the service wont recognized, but with that code above, we resolved this issue. i will close the issue.

<!-- gh-comment-id:2109409482 --> @mrfzy00 commented on GitHub (May 14, 2024): hi @balub , sorry of late updating, my team just resolved the issues, it has been related to our template deployment on helm charts: ``` apiVersion: v1 kind: Service metadata: name: {{ include "hoppscotch-app.fullname" . }} labels: {{- include "hoppscotch-app.labels" . | nindent 4 }} spec: type: ClusterIP ports: - port: 3000 targetPort: http-app protocol: TCP name: http-app selector: {{- include "hoppscotch-app.selectorLabels" . | nindent 4 }} ``` while accessing the services, it seems the service wont recognized, but with that code above, we resolved this issue. i will close the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1404
No description provided.