Skip to content

[BUG] Unable to clone the ShenYu repository due to "Filename too long" error on Windows #5976

Open
@PengJingzhao

Description

@PengJingzhao

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

[BUG] Unable to clone and checkout the ShenYu repository due to "Filename too long" error during the process.

From the error messages, the issue appears to be related to file path length exceeding the maximum allowed by the operating system during the clone and checkout process. However, the repository was cloned to the root of the D drive, which should have minimized the path length.

To resolve the issue, I suggest the following potential solutions:

  1. Enable support for long file paths in Windows:
    • Open Group Policy Editor and navigate to Computer Configuration -> Administrative Templates -> System -> Filesystem.
    • Enable the policy named Enable Win32 long paths.
  2. Update Git configuration to support long paths:
    • Run the command: git config --system core.longpaths true.
  3. Clone the repository using a shorter directory path or try moving the repository to another location. For example, clone to C:\shenyu.

If the issue persists, please provide additional guidance.

Expected Behavior

Successfully clone the ShenYu repository and checkout the working tree without any errors.

Steps To Reproduce

  1. Fork the ShenYu repository to your GitHub account.

  2. Clone the repository to your local machine using the following command:

    git clone https://github.com/<your-username>/shenyu.git
  3. Observe the error during the clone process:

    Cloning into 'D:\shenyu'...
    remote: Enumerating objects: 157976, done.
    remote: Counting objects: 100% (6791/6791), done.
    remote: Compressing objects: 100% (481/481), done.
    remote: Total 157976 (delta 6537), reused 6317 (delta 6300), pack-reused 151185
    Receiving objects: 100% (157976/157976), 61.53 MiB | 1.86 MiB/s, done.
    Resolving deltas: 100% (54177/54177), done.
    error: unable to create file shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-dubbo/shenyu-spring-boot-starter-plugin-apache-dubbo/src/main/java/org/apache/shenyu/springboot/starter/plugin/apache/dubbo/ApacheDubboPluginConfiguration.java: Filename too long
    error: unable to create file shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-dubbo/shenyu-spring-boot-starter-plugin-apache-dubbo/src/test/java/org/apache/shenyu/springboot/starter/plugin/apache/dubbo/ApacheDubboPluginConfigurationTest.java: Filename too long
    Updating files: 100% (4230/4230), done.
    fatal: unable to checkout working tree
    warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry with 'git restore --source=HEAD :/'

Environment

ShenYu version(s): master
Operating System: Windows
Git version: 2.x
Disk location for clone: D:\ (Root directory)

Debug logs

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions