Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout when connecting to the sqlite database #115

Open
atomixer opened this issue Feb 28, 2023 · 1 comment
Open

Timeout when connecting to the sqlite database #115

atomixer opened this issue Feb 28, 2023 · 1 comment

Comments

@atomixer
Copy link

atomixer commented Feb 28, 2023

Hello, I'm occasionally running into errors when connecting to the sqlite database. We use citizen to version our modules. The way our setup works is we have a pipeline that will do a terraform init/plan in any directories that have changes which will download the relevant modules from citizen. Sometimes the pipeline will have a large build and will do the init/plan in a lot of directories in parallel at once. When this happens, citizen might crash with the following error (unfortunately I don't have a reliable way to reproduce the error). The error with which it fails is below -

PrismaClientUnknownRequestError:
Invalid prisma.module.updateMany() invocation:


Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })
    at RequestHandler.handleRequestError (/snapshot/citizen/stores/sqlite/client/runtime/index.js)
    at RequestHandler.request (/snapshot/citizen/stores/sqlite/client/runtime/index.js)
    at async PrismaClient._request (/snapshot/citizen/stores/sqlite/client/runtime/index.js)
    at async Object.increaseModuleDownload (/snapshot/citizen/stores/sqlite/sqlite.js)
    at async increaseModuleDownload (/snapshot/citizen/stores/store.js)
    at async /snapshot/citizen/routes/download.js {
  clientVersion: '4.3.1'
}

The error happens when citizen tries to increment the download counter for the module in the database.

const increaseModuleDownload = async (options) => {

My question is this, does that increment even need to happen? Is there any other setting we can tweak on sqlite or citizen to increase the timeout?

Thanks!

@b-dean
Copy link

b-dean commented Mar 15, 2023

This seems to be related to a number of upstream issues in Prisma.

One workaround I found is to add this to your connection uri: ?connection_limit=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants