Skip to content

cre update fails with "invalid cross-device link" when /tmp and install dir are on different partitions #249

@takachan0012

Description

@takachan0012

The cre update command fails to complete the update process because it attempts a rename operation across different device boundaries. This is a common issue when /tmp is mounted as a tmpfs or is on a separate partition from the user's home/installation directory.

Error Output:

Updating cre CLI...
Downloading: https://github.com/smartcontractkit/cre-cli/releases/download/v1.0.7/cre_linux_amd64.tar.gz
Error: failed to replace binary: rename /tmp/cre_update_3483520469/cre_v1.0.7_linux_amd64 /root/.cre/bin/cre: invalid cross-device link

Environment:

  • OS: Debian (Linux)
  • Version: upgrading from v1.0.6 to v1.0.7
  • Install Path: /root/.cre/bin/cre

Suggested Fix: In the update logic, if os.Rename fails with an EXDEV error (invalid cross-device link), the tool should fall back to copying the file contents and then deleting the source, or use a temporary directory located on the same partition as the target binary.

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