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

Unknown error: failed to fetch #99

Open
shanzez opened this issue Nov 15, 2024 · 5 comments
Open

Unknown error: failed to fetch #99

shanzez opened this issue Nov 15, 2024 · 5 comments

Comments

@shanzez
Copy link
Contributor

shanzez commented Nov 15, 2024

Hello! We're excited to try Huly out. I'm having some issues, I believe, with my nginx configuration. We're getting:
image

Our setup:

We're running nginx in a separate container, but on the same external docker network. I did this so I would just be able to route everything via the same nginx instance on our test machine. We have two other applications using this setup successfully.

We're able to get to huly., but cannot login or create accounts. Here is the addition I made to our nginx.conf for huly:

    server {
        listen 80;
        server_name huly.<our domain>;
        return 301 https://$server_name$request_uri;
    }

    server {
        listen 3000 ssl;
        server_name huly.<our domain>;

        ssl_certificate /etc/nginx/ssl/huly.crt;
        ssl_certificate_key /etc/nginx/ssl/huly.key;

        location / {
            proxy_pass http://account:3000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }

    }

    server {
        listen 443 ssl;

        server_name huly.<our domain>;

        ssl_certificate /etc/nginx/ssl/huly.crt;
        ssl_certificate_key /etc/nginx/ssl/huly.key;

        location / {
            proxy_pass http://front:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
        client_max_body_size 200M;
    }

And the docker compose file for the account container:

  account:
    image: hardcoreeng/account:v0.6.333
    ports:
      - 3000:3000
    environment:
      - SERVER_PORT=3000
      - SERVER_SECRET=<removed> 
      - DB_URL=mongodb://mongodb:27017
      - TRANSACTOR_URL=ws://transactor:3333;ws://huly.<our domain>:3333
      - STORAGE_CONFIG=minio|minio?accessKey=<removed>&secretKey=<removed>
      - FRONT_URL=http://front:8080
      - MODEL_ENABLED=*
      - ACCOUNTS_URL=https://huly.<our domain>:3000
      - ACCOUNT_PORT=3000
    restart: unless-stopped
    networks:
      - sharednet
@ramonov
Copy link

ramonov commented Nov 21, 2024

yes same error showing at my self hosted app as well. what did we missed?

@shanzez
Copy link
Contributor Author

shanzez commented Nov 21, 2024

@ramonov this ref should fix you up: https://github.com/hcengineering/huly-selfhost/tree/19e894281bc29063b9fbaddc9dc168957daa3783 I'm testing it now. It is for this PR which seems to be close to being accepted and merged: #36

@MironVeryanskiy
Copy link

Can you show the error that gets printed in your browser dev console at the time that you hit the Failed to Fetch issue?

@ramonov
Copy link

ramonov commented Nov 26, 2024

Console screenshot
image

@MironVeryanskiy
Copy link

@ramonov although your error appears similar, it might be caused from something different from @shanzez.
you might have a different yaml & nginx config than @shanzez because I see that your application is making unsecure http requests to port 3000, whereas @shanzez nginx configuration shows listening on secure https in nginx: listen 3000 ssl;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants