Closed NikoGrano closed 3 years ago
This issue I've never suffered before. I get this issue #6 and issue #8, but it's resolved.
As far as I know, using the ./mirror.php --v2
is good enough to setup the Composer V2
mirror at most of usual moments.
The ./mirror.php --resync -v
command is to force to sync all Composer mirror.
Maybe it can do following steps:
./mirror.php --v2
command../mirror.php --resync -v
.Well, I'll try purge the downloaded files... It just takes with ZFS ages to complete 😓
12 hours later, 10M inodes purged, lot of inodes rebuilt and it magically created the packages.json...
I decided to not support v1. It's anyways deprecated and probable going away in close future.
Hi,
Thanks @peter279k ;)
mirror.config.php
<?php
return [
// directory where metadata files will get saved
'target_dir' => '/var/repos/mirror',
// user agent describing your mirror node, if possible include domain name of mirror, and a contact email address
'user_agent' => 'Just testing mirror script',
// source repository URL
'repo_url' => 'https://repo.packagist.org',
// source repository hostname (optional, will guess from repo_url)
//'repo_hostname' => 'repo.packagist.org',
// source API URL
'api_url' => 'https://packagist.org',
// how many times the script will run the mirroring step before exiting
'iterations' => 120,
// how many seconds to wait between mirror runs
'iteration_interval' => 10,
// set this to false if you do not run the --v1 mirror job, to ensure that the v2 will then take care of syncing packages.json
'has_v1_mirror' => true,
];
System:
$ php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Following steps done:
mv /var/repos/mirror/p2{,.old}
)../mirror.php --v2 -v.
FIrst time :[Exception] Too many retries, could not update /p2/orangesoft/retry ~ dev.json as the origin server returns an older file (1623049587, expected 1623230730) PHP Fatal error: Uncaught Exception: Too many retries, could not update /p2/orangesoft/retry~dev.json as the origin server returns an older file (1623049587, expected 1623230730) in /var/repos/mirror-composer/mirror.php:278
2nd :
[Exception] Too many retries, could not update /p2/discourse/wp-discourse ~ dev.json as the origin server returns an older file (1622833635, expected 1623230778) PHP Fatal error: Uncaught Exception: Too many retries, could not update /p2/discourse/wp-discourse~dev.json as the origin server returns an older file (1622833635, expected 1623230778) in /var/repos/mirror-composer/mirror.php:278
==> change iteration_interval' to 20 :(
Exception] Too many retries, could not update /p2/myfatoorah/omnipay.json as the origin server returns an older file (1623230171, expected 1623230877) PHP Fatal error: Uncaught Exception: Too many retries, could not update /p2/myfatoorah/omnipay.json as the origin server returns an older file (1623230171, expected 1623230877) in /var/repos/mirror-composer/mirror.php:278
==> Switch to https://packagist.fr/ HTTP404 Not Found returned for "https://packagist.fr/metadata/changes.json?since=16232308555191". ==> Switch to https://packagist.fi/ HTTP404 returned for "https://packagist.fi/metadata/changes.json?since=16232308555191". ==> Switch to https://repo.packagist.org/ HTTP200 https://repo.packagist.org/metadata/changes.json?since=16232308555191 BUT
[Exception] Too many retries, could not update /p2/pdir/convert-to-bundle.json as the origin server returns an older file (1615280716, expected 1623231541) PHP Fatal error: Uncaught Exception: Too many retries, could not update /p2/pdir/convert-to-bundle.json as the origin server returns an older file (1615280716, expected 1623231541) in /var/repos/mirror-composer/mirror.php:278
lots of MMMMMMMMM
and some --
Downloaded 611091 files
and still no package.json nor packages.json.gz on mirror's root :(
drwxrwxr-x 1 me me 2842624 juin 9 12:18 p2/ drwxrwxr-x 1 me me 2654208 juin 8 23:51 p2.old/
Sorry. I cannot help you because I cannot reproduce your issue.
I follow your steps to create Composer mirror and it doesn't have any error.
I guess that the Network bandwidth is not good enough and it causes syncing mirror is not done correctly.
I give another try
rm -Rf /var/repos/mirror
./mirror.php --v2 -v
1st time :
could not update /p2/symfony/mime~dev.json as the origin server returns an older file (1623236285, expected 1623236315)
2nd time
could not update /p2/symfony/symfony ~ dev.json as the origin server returns an older file (1623236300, expected 1623236338)
3rd
/p2/laravel-enso/addressesmanager ~ dev.json as the origin server returns an older file (1623231058, expected 1623236348)
4th
Downloaded 10 files
No work
No work
MM
Downloaded 2 files
M
Downloaded 1 files
MM
Downloaded 2 files
No work
MM
Downloaded 2 files
MM
Downloaded 2 files
No work
MM
Downloaded 2 files
and finally
could not update /p2/bearlord/esd-yii.json as the origin server returns an older file (1607506142, expected 1623236422)
OK let's brute force :-1:
while [ $? != 0 ]; do ./mirror.php --v2 -v; done gave lots of stack trace but 4 hours later still no packages.json :(
Sorry. I cannot help you because I cannot reproduce your issue.
I follow your steps to create Composer mirror and it doesn't have any error.
I guess that the Network bandwidth is the good enough and it causes syncing mirror is not done correctly.
Tested from a VPS @ OVH :-1: :(
$ ./mirror.php --v2 -v
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMRMRMRMRMRRRRRRRRRRRMirror v2 job failed at 2021-06-09 16:30:12 [Exception] Too many retries, could not update /p2/lullabot/drupal-symfony-lock ~ dev.json as the origin server returns an older file (1607990824, expected 1623256201) PHP Fatal error: Uncaught Exception: Too many retries, could not update /p2/lullabot/drupal-symfony-lock~dev.json as the origin server returns an older file (1607990824, expected 1623256201) in /home/steph/mirror-composer/mirror.php:278 Stack trace:
0 /home/steph/mirror-composer/mirror.php(383): Mirror->{closure}(Object(Symfony\Component\HttpClient\Response\CurlResponse), Array)
1 /home/steph/mirror-composer/mirror.php(151): Mirror->downloadV2Files(Array)
2 /home/steph/mirror-composer/mirror.php(796): Mirror->syncV2()
3 {main}
thrown in /home/steph/mirror-composer/mirror.php on line 278
Fatal error: Uncaught Exception: Too many retries, could not update /p2/lullabot/drupal-symfony-lock~dev.json as the origin server returns an older file (1607990824, expected 1623256201) in /home/steph/mirror-composer/mirror.php:278 Stack trace:
0 /home/steph/mirror-composer/mirror.php(383): Mirror->{closure}(Object(Symfony\Component\HttpClient\Response\CurlResponse), Array)
1 /home/steph/mirror-composer/mirror.php(151): Mirror->downloadV2Files(Array)
2 /home/steph/mirror-composer/mirror.php(796): Mirror->syncV2()
3 {main}
thrown in /home/steph/mirror-composer/mirror.php on line 278
Relaunched ... new error elsewhere
Just share my experiences.
I do same steps about running ./mirror.php --v2 -v
command on different hosts that provided by different host providers and I got different results.
And one of host that I need to run the ./mirror.php --resync -v
command to be forced to sync Composer mirror.
Shall we hence reopen the issue ?
I think it doesn't have to reopen this issue because it's out of scope for this repository.
I think I've found the workaround. See PR #11 :)
:frowning: I've alas understood why packages.json was missing... 'has_v1_mirror' must be set to false ! :confounded:
Seen in mirror.php#L67, I didn't understood this param correctly
./mirror.php --resync -v
After this I see there is only
p2
folder created withoutpackages.json
.If I try run
--v2
it just fails.Config
System