zipline icon indicating copy to clipboard operation
zipline copied to clipboard

Bug: Zipline losing connection to the database every few days

Open wraithy opened this issue 8 months ago • 7 comments

What happened?

So I updated Zipline which did fix the S3 issue however I am now getting database issues after Zipline has been running for a day or 2.

Version

Latest v4 commit (ghcr.io/diced/zipline:trunk)

What browser(s) are you seeing the problem on?

No response

Zipline Logs

Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/deleteFiles.ts:7:25) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/maxViews.ts:8:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.aggregate()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async queryStats (src/lib/stats.ts:5:15)
    at async Object.func (src/lib/tasks/run/metrics.ts:6:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/thumbnails.ts:13:28) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.invite.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/clearInvites.ts:5:27) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/deleteFiles.ts:7:25) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/maxViews.ts:8:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.aggregate()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async queryStats (src/lib/stats.ts:5:15)
    at async Object.func (src/lib/tasks/run/metrics.ts:6:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/thumbnails.ts:13:28) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.invite.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/clearInvites.ts:5:27) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/deleteFiles.ts:7:25) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/maxViews.ts:8:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.aggregate()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async queryStats (src/lib/stats.ts:5:15)
    at async Object.func (src/lib/tasks/run/metrics.ts:6:18) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/thumbnails.ts:13:28) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.invite.findMany()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at async Object.func (src/lib/tasks/run/clearInvites.ts:5:27) {
  code: 'P2024',
  clientVersion: '6.4.1',
  meta: [Object]
}

Browser Logs


Additional Info

No response

wraithy avatar Apr 11 '25 19:04 wraithy

looks this this is only happening to the scheduled tasks.. does the dashboard work fine and show everything correctly? you can try enabling the healthcheck and try going to /api/healthcheck yourself in the browser to see if it returns an okay response

diced avatar Apr 13 '25 21:04 diced

looks this this is only happening to the scheduled tasks.. does the dashboard work fine and show everything correctly? you can try enabling the healthcheck and try going to /api/healthcheck yourself in the browser to see if it returns an okay response

No, it just shows a loading circle and nothing works until I restart the Zipline instance. I have a schedule set up currently to restart the container each day so I will have to wait before I can check the healthcheck endpoint but yeh nothing loads and you can't upload etc either. One thing that I did notice though is that the files are added to the database but the files don't actually get uploaded so they just show as broken files once I restart the instance.

wraithy avatar Apr 14 '25 01:04 wraithy

So I get this response when going to the /api/healthcheck endpoint

{
  "error": "there was an error during a healthcheck",
  "statusCode": 500
}

and then in the console it shows this

Invalid `prisma.$queryRaw()` invocation:


Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
[2025-04-16T14:23:24 ERROR  api::healthcheck] there was an error during a healthcheck
[2025-04-16T14:23:24 ERROR  api::healthcheck] PrismaClientKnownRequestError:

wraithy avatar Apr 16 '25 13:04 wraithy

I have a similar problem. I didn't find anything in the logs about loosing connection to the database, but all my uploaded files disappear every few days and I simply receive "404 Page not found" for everything except shortened URLs.

Healthcheck returns {"pass":true}. This is my compose.yaml.

services:
  postgresql:
    image: postgres:16
    restart: unless-stopped
    container_name: tools_zipline_database
    env_file:
      - .env
    environment:
      POSTGRES_USER: ${POSTGRESQL_USER:-zipline}
      POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD:?POSTGRESSQL_PASSWORD is required}
      POSTGRES_DB: ${POSTGRESQL_DB:-zipline}
    user: root
    volumes:
      - /mnt/configs/zipline/database:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'zipline']
      interval: 10s
      timeout: 5s
      retries: 5

  zipline:
    image: ghcr.io/diced/zipline
    container_name: tools_zipline_server
    ports:
      - '3000:3000'
    env_file:
      - .env
    environment:
      - DATABASE_URL=postgres://${POSTGRESQL_USER:-zipline}:${POSTGRESQL_PASSWORD}@postgresql:5432/${POSTGRESQL_DB:-zipline}
    user: root
    depends_on:
      - postgresql
    volumes:
      - /mnt/configs/zipline/uploads:/zipline/uploads
      - /mnt/configs/zipline/public:/zipline/public
      - /mnt/configs/zipline/themes:/zipline/themes

