Skip to content

3.9.1 eats db connections, and db-logs shows lots of errors #2099

Closed

Description

@engrun

Hi

After upgrading to 3.9.1 with concourse-up, we have seen lots of errors in the database logs.

Examples

Variations over this one

2018-03-20 12:18:57 UTC:10.0.0.6(36962):admindasm9syvq9al5iu2wj8j@bosh:[9591]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:18:57 UTC:10.0.0.6(36962):admindasm9syvq9al5iu2wj8j@bosh:[9591]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.

and

2018-03-20 12:02:45 UTC:10.0.0.7(50028):admindasm9syvq9al5iu2wj8j@concourse_atc:[4622]:ERROR: update or delete on table "volumes" violates foreign key constraint "volumes_parent_id_fkey" on table "volumes"

and

2018-03-20 12:16:38 UTC:10.0.0.7(39148):admindasm9syvq9al5iu2wj8j@concourse_atc:[9119]:LOG: unexpected EOF on client connection with an open transaction

and

ERROR: relation "migration_version" does not exist at character 21

(which seems related to #2074)

We also see a lot of db connections being suddenly used, connection count spikes from 25-35 to about 100 in a very short time.
When this happens concourse is so slowed down, that it is rendered useless, and we have to restart the web instance.

  • Concourse version: 3.9.1
  • Deployment type (BOSH/Docker/binary): concourse-up
  • Infrastructure/IaaS: AWS
  • Did this used to work? No problems with 3.8.x

Logs

2018-03-20 12:00:39 UTC:10.0.0.7(47018):admindasm9syvq9al5iu2wj8j@concourse_atc:[3862]:ERROR: update or delete on table "volumes" violates foreign key constraint "volumes_parent_id_fkey" on table "volumes"
2018-03-20 12:00:39 UTC:10.0.0.7(47018):admindasm9syvq9al5iu2wj8j@concourse_atc:[3862]:DETAIL: Key (id, state)=(77702, created) is still referenced from table "volumes".
2018-03-20 12:00:39 UTC:10.0.0.7(47018):admindasm9syvq9al5iu2wj8j@concourse_atc:[3862]:STATEMENT: UPDATE volumes SET state = $1 WHERE (id = $2 AND (state = $3 OR state = $4))
2018-03-20 12:02:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:02:45 UTC:10.0.0.7(50028):admindasm9syvq9al5iu2wj8j@concourse_atc:[4622]:ERROR: update or delete on table "volumes" violates foreign key constraint "volumes_parent_id_fkey" on table "volumes"
2018-03-20 12:02:45 UTC:10.0.0.7(50028):admindasm9syvq9al5iu2wj8j@concourse_atc:[4622]:DETAIL: Key (id, state)=(77724, created) is still referenced from table "volumes".
2018-03-20 12:02:45 UTC:10.0.0.7(50028):admindasm9syvq9al5iu2wj8j@concourse_atc:[4622]:STATEMENT: UPDATE volumes SET state = $1 WHERE (id = $2 AND (state = $3 OR state = $4))
2018-03-20 12:03:31 UTC::@:[3567]:LOG: checkpoint complete: wrote 688 buffers (0.6%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=70.012 s, sync=0.004 s, total=70.030 s; sync files=207, longest=0.003 s, average=0.000 s; distance=17551 kB, estimate=17575 kB
2018-03-20 12:07:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:08:07 UTC::@:[3567]:LOG: checkpoint complete: wrote 440 buffers (0.4%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=45.961 s, sync=0.002 s, total=45.978 s; sync files=132, longest=0.001 s, average=0.000 s; distance=14700 kB, estimate=17287 kB
2018-03-20 12:12:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:12:57 UTC::@:[3567]:LOG: checkpoint complete: wrote 325 buffers (0.3%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=35.189 s, sync=0.003 s, total=35.204 s; sync files=84, longest=0.003 s, average=0.000 s; distance=16238 kB, estimate=17182 kB
2018-03-20 12:16:38 UTC:10.0.0.7(39168):admindasm9syvq9al5iu2wj8j@concourse_atc:[9127]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39164):admindasm9syvq9al5iu2wj8j@concourse_atc:[9125]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39166):admindasm9syvq9al5iu2wj8j@concourse_atc:[9126]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39140):admindasm9syvq9al5iu2wj8j@concourse_atc:[9117]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39140):admindasm9syvq9al5iu2wj8j@concourse_atc:[9117]:LOG: unexpected EOF on client connection with an open transaction
2018-03-20 12:16:38 UTC:10.0.0.7(39158):admindasm9syvq9al5iu2wj8j@concourse_atc:[9122]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39156):admindasm9syvq9al5iu2wj8j@concourse_atc:[9121]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39162):admindasm9syvq9al5iu2wj8j@concourse_atc:[9124]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(38960):admindasm9syvq9al5iu2wj8j@concourse_atc:[9066]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39234):admindasm9syvq9al5iu2wj8j@concourse_atc:[9132]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39148):admindasm9syvq9al5iu2wj8j@concourse_atc:[9119]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:16:38 UTC:10.0.0.7(39148):admindasm9syvq9al5iu2wj8j@concourse_atc:[9119]:LOG: unexpected EOF on client connection with an open transaction
2018-03-20 12:16:38 UTC:10.0.0.7(39178):admindasm9syvq9al5iu2wj8j@concourse_atc:[9130]:LOG: could not receive data from client: Connection reset by peer
2018-03-20 12:17:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:17:43 UTC::@:[3567]:LOG: checkpoint complete: wrote 217 buffers (0.2%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=21.849 s, sync=0.002 s, total=21.862 s; sync files=46, longest=0.002 s, average=0.000 s; distance=16019 kB, estimate=17066 kB
2018-03-20 12:18:57 UTC:10.0.0.6(36962):admindasm9syvq9al5iu2wj8j@bosh:[9591]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:18:57 UTC:10.0.0.6(36962):admindasm9syvq9al5iu2wj8j@bosh:[9591]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:18:57 UTC:10.0.0.6(36962):admindasm9syvq9al5iu2wj8j@bosh:[9591]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', 'e46dbb67-9642-40d2-83cc-895e57778c79', '2018-03-20 12:22:58.729214+0000', '361') RETURNING *
2018-03-20 12:20:01 UTC:10.0.0.6(37010):admindasm9syvq9al5iu2wj8j@bosh:[9799]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:20:01 UTC:10.0.0.6(37010):admindasm9syvq9al5iu2wj8j@bosh:[9799]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:20:01 UTC:10.0.0.6(37010):admindasm9syvq9al5iu2wj8j@bosh:[9799]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', 'abca64a7-4709-4103-91f4-9ecc991d988e', '2018-03-20 12:24:02.200788+0000', '362') RETURNING *
2018-03-20 12:20:08 UTC:10.0.0.6(37048):admindasm9syvq9al5iu2wj8j@bosh:[9808]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:20:08 UTC:10.0.0.6(37048):admindasm9syvq9al5iu2wj8j@bosh:[9808]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:20:08 UTC:10.0.0.6(37048):admindasm9syvq9al5iu2wj8j@bosh:[9808]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '259b72e8-269a-4ff6-93ed-56928b4cdb6f', '2018-03-20 12:24:09.431431+0000', '363') RETURNING *
2018-03-20 12:20:12 UTC:10.0.0.6(37064):admindasm9syvq9al5iu2wj8j@bosh:[9822]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:20:12 UTC:10.0.0.6(37064):admindasm9syvq9al5iu2wj8j@bosh:[9822]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:20:12 UTC:10.0.0.6(37064):admindasm9syvq9al5iu2wj8j@bosh:[9822]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '645acc54-f88b-454e-80b6-3036e2e49909', '2018-03-20 12:24:13.118585+0000', '364') RETURNING *
2018-03-20 12:21:27 UTC:10.0.0.6(37106):admindasm9syvq9al5iu2wj8j@bosh:[10033]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:21:27 UTC:10.0.0.6(37106):admindasm9syvq9al5iu2wj8j@bosh:[10033]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:21:27 UTC:10.0.0.6(37106):admindasm9syvq9al5iu2wj8j@bosh:[10033]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '138826af-4d8d-4599-8417-06cdda9ad09e', '2018-03-20 12:25:28.003263+0000', '365') RETURNING *
2018-03-20 12:21:28 UTC:10.0.0.6(37132):admindasm9syvq9al5iu2wj8j@bosh:[10035]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:21:28 UTC:10.0.0.6(37132):admindasm9syvq9al5iu2wj8j@bosh:[10035]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:21:28 UTC:10.0.0.6(37132):admindasm9syvq9al5iu2wj8j@bosh:[10035]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '0515539d-ca52-4579-9dc3-69345078e09e', '2018-03-20 12:25:29.136944+0000', '366') RETURNING *
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:ERROR: duplicate key value violates unique constraint "oauth_client_details_pkey"
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:DETAIL: Key (client_id, identity_zone_id)=(admin, uaa) already exists.
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:STATEMENT: insert into oauth_client_details (client_secret, resource_ids, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove, lastmodified, required_user_groups, client_id, identity_zone_id, created_by) values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:ERROR: duplicate key value violates unique constraint "oauth_client_details_pkey"
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:DETAIL: Key (client_id, identity_zone_id)=(credhub_cli, uaa) already exists.
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:STATEMENT: insert into oauth_client_details (client_secret, resource_ids, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove, lastmodified, required_user_groups, client_id, identity_zone_id, created_by) values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:ERROR: duplicate key value violates unique constraint "oauth_client_details_pkey"
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:DETAIL: Key (client_id, identity_zone_id)=(atc_to_credhub, uaa) already exists.
2018-03-20 12:21:53 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:STATEMENT: insert into oauth_client_details (client_secret, resource_ids, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove, lastmodified, required_user_groups, client_id, identity_zone_id, created_by) values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)
2018-03-20 12:21:54 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:ERROR: duplicate key value violates unique constraint "external_group_unique_key"
2018-03-20 12:21:54 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:DETAIL: Key (origin, external_group, group_id)=(ldap, cn=test_org,ou=people,o=springsource,o=org, 294aab3d-a50f-4013-9ce3-d4f14584853d) already exists.
2018-03-20 12:21:54 UTC:10.0.0.7(50700):admindasm9syvq9al5iu2wj8j@uaa:[10147]:STATEMENT: insert into external_group_mapping ( group_id,external_group,added,origin,identity_zone_id ) values ($1,lower($2),$3,$4,$5)
2018-03-20 12:21:58 UTC:10.0.0.6(37156):admindasm9syvq9al5iu2wj8j@bosh:[10151]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:21:58 UTC:10.0.0.6(37156):admindasm9syvq9al5iu2wj8j@bosh:[10151]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:21:58 UTC:10.0.0.6(37156):admindasm9syvq9al5iu2wj8j@bosh:[10151]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '7e2e82b1-e55a-45f0-a29a-bdcff2aab849', '2018-03-20 12:25:59.581740+0000', '367') RETURNING *
2018-03-20 12:22:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:22:28 UTC:10.0.0.6(37188):admindasm9syvq9al5iu2wj8j@bosh:[10216]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:22:28 UTC:10.0.0.6(37188):admindasm9syvq9al5iu2wj8j@bosh:[10216]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:22:28 UTC:10.0.0.6(37188):admindasm9syvq9al5iu2wj8j@bosh:[10216]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '74bf4832-bfc2-4219-a53c-e1e9a3f15bd2', '2018-03-20 12:26:29.884028+0000', '368') RETURNING *
2018-03-20 12:22:34 UTC::@:[3567]:LOG: checkpoint complete: wrote 129 buffers (0.1%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=12.989 s, sync=0.002 s, total=12.998 s; sync files=73, longest=0.002 s, average=0.000 s; distance=15833 kB, estimate=16943 kB
2018-03-20 12:22:35 UTC:10.0.0.6(37204):admindasm9syvq9al5iu2wj8j@bosh:[10242]:ERROR: duplicate key value violates unique constraint "locks_name_key"
2018-03-20 12:22:35 UTC:10.0.0.6(37204):admindasm9syvq9al5iu2wj8j@bosh:[10242]:DETAIL: Key (name)=(lock:deployment:concourse) already exists.
2018-03-20 12:22:35 UTC:10.0.0.6(37204):admindasm9syvq9al5iu2wj8j@bosh:[10242]:STATEMENT: INSERT INTO "locks" ("name", "uid", "expired_at", "task_id") VALUES ('lock:deployment:concourse', '895d9fa2-e6cb-46c7-87aa-3794785c91ed', '2018-03-20 12:26:36.967094+0000', '369') RETURNING *
2018-03-20 12:23:16 UTC:10.0.0.7(52982):admindasm9syvq9al5iu2wj8j@concourse_atc:[10395]:ERROR: relation "migration_version" does not exist at character 21
2018-03-20 12:23:16 UTC:10.0.0.7(52982):admindasm9syvq9al5iu2wj8j@concourse_atc:[10395]:STATEMENT: SELECT version FROM migration_version
2018-03-20 12:23:16 UTC:10.0.0.7(53004):admindasm9syvq9al5iu2wj8j@concourse_atc:[10399]:ERROR: relation "migration_version" does not exist at character 21
2018-03-20 12:23:16 UTC:10.0.0.7(53004):admindasm9syvq9al5iu2wj8j@concourse_atc:[10399]:STATEMENT: SELECT version FROM migration_version
2018-03-20 12:27:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:28:39 UTC::@:[3567]:LOG: checkpoint complete: wrote 751 buffers (0.6%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=78.684 s, sync=0.003 s, total=78.698 s; sync files=235, longest=0.002 s, average=0.000 s; distance=19328 kB, estimate=19328 kB
2018-03-20 12:32:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:33:05 UTC::@:[3567]:LOG: checkpoint complete: wrote 398 buffers (0.3%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=44.418 s, sync=0.004 s, total=44.627 s; sync files=100, longest=0.004 s, average=0.000 s; distance=16523 kB, estimate=19048 kB
2018-03-20 12:37:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:38:04 UTC::@:[3567]:LOG: checkpoint complete: wrote 393 buffers (0.3%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=42.254 s, sync=0.110 s, total=42.606 s; sync files=92, longest=0.110 s, average=0.001 s; distance=16372 kB, estimate=18780 kB
2018-03-20 12:42:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:43:01 UTC::@:[3567]:LOG: checkpoint complete: wrote 380 buffers (0.3%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=39.707 s, sync=0.004 s, total=39.725 s; sync files=86, longest=0.004 s, average=0.000 s; distance=16163 kB, estimate=18518 kB
2018-03-20 12:47:21 UTC::@:[3567]:LOG: checkpoint starting: time
2018-03-20 12:48:00 UTC::@:[3567]:LOG: checkpoint complete: wrote 377 buffers (0.3%); 0 transaction log file(s) added, 0 removed, 1 recycled; write=38.611 s, sync=0.003 s, total=38.626 s; sync files=90, longest=0.003 s, average=0.000 s; distance=16184 kB, estimate=18285 kB
----------------------- END OF LOG ----------------------

Activity

  1. engrun commented on Apr 3, 2018

    @engrun
    Author

    We ended up reinstalling Concourse using concourse-up, be we still see a lot of these error messages

    2018-03-27 13:39:00 UTC:10.0.0.7(38584):adminhr7wdjl3mhlw43o7jwlw@concourse_atc:[3197]:DETAIL: Key (id, state)=(1963, created) is still referenced from table "volumes".
    2018-03-27 13:39:00 UTC:10.0.0.7(38584):adminhr7wdjl3mhlw43o7jwlw@concourse_atc:[3197]:STATEMENT: UPDATE volumes SET state = $1 WHERE (id = $2 AND (state = $3 OR state = $4))
    2018-03-27 13:39:00 UTC:10.0.0.7(38584):adminhr7wdjl3mhlw43o7jwlw@concourse_atc:[3197]:ERROR: update or delete on table "volumes" violates foreign key constraint "volumes_parent_id_fkey" on table "volumes"
    
  2. vito commented on Jan 3, 2019

    @vito
    Contributor

    Those error messages are benign - we can/should make the garbage-collector avoid triggering those 'errors', but it's really just the database integrity doing its job to keep volumes from being removed prematurely. Closing as a dupe of #1215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions