Strange bug: Could not find root directory /frontend
Anonymous
PROOP

a month ago

Experiencing stange deployment behaviour, we trigger the deployment on service using github actions. it's monorepo, and the root directory is set to be /frontend

but everytime it's failing on first try.

to resolve this i first change this to another value, and back again /frontend

same is happening with other services too.

here's my github action:

name: Deploy Production - Frontend

on:
  workflow_dispatch:

jobs:
  deploy:
    name: Deploy to Railway
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Railway CLI
        run: npm i -g @railway/cli

      - name: Deploy to Railway Production
        env:
          RAILWAY_TOKEN: ${{ secrets.RAILWAY_PROJECT_TOKEN }}
        working-directory: frontend
        run: |
          railway up --environment production --service client-app --detach
          railway up --environment production --service admin-ui --detach
Solved$30 Bounty

Pinned Solution

This is working-directory vs --service conflict . You're cd-ing into frontend/ AND Railway has root directory set to /frontend. So Railway might be looking for /frontend/frontend/ on first run. When you toggle the root dir setting, it forces a config refresh that fixes it.Also both railway up commands run from frontend/ with --detach, so when they fire nearly at the same time. The second deploy can interfere with the first.
FIX:

Try updating GitHub Action
Split into separate steps so they don't race each other
If you need I can also add new github action !!

2 Replies

Railway
BOT

a month ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open Railway 27 days ago


This is working-directory vs --service conflict . You're cd-ing into frontend/ AND Railway has root directory set to /frontend. So Railway might be looking for /frontend/frontend/ on first run. When you toggle the root dir setting, it forces a config refresh that fixes it.Also both railway up commands run from frontend/ with --detach, so when they fire nearly at the same time. The second deploy can interfere with the first.
FIX:

Try updating GitHub Action
Split into separate steps so they don't race each other
If you need I can also add new github action !!


dharmateja

This is working-directory vs --service conflict . You're cd-ing into frontend/ AND Railway has root directory set to /frontend. So Railway might be looking for /frontend/frontend/ on first run. When you toggle the root dir setting, it forces a config refresh that fixes it.Also both railway up commands run from frontend/ with --detach, so when they fire nearly at the same time. The second deploy can interfere with the first.FIX:Try updating GitHub ActionSplit into separate steps so they don't race each otherIf you need I can also add new github action !!

Anonymous
PROOP

25 days ago

Thank you! this is working


Status changed to Solved brody 25 days ago


Loading...