And here is my .env file.

POSTGRESQL_USER = zipline
POSTGRESQL_DB = zipline
POSTGRESQL_PASSWORD = [[ZIPLINE_DB_PASS]]
CORE_SECRET = [[ZIPLINE_CORE_SECRET]]
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/zipline?schema=public"
CORE_PORT=3000
CORE_HOSTNAME=0.0.0.0
DATASOURCE_TYPE="local"
DATASOURCE_LOCAL_DIRECTORY="/mnt/configs/zipline/uploads"

nikolanovoselec avatar May 08 '25 22:05 nikolanovoselec

@nikolanovoselec @wraithy would you guys be able to add the environment variable: DEBUG=*? this will enable a TON of debug logs for all sorts of stuff, including prisma, which may hopefully pinpoint this issue a bit better than zipline's own debug logs. Again this will log a bunch of stuff so please include everything u can when you run in to this again (if you do not want all the logs then setting that debug variable to prisma:* will filter it to only show prisma debug logs)

diced avatar May 15 '25 21:05 diced

I have added the DEBUG=* variable though I am running Zipline in Pterodactyl so I can only go so far back in the console. Do the logs get outputted anywhere so that I am able to look through the full logs?

wraithy avatar Jun 14 '25 14:06 wraithy

This is what I have learned... If I spin up Zipline using relative paths for bind mounts, or docker volumes, everything works fine. But through all my testing, whenever I configure bind mounts using absolute paths (local or nfs-mounts), the connection to the DB will break after a few days. I am running Zipline using docker volumes now for a few weeks, so I don't have any debug logs to send.

nikolanovoselec avatar Jun 14 '25 15:06 nikolanovoselec

