Closed hannius closed 3 years ago
I have similar error with similar deployment:
docker-compose:
version: '3'
services:
satis:
image: composer/satis
volumes:
- ./docker-data/build:/build
- ./satis.json:/build/satis.json
- ./ssh-keys:/root/.ssh
- ./docker-data/satis-composer:/composer
- ./auth.json:/composer/auth.json
satis.json:
{
"name": "zzz/www",
"homepage": "https://XXXX",
"repositories": [
{ "type": "vcs", "url": "git@gitlab.com:xxx/yyy.git" }
],
"require": {
"xxx/yyy": "*"
},
"require-all": false,
"require-dependencies": false,
"require-dev-dependencies": false,
"archive": {
"directory": "dist",
"skip-dev": true,
"prefix-url": "https://XXXX",
"checksum": false
}
}
The problem appers somewhere from 2021-07-02 13:30:00 (GMT+0200) (our last successfull build)
EDIT: I have also some previous error (which I fixed by changing "name" in satis.json):
In RootPackageLoader.php line 76:
[RuntimeException]
Your package name XXX Composer Repository is invalid, it should hav
e a vendor name, a forward slash, and a package name. The vendor and packag
e name can be words separated by -, . or _. The complete name should match
"^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$".
the problem appears after updating the latest image of satis
I have similar error with similar deployment:
docker-compose:
version: '3' services: satis: image: composer/satis volumes: - ./docker-data/build:/build - ./satis.json:/build/satis.json - ./ssh-keys:/root/.ssh - ./docker-data/satis-composer:/composer - ./auth.json:/composer/auth.json
satis.json:
{ "name": "zzz/www", "homepage": "https://XXXX", "repositories": [ { "type": "vcs", "url": "git@gitlab.com:xxx/yyy.git" } ], "require": { "xxx/yyy": "*" }, "require-all": false, "require-dependencies": false, "require-dev-dependencies": false, "archive": { "directory": "dist", "skip-dev": true, "prefix-url": "https://XXXX", "checksum": false } }
The problem appers somewhere from 2021-07-02 13:30:00 (GMT+0200) (our last successfull build)
EDIT: I have also some previous error (which I fixed by changing "name" in satis.json):
In RootPackageLoader.php line 76: [RuntimeException] Your package name XXX Composer Repository is invalid, it should hav e a vendor name, a forward slash, and a package name. The vendor and packag e name can be words separated by -, . or _. The complete name should match "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]?|-{0,2})[a-z0-9]+)*$".
Do you resolved the problem?
I have to manually add the parameters :"--skip-errors" to continue running the process Below is the Command:
php -d memory_limit=2GB /satis/bin/satis --ansi -vvv build /build/satis.json /build/output --skip-errors
And this is the detailed Information:
@Seldaek any idea if this could be related to the new parallel downloading?
Could it be? Yes perhaps.. Is it? I have no idea, sorry.
@alcohol @Seldaek Do you have the same problem using the latest satis image from kubernetes deployment
I do not use satis in kubernetes nor do I have access to any kubernetes environments at the moment.
I was however able to reproduce this locally.
The following satis.json produces no errors for me:
{
"name": "my/repo",
"homepage": "http://localhost",
"repositories": [
{ "type": "vcs", "url": "https://github.com/thephpleague/iso3166" },
{ "type": "vcs", "url": "https://github.com/alcohol/iso4217" }
]
}
However, the moment I add custom archive options, things break. The following satis.json did manage to reproduce the issue:
{
"name": "my/repo",
"homepage": "http://localhost",
"archive": {
"directory": "dist",
"format": "tar",
"prefix-url": "http://localhost",
"skip-dev": true
},
"repositories": [
{ "type": "vcs", "url": "https://github.com/thephpleague/iso3166" },
{ "type": "vcs", "url": "https://github.com/alcohol/iso4217" }
]
}
I'm guessing there is something broken in the way archives are created.
@GromNaN Sorry to put this on you again; but is there any chance you could take the time to see if and why the Composer 2.0 changes might have broken this?
The paths here don't line up with the exception, but it could very well be that even in very very verbose mode we're missing one or two steps in the output. Also the unzip command is mentioned as being async; which is something Composer 2.0 introduced if I am not mistaken.
Dumping package 'alcohol/iso4217' in version '1.0.2'.
- Downloading alcohol/iso4217 (1.0.2)
Downloading https://api.github.com/repos/alcohol/iso4217/zipball/6c7d7b552765f479a2a1a82cba0dcfcd3b5b9dce
[302] https://api.github.com/repos/alcohol/iso4217/zipball/6c7d7b552765f479a2a1a82cba0dcfcd3b5b9dce
Following redirect (1) https://codeload.github.com/alcohol/iso4217/legacy.zip/6c7d7b552765f479a2a1a82cba0dcfcd3b5b9dce
[200] https://codeload.github.com/alcohol/iso4217/legacy.zip/6c7d7b552765f479a2a1a82cba0dcfcd3b5b9dce
Writing /composer/cache/files/alcohol/iso4217/fc6334ec9028712a759f50be0364ab535dd79415.zip into cache from /build/vendor/composer/tmp-821d89fe4a0f453b645d33bed3368778
- Installing alcohol/iso4217 (1.0.2): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/build/vendor/composer/tmp-821d89fe4a0f453b645d33bed3368778' -d '/build/vendor/composer/16f01bc8'
In Filesystem.php line 352:
[ErrorException]
copy(/tmp/composer_archive60ebe85c10f00.tar): Failed to open stream: No such file or directory
I think the problem is caused by $promise = $this->process->executeAsync($command); here https://github.com/composer/composer/blob/master/src/Composer/Downloader/ZipDownloader.php#L119. $promise->then is never called. Maybe https://github.com/composer/composer/blob/master/src/Composer/Package/Archiver/ArchiveManager.php#L192 is called before the async process is finished? If async command is replaced by $status = $this->process->execute($command); it seems to work
There was definitely a bug in ArchiveManager there, which is fixed by https://github.com/composer/composer/commit/b602b19f6dae8792cf8814fd4408ec9b524474e4 - I don't know if that fixes the issue here or not though.
I just patched a Satis instance hitting this bug with the fix @Seldaek pushed and it fixed the bug there.
As soon as a new minor or patch version of composer/composer
is released, I'll update the .lock file of Satis.
tks, i will update for checking
there is a workaround here: I built the docker image myself from this commit https://github.com/composer/satis/commit/4d42fc6cc24df214a3c52af8ae7ea4a629fded56 and it works
You can do the same or use my built docker image here temporarily until a new official docker image is updated for the fix https://hub.docker.com/layers/hoatle/satis/4d42fc6/images/sha256-c06491e6a5b8bbf551ca5adce89d38f0d6e29e919c94d2e194cdcdf5f2fc4b09?context=repo
There was definitely a bug in ArchiveManager there, which is fixed by composer/composer@b602b19 - I don't know if that fixes the issue here or not though.
It fixes for me... But @Seldaek do you know when the next release of composer/composer with your fix will come out?
Probably next week
Nice :) Thank you
I am still seeing a similar error even with the latest commits. I am guessing this here https://github.com/composer/satis/blob/main/src/Builder/ArchiveBuilder.php#L200 only creates a promise which needs to be dealt with.
I tried this
$promise = $downloader->download($package, $downloadDir);
\Composer\Util\SyncHelper::await($this->composer->getLoop(), $promise);
but that didn't seem to work.
@fooman if you are confident it is the same issue, we can reopen this. If not, please open a new issue. Include relevant stack traces and logs, and ideally a reproducible scenario.
@alcohol it is the same as https://github.com/composer/satis/issues/671 now with a PR https://github.com/composer/satis/pull/685
Hello, I've deployed a satis instance using the satis.json from k8s : 1、the configmap file is below:
and i have deployed the satis pod using the persistent volumn that is the way of hostpath
2、the deployment file is below:
but when the pod is running, i find the error logs:
could you help me to solve the problem, thanks very much!