R
Railwayフ0フ0

File too large on Gitlab CI/CD

Hi, i'm trying to add a CI/CD to my project but the deploy part always fail saying
File too large.
File too large.
. But when i'm doing the same thing in my terminal it works just fine. Would you have an idea what i'm missing ?
image: node:latest

stages:
- build
- deploy

cache:
paths:
- node_modules/
- .pnpm-store

build_api:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter api install --frozen-lockfile
- pnpm --filter api build
artifacts:
paths:
- packages/api/dist
only:
- main

build_intra:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter intra install --frozen-lockfile
- pnpm --filter intra build
artifacts:
paths:
- packages/intra/.next
only:
- main

deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url

deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
image: node:latest

stages:
- build
- deploy

cache:
paths:
- node_modules/
- .pnpm-store

build_api:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter api install --frozen-lockfile
- pnpm --filter api build
artifacts:
paths:
- packages/api/dist
only:
- main

build_intra:
stage: build
before_script:
- corepack enable
- corepack prepare pnpm@latest-8 --activate
- pnpm config set store-dir .pnpm-store
script:
- pnpm --filter intra install --frozen-lockfile
- pnpm --filter intra build
artifacts:
paths:
- packages/intra/.next
only:
- main

deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url

deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
No description
P
Percy43d ago
Project ID: 3f04c542-6a1b-4f34-9230-cf3922e8a905
フ0フ043d ago
3f04c542-6a1b-4f34-9230-cf3922e8a905
B
Brody43d ago
that's what? 350 megabytes? the limit is 40 as far as I know.
フ0フ043d ago
It's a nestjs api and nextjs api Nothing really exceptional here
B
Brody43d ago
download a zip of the repo, how big is the zip?
フ0フ043d ago
5,9 Mb
B
Brody43d ago
then something you are doing is generating 345mb worth of data before uploading why do you have build stages in your action file?
フ0フ043d ago
It's not a good practice to have three stages in the CI/CD, test => build => deploy ?
B
Brody43d ago
why not let railway do the building? it's not like they charge for the builder, and it's not like they are going to push the deployment if the build fails
フ0フ043d ago
This is really true thank you so much haha I'll try like that
B
Brody43d ago
sounds good
フ0フ043d ago
I greatly reduced my action file :
stages:
- deploy

cache:
paths:
- node_modules/
- .pnpm-store

deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url

deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
stages:
- deploy

cache:
paths:
- node_modules/
- .pnpm-store

deploy_api:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=api -d
only:
- pushes
- main
environment:
name: production
url: https://your-api-url

deploy_intra:
stage: deploy
image: ubuntu
script:
- apt-get update && apt-get install -y curl
- curl -fsSL https://railway.app/install.sh | sh
- railway up --service=intra -d
only:
- pushes
- main
But the problem stay the same :
Failed to upload code. File too large (321410994 bytes)
Failed to upload code. File too large (321410994 bytes)
B
Brody43d ago
you don't have anything in lfs?
フ0フ043d ago
I never used git lfs so far, my api is really not that big
B
Brody43d ago
I mean railway isn't making up these numbers, the large upload data is coming from somewhere
フ0フ043d ago
zipped my api is 168 KB. Would it be possible that it is trying to push something with it ? Like railway itself that i just installed ? Idk i'm just trying to understand haha
B
Brody43d ago
I mean it shouldn't, but even so, the railway binary isn't going to be anywhere near 320mb
フ0フ043d ago
Yeah but in that case how can we explain that it's working just fine from the terminal ? There must be a difference between the two of them, something is trying to be pushed that isn't when i do it manually ?
B
Brody43d ago
I mean gitlab ci environment and your local environment are vastly different things forgive me for asking as I know this is not a real solution, but simply moving your code over to github is not an option right?
フ0フ043d ago
It's a possibility, do you think it might resolve the problem ?
B
Brody43d ago
well there would be no need for the action file as railway can deploy straight from a github repo
フ0フ043d ago
I will try to do that, thanks for your help, still feels weird about this problem tho
B
Brody43d ago
I agree, I am stumped
Want results from more Discord servers?
Add your server
More Posts
Can't find my repo on railwayIt was recently migrated to be a organization repo that I have admin access to. How do I deploy baseDeploying to Railway from Gitlab CI/CDwhere to get project token from project serviceApp Crashed - Resource temporarily unavailableMy backend nodejs app crashed multiple times today. could not find the root cause. this has not hapDatabase server does not connectGood afternoon, I have already made all the connections with the postgreSQL database server but whenDeploy logs stopped appearing after a manual redeployHi, I have a project running several services. Deploy logs for one of the services randomly stopped ENOTFOUND redis.railway.internalFirst time using railway. I'm on team plan which says it supports private networking. I have a simplError: libuuid.so.1: cannot open shared object file: No such file or directoryGetting this error with puppeteer on Railway. ``` node:internal/modules/cjs/loader:1239 return pro"Error: connection already closed."I keep getting this error message when I attempt to update a user in my PostgreSQL database. I do noUnable to update Variables in App. (First Update after Migration)Hey Guys, my App tries to connect to the old containers of my postgres and redis. I checked the variImage Storagehello everyone, can I use Postgresql to store the images which my users upload in django-project?Setup Cloudflare Proxy1. Clicked "custom domain". 2. Railway pops up a CNAME for me to add to Cloudflare. 3. Add CNAME recDirectus: impossible to update or to run the old versionProject ID : 9be34f5b-fa35-49c1-83c5-f0fbd245db9b Template : https://github.com/kadumedim/directus-sCSV files in storage/app/data/csv not accessible?Hello, I've setup a laravel api on railway. I have a seeder that tries to load csv files from the I have not touched my project in several weeks but at midnight railway reverted to a very old versioI'm very confused it looks like my project was deployed last night, although I have not touched it iI can't add DNS from GoDaddy to RailwayThey recommend me to change the server name...Unable to connect database after payentHello, i just pay for the month, now i'm unable to connect to the database. please help1,2GB RAM usage in React APPDo you know if it's normal this size of ram in a frontend created with react and typescript?Shopify proxy and HTTP/1.0Hello, I need help from members using Railway to host a Shopify app. I ran into this problem where Is it possible to change the default config of a Mysql Container?By default the container uses up a minimum of 500mb of ram, I found a stack overflow post on how to Cannot link, login nor logout with cli>railway logout 🚨 Response not successful status=404 >railway login 🚨 Response not successful sta