Skip to content

Set HOME variable in containers to avoid a permissions error when git persists configuration#3559

Open
guptapratykshh wants to merge 1 commit intoaugurlabs:mainfrom
guptapratykshh:fix/docker-startup-race-condition
Open

Set HOME variable in containers to avoid a permissions error when git persists configuration#3559
guptapratykshh wants to merge 1 commit intoaugurlabs:mainfrom
guptapratykshh:fix/docker-startup-race-condition

Conversation

@guptapratykshh
Copy link
Copy Markdown
Contributor

@guptapratykshh guptapratykshh commented Jan 11, 2026

Description
this solves docker startup race conditions by adding a database health check and setting HOME=/tmp for handling permissions.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

@guptapratykshh guptapratykshh force-pushed the fix/docker-startup-race-condition branch 2 times, most recently from dc95d67 to 91d0576 Compare January 11, 2026 18:10
@guptapratykshh guptapratykshh changed the title Fix race condition in Docker startup and enforce LF for shell scripts Fix race condition in Docker startup Jan 11, 2026
networks:
- augur
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${AUGUR_DB_USER:-augur} -d augur"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an environment variable that allows the value of the database augur uses to be configured? if so we should use that for the -d argument

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the one have added there also- AUGUR_DB_NAME:-augur

Comment on lines 89 to 91
- redis
- augur-keyman
- rabbitmq
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one of the other PRs for this also had changes to these lines to specifiy that they could start as long as the DB was up (before it becomes healthy).

is that the default behavior?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, service_started is default behavior when no condition is specified. I have updated docker-compose.yml
to explicitly state condition: service_started for Redis, Keyman, and RabbitMQ to avoid any ambiguity, while keeping the strict service_healthy check for the database to prevent race condition.

@MoralCode MoralCode linked an issue Jan 11, 2026 that may be closed by this pull request
@guptapratykshh guptapratykshh force-pushed the fix/docker-startup-race-condition branch from 91d0576 to 06a58a2 Compare January 12, 2026 04:11
@MoralCode MoralCode added the redundant PR is submitted in parallel with another mutually exclusive PR label Jan 19, 2026
@MoralCode
Copy link
Copy Markdown
Collaborator

Superseded by #3613

@MoralCode
Copy link
Copy Markdown
Collaborator

This doesnt solve the linked issue by itself, but still may be important to merge

@MoralCode
Copy link
Copy Markdown
Collaborator

Hello! Just wanted to check in to see if you were still interested in helping the maintainers merge this PR. We noticed it has been a little while since this last had activity, and are considering closing it or taking it over if it remains in its current state.

Please react to or reply to this to confirm your interest in the next 7 days or let us know if you are no longer interested in this so we can best prioritize everyone's contributions.

Thanks!

@MoralCode MoralCode added the stale Stuff that's abandoned or not making forward progress and may need taking over/reassignment/closing label Feb 9, 2026
@MoralCode MoralCode force-pushed the fix/docker-startup-race-condition branch from 56645df to 0468a53 Compare February 16, 2026 16:28
@MoralCode
Copy link
Copy Markdown
Collaborator

Im taking over and repurposing this issue to just contain the HOME fix because the rest of the fix is already present in #3613

@MoralCode MoralCode self-assigned this Feb 16, 2026
@MoralCode MoralCode added containers Related to augur in containers, container images, or the compose file, either in podman or in docker ready Items tested and seeking additional approvals or a merge. Usually for items under active development and removed redundant PR is submitted in parallel with another mutually exclusive PR stale Stuff that's abandoned or not making forward progress and may need taking over/reassignment/closing labels Feb 16, 2026
@MoralCode MoralCode changed the title Fix race condition in Docker startup Set HOME variable in containers to avoid a permissions error when git persists credentials Feb 16, 2026
@MoralCode MoralCode moved this to Dev Testing in Augur TSC Feb 16, 2026
@MoralCode MoralCode changed the title Set HOME variable in containers to avoid a permissions error when git persists credentials Set HOME variable in containers to avoid a permissions error when git persists configuration Mar 16, 2026
@MoralCode
Copy link
Copy Markdown
Collaborator

@ABrain7710 Could this complement your work on facade credentials? I think this particular issue relates to the creation of .gitconfig, which i think git defaults to using the homedir for. maybe we should redirect this to the config dir to persist it?

@MoralCode
Copy link
Copy Markdown
Collaborator

https://stackoverflow.com/a/6172338 (symlinking) may also be a potential option. Part of the issue is that our custom user in docker land doesnt have their own homedir.

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

Labels

containers Related to augur in containers, container images, or the compose file, either in podman or in docker ready Items tested and seeking additional approvals or a merge. Usually for items under active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants