Hey guys, so I upgraded Calcom recently as well as...
# docker
k
Hey guys, so I upgraded Calcom recently as well as moved to the new Dockerfile. I need to build the Calcom image, have some changes I need, the build fails at the yarn install step with exit code 129. I'm not able to figure out what is causing this error. Vercel build for the upgraded calcom is also failing at the yarn install step. I posted an issue in the github repo about this as well - https://github.com/calcom/docker/issues/233. There isn't any information on what is causing the yarn install to fail in either case, so it would be great if anyone could point me in the right direction.
yarn install
works completely fine in the calcom repo when run locally.. docker container also builds fine locally. Only failing on an EC2 and Vercel
c
wondering if there are there any resource constraints on the cluster that could be affecting this. do you have ram/cpu/disk info?
k
Sure, it's an Amazon Linux instance
t2.large
it has a 16GB EBS volume attached, 8 GB ram. It built the previous version of the calcom docker image successfully.
Here's
lscpu
output in case that helps
Copy code
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               63
Model name:          Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
Stepping:            2
CPU MHz:             2394.320
BogoMIPS:            4788.95
Hypervisor vendor:   Xen
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            30720K
Also when I try to run the Calcom image directly, the container gets set up but on every request it crashes with
Copy code
@calcom/web:start: ERROR: command finished with error: command (/calcom/apps/web) yarn run start exited (129)
command (/calcom/apps/web) yarn run start exited (129)
 ERROR  run failed: command  exited (129)
@Colin - Krumware When you have a moment, can you recommend a way I can debug this more effectively? Or at least get more information in the error? Thanks!
c
Sorry for the delays, travelling today after wrapping up a conference
Are you providing yarn run start as a startup command for docker?
k
I'm not specifying any start up command for calcom, using the Dockerfile in the calcom docker repo as is.
Copy code
COPY calcom/package.json calcom/yarn.lock calcom/.yarnrc.yml calcom/playwright.config.ts calcom/turbo.json calcom/git-init.sh calcom/git-setup.sh ./
COPY calcom/.yarn ./.yarn
COPY calcom/apps/web ./apps/web
COPY calcom/packages ./packages

RUN yarn config set httpTimeout 1200000 && \ 
    npx turbo prune --scope=@calcom/web --docker && \
    yarn install && \
    yarn db-deploy && \
    yarn --cwd packages/prisma seed-app-store    <----- This is where the build fails

RUN yarn turbo run build --filter=@calcom/web
I'm running
docker-compose up --build
with docker-compose.yaml
Copy code
services:
  calcom:
    image: calendso/calendso:latest
    build:
      context: .
      dockerfile: Dockerfile
      args:
        NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL}
        NEXT_PUBLIC_LICENSE_CONSENT: ${NEXT_PUBLIC_LICENSE_CONSENT}
        CALCOM_TELEMETRY_DISABLED: 1
        NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
        CALENDSO_ENCRYPTION_KEY: ${CALENDSO_ENCRYPTION_KEY}
        DATABASE_URL: ${DATABASE_URL}
    restart: always
    networks:
      - ba-calcom
    ports:
      - 3000:3000
    env_file: .env
    environment:
      NEXT_PUBLIC_WEBAPP_URL: ${NEXT_PUBLIC_WEBAPP_URL}
      DATABASE_URL: ${DATABASE_URL}
      VIRTUAL_HOST: my_domain   // This is for my https-portal service
      VIRTUAL_PORT: 3000
