Compare commits

...

1 Commits

Author SHA1 Message Date
19364ad5c2 resolve failed handshake connection with https://wixur.ir:3000
All checks were successful
Production — tag build, push, deploy / build-and-push (push) Successful in 42s
Production — tag build, push, deploy / deploy (push) Successful in 21s
2026-08-31 10:04:30 +03:30
2 changed files with 39 additions and 1 deletions

View File

@@ -439,6 +439,19 @@ docker volume rm dyolink_postgres_data_prod
Add `"insecure-registries": ["wixur.ir:3000"]` to `/etc/docker/daemon.json` and restart Docker. Add `"insecure-registries": ["wixur.ir:3000"]` to `/etc/docker/daemon.json` and restart Docker.
### `connection reset by peer` while pulling `:v*` from Gitea
`docker login` succeeded, then `compose pull` failed on a frontend/backend manifest or layer from `wixur.ir:3000`. Auth is fine — the Windows Gitea registry dropped the TCP connection (common right after a large push, or when both images pull in parallel).
Images are already in the registry. Re-run only the **deploy** job, or on the VPS:
```bash
cd /opt/dyolink/infrastructure
./scripts/prod-remote-deploy.sh v1.0.2
```
`prod-remote-deploy.sh` pulls backend then frontend with retries. If every attempt RSTs, check Gitea is up and `insecure-registries` includes `wixur.ir:3000`.
### View logs ### View logs
```bash ```bash

View File

@@ -18,8 +18,33 @@ if ! grep -q '^REGISTRY_PREFIX=.\+' .env; then
fi fi
export TAG export TAG
# Windows Gitea often RSTs concurrent or long pulls (connection reset by peer).
# Pull one image at a time with backoff so a flake does not fail the whole tag.
pull_one() {
local service="$1"
local attempt=1
local max=5
local delay=8
while [ "$attempt" -le "$max" ]; do
echo "Pulling $service :$TAG (attempt $attempt/$max)"
if docker compose -f docker-compose.prod.yml --env-file .env pull "$service"; then
return 0
fi
if [ "$attempt" -eq "$max" ]; then
echo "Failed to pull $service after $max attempts"
return 1
fi
echo "Pull of $service failed; retrying in ${delay}s..."
sleep "$delay"
delay=$((delay * 2))
attempt=$((attempt + 1))
done
}
echo "Pulling backend/frontend :$TAG from Gitea (REGISTRY_PREFIX in .env)" echo "Pulling backend/frontend :$TAG from Gitea (REGISTRY_PREFIX in .env)"
docker compose -f docker-compose.prod.yml --env-file .env pull backend frontend pull_one backend
pull_one frontend
docker compose -f docker-compose.prod.yml --env-file .env up -d docker compose -f docker-compose.prod.yml --env-file .env up -d
echo "=== Status ===" echo "=== Status ==="
docker compose -f docker-compose.prod.yml --env-file .env ps docker compose -f docker-compose.prod.yml --env-file .env ps