The issue happened just now so here is what the console outputted while having DEBUG=* set.

  'sec-fetch-dest': 'document',
  'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
  'sec-ch-ua-mobile': '?0',
  'sec-ch-ua-platform': '"Windows"',
  'upgrade-insecure-requests': '1',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
  accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
  'sec-fetch-site': 'same-origin'
} +0ms
prisma:client Prisma Client call: +447687ms
prisma:client prisma.zipline.findFirst({}) +0ms
prisma:client Generated request: +0ms
prisma:client {
  "modelName": "Zipline",
  "action": "findFirst",
  "query": {
    "arguments": {},
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +1ms
  next:router-server:main requestHandler! /dashboard/upload/file {
  matchedOutput: {
    type: 'pageFile',
    fsPath: undefined,
    locale: undefined,
    itemsRoot: undefined,
    itemPath: '/dashboard/upload/file'
  },
  statusCode: undefined,
  resHeaders: {},
  bodyStream: false,
  parsedUrl: {
    pathname: '/dashboard/upload/file',
    query: [Object: null prototype] {}
  },
  finished: true
} +435ms
  next:router-server:main invokeRender /dashboard/upload/file {
  host: 'ny.ax',
  'x-real-ip': '<removed>',
  'x-forwarded-for': '<removed>, <removed>',
  'x-forwarded-proto': 'https',
  connection: 'close',
  'cf-ray': '950dabc0d91997f8-MAN',
  'sec-fetch-mode': 'navigate',
  'accept-encoding': 'gzip, br',
  'cdn-loop': 'cloudflare; loops=1',
  cookie: '<removed>',
  priority: 'u=0, i',
  'cf-visitor': '{"scheme":"https"}',
  'accept-language': 'en-GB,en;q=0.9',
  'sec-fetch-dest': 'document',
  'cf-connecting-ip': '<removed>',
  'cf-ipcountry': 'GB',
  'sec-fetch-user': '?1',
  pragma: 'no-cache',
  'cache-control': 'no-cache',
  'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
  'sec-ch-ua-mobile': '?0',
  'sec-ch-ua-platform': '"Windows"',
  'upgrade-insecure-requests': '1',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
  accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
  'sec-fetch-site': 'same-origin'
} +0ms
  compression gzip compression +4s
  next:router-server:main requestHandler! /_next/data/WOZyA6in46ANTkKTGuHpZ/auth/login.json {
  matchedOutput: {
    type: 'pageFile',
    fsPath: undefined,
    locale: undefined,
    itemsRoot: undefined,
    itemPath: '/auth/login'
  },
  statusCode: undefined,
  resHeaders: {},
  bodyStream: false,
  parsedUrl: {
    pathname: '/_next/data/WOZyA6in46ANTkKTGuHpZ/auth/login.json',
    query: [Object: null prototype] {}
  },
  finished: true
} +336ms
  next:router-server:main invokeRender /_next/data/WOZyA6in46ANTkKTGuHpZ/auth/login.json {
  host: 'ny.ax',
  'x-real-ip': '<removed>',
  'x-forwarded-for': '<removed>, <removed>',
  'x-forwarded-proto': 'https',
  connection: 'close',
  'cf-ray': '950dabc4c96197f8-MAN',
  'sec-fetch-mode': 'cors',
  'accept-encoding': 'gzip, br',
  'cdn-loop': 'cloudflare; loops=1',
  cookie: '<removed>',
  priority: 'u=1, i',
  'cf-visitor': '{"scheme":"https"}',
  'accept-language': 'en-GB,en;q=0.9',
  referer: 'https://ny.ax/dashboard/upload/file',
  'cf-connecting-ip': '<removed>',
  'cf-ipcountry': 'GB',
  'sec-fetch-dest': 'empty',
  'x-nextjs-data': '1',
  'sec-ch-ua-platform': '"Windows"',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
  'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
  'sec-ch-ua-mobile': '?0',
  accept: '*/*',
  'sec-fetch-site': 'same-origin'
} +0ms
prisma:client Prisma Client call: +769ms
prisma:client prisma.zipline.findFirst({}) +1ms
prisma:client Generated request: +0ms
prisma:client {
  "modelName": "Zipline",
  "action": "findFirst",
  "query": {
    "arguments": {},
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +9241ms
  compression gzip compression +10s
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +764ms
  compression gzip compression +725ms
  next:router-server:main requestHandler! /dashboard/upload/file {
  matchedOutput: {
    type: 'pageFile',
    fsPath: undefined,
  parsedUrl: {
    pathname: '/dashboard/upload/file',
  'x-forwarded-for': '<removed>, <removed>',
  'x-forwarded-proto': 'https',
  'cf-visitor': '{"scheme":"https"}',
  'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
  'sec-ch-ua-mobile': '?0',
  'sec-ch-ua-platform': '"Windows"',
  'upgrade-insecure-requests': '1',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
  accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
  'sec-fetch-site': 'none'
} +0ms
  compression gzip compression +23s
      has: "yjOBr31ZYE4UVOJ7LC4dxLvxHKSmJAPB"
    }
    view: true,
    oauthProviders: true,
    totpSecret: true,
    passkeys: true,
    quota: true,
    sessions: true
  }
}) +1ms
prisma:client Generated request: +0ms
prisma:client {
        }
      }
      "view": true,
      "oauthProviders": {
        "arguments": {},
        "selection": {
          "$composites": true,
          "$scalars": true
        }
        }
      },
      "quota": {
        }
      },
      "sessions": true
    }
  }
}
prisma:client prisma.url.findFirst({
  where: {
    ]
  }
}) +0ms
        "OR": [
          {
            "code": "favicon-512x512.png"
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +9463ms
  next:router-server:main requestHandler! /_next/data/WOZyA6in46ANTkKTGuHpZ/auth/login.json {
  matchedOutput: {
  resHeaders: {},
  bodyStream: false,
  parsedUrl: {
  'x-real-ip': '<removed>',
  'x-forwarded-for': '<removed>, <removed>',
  priority: 'u=1, i',
  'cf-visitor': '{"scheme":"https"}',
  'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
  'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
  'sec-ch-ua-mobile': '?0',
  "modelName": "Zipline",
  "action": "findFirst",
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +2ms
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +294ms
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
} +9714ms
  compression gzip compression +21s
  },
  statusCode: undefined,
  resHeaders: {},
  'x-forwarded-for': '<removed>, <removed>',
  'x-forwarded-proto': 'https',
  'cf-visitor': '{"scheme":"https"}',
  'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
  'upgrade-insecure-requests': '1',
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
  "modelName": "Zipline",
  "action": "findFirst",
  "query": {
    "arguments": {},
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +0ms
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +10003ms
  compression gzip compression +10s
prisma:client Prisma Client call: +707ms
prisma:client prisma.url.findFirst({
  where: {
    ]
  }
}) +0ms
        "OR": [
          {
            "code": "favicon-512x512.png"
    "selection": {
      "$composites": true,
      "$scalars": true
    }
  }
}
 +0ms
prisma:client:libraryEngine sending request, this.libraryStarted: true +1ms
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
    "timeout": 10
  },
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
} +10001ms
prisma:client Prisma Client call: +91017ms
prisma:client prisma.file.findMany({
  where: {
    size: true
  }
}) +9ms
        "deletesAt": {
          "lte": {
            "$type": "DateTime",
      "id": true,
      "size": true
    }
    views: {
      gte: prisma.file.$fields.maxViews
    }
prisma:client Generated request: +0ms
prisma:client {
            "$type": "FieldRef",
            "value": {
              "_ref": "maxViews",
      "name": true,
      "id": true,
      "size": true
  select: {
    _sum: {
      select: {
      }
    }
  }
    "selection": {
      "_sum": {
        "arguments": {},
        "selection": {
          "_all": true
        }
prisma:client prisma.file.findMany({
  where: {
}) +1ms
prisma:client Generated request: +0ms
          "is": null
        },
        "type": {
    }
  }
}
    }
  },
  select: {
  "modelName": "Invite",
  "action": "findMany",
  "query": {
        }
      }
    },
      "code": true,
      "id": true,
      "uses": true
    }
  }
}
  next:router-server:main requestHandler! /dashboard {
  matchedOutput: {
  resHeaders: {},
  bodyStream: false,
  parsedUrl: { pathname: '/dashboard', query: [Object: null prototype] {} },
  connection: 'close',
  'cf-ray': '950dafdbb98480e3-NRT',
  accept: '*/*',
  'user-agent': 'Better Uptime Bot Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36',
  'accept-encoding': 'gzip, br',
  'cdn-loop': 'cloudflare; loops=1',
  'cf-connecting-ip': '<removed>',
  'cf-ipcountry': 'JP',
  'cf-visitor': '{"scheme":"https"}'
} +1ms
  compression gzip compression +2m
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
    "connection_limit": 7,
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at Zn.handleRequestError (generated/client/runtime/library.js:124:7459)
}
prisma:client:request_handler {
  "code": "P2024",
 ⨯ unhandledRejection:  Error [PrismaClientKnownRequestError]: 
Invalid `prisma.file.findMany()` invocation:
  meta: [Object],
  clientVersion: '6.9.0'
  "clientVersion": "6.9.0",
  "name": "PrismaClientKnownRequestError"
    at async l (generated/client/runtime/library.js:133:9778)
    at async queryStats (src/lib/stats.ts:5:15)
  "meta": {
    "connection_limit": 7,
    "timeout": 10
    at Zn.handleRequestError (generated/client/runtime/library.js:124:7459)
    at Zn.handleAndLogRequestError (generated/client/runtime/library.js:124:6784)
prisma:client:request_handler {
  "code": "P2024",
  "meta": {
Invalid `prisma.invite.findMany()` invocation:
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 7)
    at Zn.handleAndLogRequestError (generated/client/runtime/library.js:124:6784)
    at Zn.request (generated/client/runtime/library.js:124:6491)
    at async l (generated/client/runtime/library.js:133:9778)
    at async Object.func (src/lib/tasks/run/clearInvites.ts:5:27) {
  code: 'P2024',
  meta: [Object],
  clientVersion: '6.9.0'
}

wraithy avatar Jun 16 '25 22:06 wraithy

i believe the issue was every time thumbnails or partial files were handled, it creates a new connection to the db, which would cause it to reach the connection limit, this should be fixed in https://github.com/diced/zipline/commit/96f60edaee2acf9041dfdeb511a037f3555ad45e as it no longer asks for a new connection for each thread but now just relies on the single connection in the main thread.

to test, i would remove the stuff u had that restarted it every day and turn off debug logs (for sanity), and give it a run ! feel free to reopen if it still happens 😔

diced avatar Jul 02 '25 00:07 diced