c
What does your disk usage look like?
k
Apologies for the delayed response, I'm still at work so popping back in as soon as I can. My disk usage at the time of the crash. Please let me know if you're looking for some other information. Nothing else is running in the EC2. I ran
docker system prune
before this.
Copy code
Filesystem     1K-blocks    Used Available Use% Mounted on
devtmpfs         4059516       0   4059516   0% /dev
tmpfs            4068308       0   4068308   0% /dev/shm
tmpfs            4068308     444   4067864   1% /run
tmpfs            4068308       0   4068308   0% /sys/fs/cgroup
/dev/xvda1      16764908 7707752   9057156  46% /
tmpfs              10240       0     10240   0% /tmp
tmpfs             813664       0    813664   0% /run/user/1000
c
Can you modify the RUN command near the crash to break the &&'d commands into individual RUN commands?
That will hopefully give us more insight into the error
There's got to be something environmental going on
k
Thank you! I did this and the error turned out to not be
yarn install
.
Copy code
ERROR [builder 11/13] RUN yarn --cwd packages/prisma seed-app-store
I'll try running this locally to see if I can replicate and maybe see the error output
c
We're not getting it from the nightly or release builds, so I wonder if it's related to configuration or a certain app config that could have broken
k
I fixed this by adding a
.env.appStore
and moving the app store related creds there. This step now runs successfully, but I now have an error at
yarn turbo run build --filter=@calcom/web
Copy code
#0 420.5 @calcom/web:build: > Build error occurred
#0 420.5 @calcom/web:build: Error: Collecting page data for [object Object] is still timing out after 2 attempts. See more info here <https://nextjs.org/docs/messages/page-data-collection-timeout>
#0 420.5 @calcom/web:build:     at onRestart (/calcom/node_modules/next/dist/build/index.js:601:35)
#0 420.5 @calcom/web:build:     at Worker.isPageStatic (/calcom/node_modules/next/dist/lib/worker.js:48:40)
#0 420.5 @calcom/web:build:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
#0 420.5 @calcom/web:build:     at async Span.traceAsyncFn (/calcom/node_modules/next/dist/trace/trace.js:79:20)
#0 420.5 @calcom/web:build:     at async /calcom/node_modules/next/dist/build/index.js:725:52
#0 420.5 @calcom/web:build:     at async Span.traceAsyncFn (/calcom/node_modules/next/dist/trace/trace.js:79:20)
#0 420.5 @calcom/web:build:     at async Promise.all (index 49)
#0 420.5 @calcom/web:build:     at async /calcom/node_modules/next/dist/build/index.js:664:17
#0 420.5 @calcom/web:build:     at async Span.traceAsyncFn (/calcom/node_modules/next/dist/trace/trace.js:79:20)
#0 420.5 @calcom/web:build:     at async /calcom/node_modules/next/dist/build/index.js:625:170
a
I’m getting this error too. Tried setting staticPageGenerationTimeout to 1000 but still get the same error
k
@Ayush - Did you manage to resolve this? I tested the next build step locally and it seems to work fine, except for TRPC errors to the wrong domain
Copy code
<< query #1 viewer.features.list {
  input: undefined,
  result: TRPCClientError: request to <http://https//mynextpublic_url/api/trpc/viewer.features.list?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%3A%7B%22values%22%3A%5B%22undefined%22%5D%7D%7D%7D> failed, reason: getaddrinfo ENOTFOUND https
a
Yeah, the weird thing is the timing out after 2 attempts error doesn’t happen on my laptop (m1 Mac). But I get it on my desktop and server (both are Debian).
On my laptop I do get the TRPC errors to the wrong domain but the build does complete successfully
k
Yes, same here, the build goes through successfully on my Mac as well, failing in the Amazon Linux EC2 and the Vercel deployment too, all with very vague errors..
I'm able to replicate the
Collecting page data...
error on my Mac locally as well now. Updated calcom sub module to the latest main, ran
yarn
once and then the docker compose up --build command..
Copy code
#0 102.3 @calcom/web:build: info  - Collecting page data...
#0 104.1 @calcom/web:build: prisma:query BEGIN
#0 104.1 @calcom/web:build: prisma:query DEALLOCATE ALL
#0 104.2 @calcom/web:build: prisma:query SELECT "public"."App"."slug" FROM "public"."App" WHERE 1=1 OFFSET $1
#0 104.2 @calcom/web:build: prisma:query COMMIT
#0 108.7 @calcom/web:build: ERROR: command finished with error: command (/calcom/apps/web) yarn run build exited (129)
#0 108.7 command (/calcom/apps/web) yarn run build exited (129)
#0 108.7
#0 108.7  Tasks:    5 successful, 6 total
#0 108.7 Cached:    0 cached, 6 total
#0 108.7   Time:    1m47.901s
Vercel deployment went through successfully