Skip to content

Worker container crashing all the time: baggageclaim exited with error: Exit trace for group: api exited with error: listen tcp 127.0.0.1:7788: bind: address already in use #1969

Closed

Description

@francoisruty

Hi there!

Concourse version: 3.7.0
Deployment method: docker-compose

Every day, all our builds are frozen, stuck in "pending" state forever, because of check-resources step.
If I try to check resources via CLI, I get an internal server error 500 message.
If I log into the worker container and do "concourse worker", I get this:

tcp 127.0.0.1:7777: bind: address already in use"}}
Exit trace for group:
baggageclaim exited with error: Exit trace for group:
api exited with error: listen tcp 127.0.0.1:7788: bind: address already in use

Sometimes I get an additional error message that :53 is already in use too.

To work around the issue, here is my procedure:
stop the containers (docker-compose stop)
rm the containers (docker-compose rm)
rm the worker container volumes (docker volume prune)
restart the containers (docker-compose up -d)
then I do a check-resource via the CLI, which does not work because it stalls the worker
then I do a fly prune-worker
I restart the containers (docker-compose restart)
then I do again a check-resource via CLI, it works, and the builds can start

...aaaand the issue reappears a few hours later.
It has been an nightmare so far, and all our production is messed up because of this. I can't even keep debugging further as I have no clue about what the concourse binary is doing inside the containers, why it's having issues binding to ports.

Any advice is welcome

Activity

  1. vito commented on Jan 18, 2018

    @vito
    Contributor

    That error means some other process is already running and listening on that address/port. I wouldn't run concourse worker multiple times; it makes sense for that to error since the container you're connected to is alread running the same thing.

    Are there any logs from the worker container?

  2. francoisruty commented on Jan 18, 2018

    @francoisruty
    Author

    oh ok I understand, next time it crashes I'll perform a docker log and put the output here (I'll do it within 24 hours)

  3. francoisruty commented on Jan 19, 2018

    @francoisruty
    Author

    Hi, here is more information!

    When I run the check-resource CLI, I get:
    Status: 500 Internal Server Error
    Body:

    And here is the logs from the concourse worker docker container:

    {"timestamp":"1516357280.131446362","source":"tsa","message":"tsa.connection.channel.forward-worker.heartbeat.start","log_level":1,"data":{"remote":"172.18.0.4:59310","session":"1.1.1.875","worker-address":"127.0.0.1:36874","worker-platform":"linux","worker-tags":""}}
    {"timestamp":"1516357280.133530855","source":"guardian","message":"guardian.list-containers.starting","log_level":1,"data":{"session":"12210"}}
    {"timestamp":"1516357280.133656740","source":"guardian","message":"guardian.list-containers.finished","log_level":1,"data":{"session":"12210"}}
    {"timestamp":"1516357280.136282206","source":"tsa","message":"tsa.connection.channel.forward-worker.heartbeat.reached-worker","log_level":0,"data":{"baggageclaim-took":"1.881336ms","garden-took":"2.494279ms","remote":"172.18.0.4:59310","session":"1.1.1.875"}}
    {"timestamp":"1516357280.188725471","source":"tsa","message":"tsa.connection.channel.forward-worker.heartbeat.done","log_level":1,"data":{"remote":"172.18.0.4:59310","session":"1.1.1.875","worker-address":"127.0.0.1:36874","worker-platform":"linux","worker-tags":""}}
    {"timestamp":"1516357283.076795816","source":"guardian","message":"guardian.list-containers.starting","log_level":1,"data":{"session":"12211"}}
    {"timestamp":"1516357283.076904774","source":"guardian","message":"guardian.list-containers.finished","log_level":1,"data":{"session":"12211"}}
    {"timestamp":"1516357283.086884975","source":"baggageclaim","message":"baggageclaim.repository.get-volume.volume-not-found","log_level":1,"data":{"session":"5.14552","volume":"2d145cea-de12-449d-767d-0c91c9e2e6c7"}}
    {"timestamp":"1516357283.086937189","source":"baggageclaim","message":"baggageclaim.api.volume-server.get-volume.volume-not-found","log_level":1,"data":{"session":"6.1.11965","volume":"2d145cea-de12-449d-767d-0c91c9e2e6c7"}}

  4. francoisruty commented on Jan 19, 2018

    @francoisruty
    Author

    If I try to check resource via the UI, I get:
    failed to find created volume in baggageclaim. Volume handle: 2d145cea-de12-449d-767d-0c91c9e2e6c7

  5. francoisruty commented on Jan 19, 2018

    @francoisruty
    Author

    I just thought of something: every night I have a backup script that stops all apps, including Concourse, and then performs a docker system prune
    Could it be that this command delete the anonymous volumes created by the concourse worker?

  6. francoisruty commented on Jan 19, 2018

    @francoisruty
    Author

    mmm I just checked, the script does a docker system prune BEFORE stopping the applications, so it cannot have deleted concourse worker volumes, so the problem comes from somewhere else

  7. francoisruty commented on Jan 24, 2018

    @francoisruty
    Author

    Ok so I have kept investigating, and just restarting the docker-compose app causes the "cannot find baggageclaim volume" error

  8. vito commented on Jan 25, 2018

    @vito
    Contributor

    There's a lot going on here. The "failed to find created volume" error and "volume-not-found", etc. imply that a worker had its data blown away and then came back under the same name. Workers should be retired or pruned when their data is removed. This will be fixed by #1959, but it sounds like your configuration is a bit messed up if it ends up blowing away data on its own.

  9. xtremerui commented on Nov 15, 2023

    @xtremerui
    Contributor

    closing stale issue

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

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions