Skip to content

Bug: os.Rename cause "invalid cross-device link" error when running in docker #65

@mikca

Description

@mikca

Running proxy in docker as described in https://github.com/git-pkgs/proxy?tab=readme-ov-file#docker get an issue that proxy responds 502.
In console I see something like this:

{"time":"2026-04-06T08:49:26.911559004Z","level":"ERROR","msg":"failed to get artifact","error":"storing artifact: closing writer: blob (key \"composer/friendsofphp/php-cs-fixer/v3.94.2/7787ceff91365ba7d623ec410b8f429cdebb4f63\") (code=Unknown): rename /tmp/7787ceff91365ba7d623ec410b8f429cdebb4f63.18a3b85828d4fe9d.tmp /data/cache/artifacts/composer/friendsofphp/php-cs-fixer/v3.94.2/7787ceff91365ba7d623ec410b8f429cdebb4f63: invalid cross-device link"}
{"time":"2026-04-06T08:49:26.911577577Z","level":"INFO","msg":"request","request_id":"ab8f1849f3c2/W1FIS5XTgy-000017","method":"GET","path":"/composer/files/friendsofphp/php-cs-fixer/v3.94.2/7787ceff91365ba7d623ec410b8f429cdebb4f63","status":502,"duration":987762240,"remote":"172.20.3.1"}

If I run it without volume mapping - everything works great.

After some readings, I found that os.Rename won't work in Docker container with Volumes.
For example:
https://gist.github.com/var23rav/23ae5d0d4d830aff886c3c970b8f6c6b
google/go-cloud#3294
https://github.com/google/renameio

It would be nice if you checked it and made it work.

PS: You are doing a great job, thank you, I'm really appreciating it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions