We've recently implemented hikari connection pooling to manage database connections, the tests are passing locally but in the pipeline, it is failing with error message: unexpected EOF on client connection with an open transaction
PostgreSQL init process complete; ready for start up.
2023-10-18 04:22:03.143 UTC [1] LOG: starting PostgreSQL 16.0 (Debian 16.0-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2023-10-18 04:22:03.143 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2023-10-18 04:22:03.143 UTC [1] LOG: listening on IPv6 address "::", port 5432
2023-10-18 04:22:03.144 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-10-18 04:22:03.147 UTC [62] LOG: database system was shut down at 2023-10-18 04:22:03 UTC
2023-10-18 04:22:03.152 UTC [1] LOG: database system is ready to accept connections
2023-10-18 04:27:03.246 UTC [60] LOG: checkpoint starting: time
2023-10-18 04:27:07.625 UTC [60] LOG: checkpoint complete: wrote 44 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.115 s, sync=0.123 s, total=4.380 s; sync files=11, longest=0.123 s, average=0.012 s; distance=260 kB, estimate=260 kB; lsn=0/152BEA0, redo lsn=0/152BE68
2023-10-18 04:28:55.452 UTC [85] ERROR: relation "public.databasechangeloglock" does not exist at character 22
2023-10-18 04:28:55.452 UTC [85] STATEMENT: SELECT COUNT(*) FROM public.databasechangeloglock
2023-10-18 04:28:55.452 UTC [86] ERROR: relation "public.databasechangeloglock" does not exist at character 22
2023-10-18 04:28:55.452 UTC [86] STATEMENT: SELECT COUNT(*) FROM public.databasechangeloglock
2023-10-18 04:28:55.452 UTC [83] ERROR: relation "public.databasechangeloglock" does not exist at character 22
2023-10-18 04:28:55.452 UTC [83] STATEMENT: SELECT COUNT(*) FROM public.databasechangeloglock
2023-10-18 04:28:55.452 UTC [84] ERROR: relation "public.databasechangeloglock" does not exist at character 22
2023-10-18 04:28:55.452 UTC [84] STATEMENT: SELECT COUNT(*) FROM public.databasechangeloglock
2023-10-18 04:28:55.860 UTC [60] LOG: checkpoint starting: immediate force wait
2023-10-18 04:28:55.880 UTC [60] LOG: checkpoint complete: wrote 932 buffers (5.7%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.017 s, sync=0.003 s, total=0.021 s; sync files=302, longest=0.001 s, average=0.001 s; distance=17101 kB, estimate=17101 kB; lsn=0/25DF500, redo lsn=0/25DF4C0
2023-10-18 04:28:55.982 UTC [85] LOG: unexpected EOF on client connection with an open transaction
Dear Theodora,
Thank you so much for your response and explanation. It turned out to be memory allocation issue in the pipeline. Reducing docker memory to 512MB solved my issue.
Hi Asmaa,
Just to give you some context, Pipelines builds that run on Atlassian infrastructure use Docker containers. For every step of your build, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. If you use a service for a step, then a second Docker container will start for the service which will share a network adapter with your build container. The repo is cloned in the build container, and then the commands of the step's script are executed. When the step finishes the Docker containers get destroyed.
The first error in the log you shared is the following:
2023-10-18 04:28:55.452 UTC [85] ERROR: relation "public.databasechangeloglock" does not exist at character 22
59
2023-10-18 04:28:55.452 UTC [85] STATEMENT: SELECT COUNT(*) FROM public.databasechangeloglock
The error indicates that the table public.databasechangeloglock doesn't exist in the database. Pipelines doesn't create any tables, you will need to populate the pipelines database with your tables and schema.
I would suggest checking your code to see if the table public.databasechangeloglock is created before the SELECT statement with this table runs.
You can also try debugging this build locally with Docker. You can use the following guide (please ensure that you use the same Docker image you have in your yml file for the build container and any service containers):
There is a section on this guide titled "Testing with build services" that you can use if your step has services.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.