Skip to content

Internal Server Error #628

Closed
Closed

Description

@Cyberlytical-LLC

When setting up a new instance of Bracket I get an internal server error when trying to log in. I followed everything from the quickstart and even tried a prod setup with nothing working.

I have tried on 2 different Ubuntu 22.04 VMs and get the same error. (Vms are on a separate vlan from PC)

When trying to log in I get the following error:
Capture

I have also tried setting the API url with no luck. It continues to go for localhost.

Its almost like the env files/ parameters are applying and the base code is borked.

Activity

  1. furtabs commented on Apr 6, 2024

    @furtabs

    I had better luck with a newer docker version the one from docker's own repos.

    and changing DEVELOPMENT to PRODUCTION

    Cheers

  2. furtabs commented on Apr 6, 2024

    @furtabs

    Actually i did switch back to DEVELOPMENT. Try the updated docker tho from docker's official repos not the ubnutu one with this docker compose file.

    services:
        bracket-frontend:
            image: ghcr.io/evroon/bracket-frontend
            container_name: bracket-frontend
            ports:
                - "3000:3000"
            environment:
                NEXT_PUBLIC_API_BASE_URL: "http://50.20.249.11:8400"
                # Go to https://dashboard.hcaptcha.com/signup, create a site and put the site key here
                NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "xxxxx"
                NODE_ENV: "production"
            restart: unless-stopped
    
        bracket-backend:
            image: ghcr.io/evroon/bracket-backend
            container_name: bracket-backend
            ports:
                - "8400:8400"
            environment:
                ENVIRONMENT: "DEVELOPMENT"
                PG_DSN: "postgresql://bracket_dev:bracket_dev@postgres:5432/bracket_dev"
            volumes:
                - ./backend/static:/app/static
            restart: unless-stopped
            depends_on:
              - postgres
    
        postgres:
            image: postgres
            restart: always
            environment:
              POSTGRES_DB: bracket_prod
              POSTGRES_USER: bracket_prod
              POSTGRES_PASSWORD: bracket_prod
    

    Cheers :)

  3. Cyberlytical-LLC commented on Apr 9, 2024

    @Cyberlytical-LLC
    Author

    Thank you for this. So I was able to get the quickstart to work on local host and from another PC. It required adding the CORS orgin to the docker compose under the front end and adding it to .env.development.

    However when I try to change to production I get the following error logs:
    Field required [type=missing, input_value={'pg_dsn': 'postgresql://...gres:5432/bracket_prod'}, input_type=dict] bracket-backend | For further information visit https://errors.pydantic.dev/2.6/v/missing bracket-backend | [2024-04-09 02:38:15 +0000] [10] [INFO] Worker exiting (pid: 10) bracket-backend | [2024-04-09 02:38:15 +0000] [1] [ERROR] Worker (pid:9) exited with code 3 bracket-backend | [2024-04-09 02:38:15 +0000] [1] [ERROR] Worker (pid:10) was sent SIGTERM! bracket-backend | [2024-04-09 02:38:15 +0000] [1] [ERROR] Shutting down: Master bracket-backend | [2024-04-09 02:38:15 +0000] [1] [ERROR] Reason: Worker failed to boot. bracket-backend | [2024-04-09 02:38:23 +0000] [1] [INFO] Starting gunicorn 21.2.0 bracket-backend | [2024-04-09 02:38:23 +0000] [1] [INFO] Listening at: http://0.0.0.0:8400 (1) bracket-backend | [2024-04-09 02:38:23 +0000] [1] [INFO] Using worker: uvicorn.workers.UvicornWorker bracket-backend | [2024-04-09 02:38:23 +0000] [9] [INFO] Booting worker with pid: 9 bracket-backend | [2024-04-09 02:38:23 +0000] [10] [INFO] Booting worker with pid: 10 bracket-backend | [2024-04-09 02:38:24 +0000] [9] [ERROR] Exception in worker process

    ### My compose file:
    `
    services:
    bracket-frontend:
    image: ghcr.io/evroon/bracket-frontend
    container_name: bracket-frontend
    ports:
    - "3000:3000"
    environment:
    NEXT_PUBLIC_API_BASE_URL: "http://10.10.3.8:8400"
    # Go to https://dashboard.hcaptcha.com/signup, create a site and put the site key here
    NEXT_PUBLIC_HCAPTCHA_SITE_KEY: "xxxxx"
    NODE_ENV: "production"
    restart: unless-stopped

    bracket-backend:
        image: ghcr.io/evroon/bracket-backend
        container_name: bracket-backend
        ports:
            - "8400:8400"
        environment:
            ENVIRONMENT: "PRODUCTION"
            PG_DSN: "postgresql://bracket_prod:bracket_prod@postgres:5432/bracket_prod"
        volumes:
          - ./backend/static:/app/static
        restart: unless-stopped
        depends_on:
          - postgres
    
    postgres:
        image: postgres
        restart: always
        environment:
          POSTGRES_DB: bracket_prod
          POSTGRES_USER: bracket_prod
          POSTGRES_PASSWORD: bracket_prod
    

    `

    prod.env (backend)

    `PG_DSN='postgresql://bracket_prod:bracket_prod@localhost:5532/bracket_prod'
    JWT_SECRET='abd84ebeb6581c26b53fa30d89c4e7fbc48ee5b4f3b8ddedb7586cfeb3daca0c'
    CORS_ORIGINS='*'
    ADMIN_EMAIL='admin@example.com'
    ADMIN_PASSWORD='password'
    ALLOW_USER_REGISTRATION=true

    `

    .env.local (frontend)

    NEXT_PUBLIC_HCAPTCHA_SITE_KEY='10000000-ffff-ffff-ffff-000000000001' CORS_ORIGINS='*' ANALYTICS_SCRIPT_SRC='' ANALYTICS_DATA_DOMAIN='' ANALYTICS_DATA_WEBSITE_ID=''

    I understand some of the fields are still the default. However I have tried changing those values with no luck. I'm not sure what I am doing wrong at this moment. Any help is much appreciated.

  4. Cyberlytical-LLC commented on Apr 9, 2024

    @Cyberlytical-LLC
    Author

    Actually I take back the being able to connect part. If its on the same subnet I can log in just fine, however once I move it to my DMZ subnet I can no longer sign in and get the internal error again, even with the CORS ORGIN being set to "*"

  5. Repository owner locked and limited conversation to collaborators on May 4, 2024
  6. converted this issue into a discussion #694 on May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions