404 error on frontend
Nehc opened this issue · comments
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?
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.
@Nehc can you check and confirm if its working?
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
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
Yes, my mistake. Everything works! Senks!