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

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

Open
1 task done
mrfzy00 opened this issue Apr 18, 2024 · 3 comments
Open
1 task done
Labels
bug Something isn't working need testing Needs to be tested before merging onto production self-host Self hosted Hoppscotch instance

Comments

@mrfzy00
Copy link

mrfzy00 commented Apr 18, 2024

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

@mrfzy00 mrfzy00 added bug Something isn't working need testing Needs to be tested before merging onto production labels Apr 18, 2024
@JoelJacobStephen JoelJacobStephen added the self-host Self hosted Hoppscotch instance label Apr 22, 2024
@balub
Copy link
Member

balub commented Apr 23, 2024

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

@mrfzy00
Copy link
Author

mrfzy00 commented 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

@balub
Copy link
Member

balub commented 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need testing Needs to be tested before merging onto production self-host Self hosted Hoppscotch instance
Projects
None yet
Development

No branches or pull requests

3 participants