404 main page not found
oleggulevskyy
HOBBYOP

2 years ago

I deployed a docker file that contains multiple services and express app that serves react is one of them.
When I try to access the main webpage, I get 404 with following logs in the deployment

Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'
Error: ENOENT: no such file or directory, stat '/usr/src/app/noodle/build/index.html'

I tried to set the Caddyfile and nixpacks.toml files based on this repo here
https://github.com/brody192/vite-react-template/blob/main/nixpacks.toml to no luck
https://popspace-demo-production.up.railway.app/

0 Replies

brody
EMPLOYEE

2 years ago

are you able to share your repo?


brody
EMPLOYEE

2 years ago

n/a


oleggulevskyy
HOBBYOP

2 years ago


oleggulevskyy
HOBBYOP

2 years ago

the ui package from my understanding is here
https://github.com/OlegGulevskyy/popspace-demo/tree/master/noodle

and that's where I placed the files


brody
EMPLOYEE

2 years ago

looks like you are using the wrong caddyfile and nixpacks.toml combo -

use the files from this repo.
and make sure you have the root directory set to /noodle in your service settings.


oleggulevskyy
HOBBYOP

2 years ago

ah that's true, I can see in Caddyfile I was pointing to dist folder, that's gotta be causing some troubles at the very least


oleggulevskyy
HOBBYOP

2 years ago

gonna try now


oleggulevskyy
HOBBYOP

2 years ago

hm, without setting /noodle as a root directory leads to the same issue
but with setting /noodle as a root directory I am getting a bunch of errors

2.350 warning Resolution field "babel-loader@8.1.0" is incompatible with requested version "babel-loader@^8.2.2"

4.356 error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

4.356 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

-----



Dockerfile:26

-------------------

24 |     ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH

25 |     COPY . /app/.

26 | >>> RUN --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/root/cache/Cypress,target=/root/.cache/Cypress --mount=type=cache,id=s/17269ca0-4835-43a2-8593-0fdab0c1c387-/usr/local/share/cache/yarn/v6,target=/usr/local/share/.cache/yarn/v6 yarn install --frozen-lockfile

27 |

28 |     # build phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1



Error: Docker build failed

oleggulevskyy
HOBBYOP

2 years ago

not actually sure where the RUN is from that "causes" the error, it's Railway's docker file?


brody
EMPLOYEE

2 years ago

you need the root directory to be set to /noodle since that's the app you are trying to deploy, you'll need to deploy all the app's separately


brody
EMPLOYEE

2 years ago

your lock file needs to be updated


oleggulevskyy
HOBBYOP

2 years ago

i am back on this topic, the issue is that when using suggested Caddy files and nix toml it brings a lot of problems during deployment that I am not sure I am able to solve, when I am getting Not found, at least I am able to build the project fine and I can see that the logs are normal, like the deployment is happening
https://popspace-demo-production.up.railway.app/
however, I also have couple of other ports that are supposed to be available - backend, and none of them are responsive
for example

curl https://popspace-demo-production.up.railway.app:8889/media_providers

so it seems like there is a bigger problem than just UI not rendering correctly, none of my services are not working at all

1233063763289178000
1233063763662340000


oleggulevskyy
HOBBYOP

2 years ago

whereas I tried to deploy it Fly.io and I got opposite almsot 😄 I get the UI working but the backends impossible to make work


oleggulevskyy
HOBBYOP

2 years ago

well actually I cannot even deploy separately these services, when I try to deploy the UI service, it errors out while trying to import other serivces, because it's trying to find them in the global registry instead of from workspace


brody
EMPLOYEE

2 years ago

you can't access specific ports, you need to deploy each app individually


brody
EMPLOYEE

2 years ago

and noodle comes with its own server, so you don't even need the Caddyfile and nixpacks.toml


Loading...