Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

404 error on frontend #64

Closed
Nehc opened this issue Nov 5, 2021 · 5 comments
Closed

404 error on frontend #64

Nehc opened this issue Nov 5, 2021 · 5 comments
Assignees
Labels
frontend Related to Frontend

Comments

@Nehc
Copy link

Nehc commented Nov 5, 2021

in brouser:

graphql:1 Failed to load resource: the server responded with a status of 404 (Not Found)

in console:

frontend | 2021/11/05 09:51:37 [error] 36#36: *11 open() "/usr/share/nginx/html/graphql" failed (2: No such file or directory), client: 172.21.0.1, server: localhost, request: "POST /graphql HTTP/1.1", host: "localhost:5000", referrer: "http://localhost:5000/explore"

WAIDW?

@prabhuomkar
Copy link
Owner

You are doing nothing wrong, we had a task #45 for this which was of lower priority and just bumped it up.
I have created a PR #65 which should fix the error you are facing.
Would request you to test with the master, once #65 is merged :)

More Information:
This error is happening because frontend isn't getting the environment variable REACT_APP_API_URL which contains URL of API server.
The developers didn't face this issue as we had a file called .env.local with us on our systems.

@prabhuomkar
Copy link
Owner

@Nehc can you check and confirm if its working?

@prabhuomkar prabhuomkar self-assigned this Nov 5, 2021
@Nehc
Copy link
Author

Nehc commented Nov 5, 2021

A bit wrong, as I understood, from this link (https://stackoverflow.com/questions/64319920/docker-setting-an-env-variable-from-docker-compose-yml), you need firstly in the docker-compouse .yml:
frontend:
build:
context: frontend
args:
REACT_APP_API_URL: 'http://api:5001/graphql'
restart: always
container_name: frontend
ports:
- '5000:80'
depends_on:
- api
environment:
REACT_APP_API_URL: 'http://api:5001/graphql'

And in the dockerfile:
ARG REACT_APP_API_URL
ENV REACT_APP_API_URL${REACT_APP_API_URL}

after that there is no longer an error in the frontend, but it still does not work. ) But there it seems already somewhere in ml...

in brouser:

createUploadLink.js:208 POST http://api:5001/graphql net::ERR_NAME_NOT_RESOLVED

@prabhuomkar
Copy link
Owner

This seems like a known issue.
You need to have few changes in your /etc/hosts as mentioned here:
https://github.com/prabhuomkar/iris/tree/master/frontend#installing

@Nehc
Copy link
Author

Nehc commented Nov 5, 2021

Yes, my mistake. Everything works! Senks!

@prabhuomkar prabhuomkar added the frontend Related to Frontend label Nov 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frontend Related to Frontend
Projects
None yet
Development

No branches or pull requests

2 participants