vtsykun / packeton

:package: Private, self-hosted Packagist/Composer/Satis repository with unlimited private repos.
https://demo.packeton.org
MIT License
414 stars 64 forks source link

Can't mirror repo.packagist.org: Mssing parameter "since" #305

Closed hopeseekr closed 1 day ago

hopeseekr commented 2 days ago

Description

Update of mirror https://repo.packagist.org complete Remove all sync data and execute full resync! All data removed! Loading root file packages.json Downloading https://repo.packagist.org/packages.json [200] https://repo.packagist.org/packages.json Downloading https://packagist.org/metadata/changes.json?since=0 [400] https://packagist.org/metadata/changes.json?since=0 The "https://packagist.org/metadata/changes.json?since=0" file could not be downloaded (HTTP/2 400 ): {"error":"Invalid or missing \u0022since\u0022 query parameter, make sure you store the timestamp at the initial point you started mirroring, then send that to begin receiving changes, e.g. https:\/\/... Not found packages for resync

Can you reproduce the bug on the Packeton demo site?

Not applicable

Database

PostgreSQL

Screenshots

No response

How are you running Packeton?

docker compose

vtsykun commented 2 days ago

Hi @hopeseekr

This is not a bug. If the parameter since is missing, Packeton will attempt to update all packages that was used before for this proxy. (See Used packages grid), I tested on demo and it seems to work fine.

Remove all sync data and execute full resync!
All data removed!
Loading root file packages.json
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Downloading https://packagist.org/metadata/changes.json?since=0
[400] https://packagist.org/metadata/changes.json?since=0
The "https://packagist.org/metadata/changes.json?since=0" file could not be downloaded (HTTP/2 400 ):
{"error":"Invalid or missing \u0022since\u0022 query parameter, make sure you store the timestamp at the initial point you started mirroring, then send that to begin receiving changes, e.g. https:\/\/...
Downloading https://repo.packagist.org/p2/intervention/image.json
Downloading https://repo.packagist.org/p2/intervention/image~dev.json
Downloading https://repo.packagist.org/p2/darkaonline/l5-swagger.json
Downloading https://repo.packagist.org/p2/darkaonline/l5-swagger~dev.json
Downloading https://repo.packagist.org/p2/seld/signal-handler.json
Downloading https://repo.packagist.org/p2/seld/signal-handler~dev.json
Downloading https://repo.packagist.org/p2/sebastian/lines-of-code.json
Downloading https://repo.packagist.org/p2/sebastian/lines-of-code~dev.json
Downloading https://repo.packagist.org/p2/phpunit/php-text-template.json
Downloading https://repo.packagist.org/p2/phpunit/php-text-template~dev.json
Downloading https://repo.packagist.org/p2/league/mime-type-detection.json
Too many debug logs, suppress debug logging...
Downloading https://repo.packagist.org/p2/league/mime-type-detection~dev.json
Updated packages: 110

https://demo.packeton.org/proxies/packagist

hopeseekr commented 1 day ago

The current config/packages/packagist.yaml

packeton:
    mirrors:
        packagist:
            url: https://repo.packagist.org
            public_access: true
            lazy: false

I got it working by adding that file and then running the following commands:

docker compose down
docker compose build
docker compose up -d
docker compose exec packagist bash
# From inside the docker container:
php bin/console packagist:sync:mirrors packagist -vvv

Then it started mirroring all of packagist.org.