Skip to content

Download dev sources outside the shared web root - #332

Open
nupplaphil wants to merge 2 commits into
friendica:stablefrom
nupplaphil:fix/dev-download-race
Open

nupplaphil wants to merge 2 commits into
friendica:stablefrom
nupplaphil:fix/dev-download-race

Conversation

@nupplaphil

Copy link
Copy Markdown
Collaborator

The dev/rc entrypoint downloads the tarball into the working directory /var/www/html, which is a volume shared by every container of an installation. Containers starting at the same time overwrite each other's download and fail with a truncated archive or a bad signature.

Changes:

  1. Download tarball and signature to /usr/src instead of the working directory
  2. Run update.sh

Found in my instance (friendica.me)

nupplaPhil added 2 commits October 8, 2026 22:49
The tarball was written to the working directory /var/www/html, which is a volume shared by every container of an installation. Containers starting at the same time overwrote each other's download and failed with a truncated archive or a bad signature.
@nupplaphil nupplaphil added the Bug Something isn't working label Oct 8, 2026
@ne20002

ne20002 commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Never had that problem. Do you have multiple Friendica containers running in parallel (the cron variant doesn't count as it does not use the docker-entrypoint-dev.sh script) ?

@nupplaphil

Copy link
Copy Markdown
Collaborator Author

Yes. I'm running cron and 4 appContainer in parallel for Performance purpose. And all starts downloading the sources in parallel which lead to these errors :)

@ne20002

ne20002 commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

I see. I just have a single app container and one for cron.
Wouldn't be setting FRIENDICA_UPGRADE to true for only one of your containers and false to the rest of it also fix the problem? And also prevent the other containers from downloading at all?

With this it is writing to the conatiners overlay volume. We do this in other places as well ... so I assume it is okay.

@ne20002
ne20002 self-requested a review October 10, 2026 16:40
@nupplaphil

Copy link
Copy Markdown
Collaborator Author

It's not a setting for each Container. The Container span just with one config in docker compose and it spans automatically each insurances

@ne20002

ne20002 commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

I see. I have limited knowledge of compose as I use podman with systemd for my systems.

But how about duplicating the section? I would think of something like spanning up one container as main container first (with the update), then the cron container, then the other three afterwards. Shouldn't that be possible?

@nupplaphil

Copy link
Copy Markdown
Collaborator Author

This is how kubernetes works with an "init" Container. I'll give it a try

Nevertheless I think this is an improvement so there's no race condition at one directory

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

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants