apache / apache/shenyu

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

Open
#5,976 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

### Is there an existing issue for this?

- [x] 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:

```bash
git clone https://github.com//shenyu.git
```

3. Observe the error during the clone process:

```vb
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

```markdown
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_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Windows clone and checkout failure using the paths shown in the error, then compare the repository layout with Git's long-path handling and the suggested configuration. No project file or test is identified in the issue, so first determine whether a repository change is possible rather than a local Git or Windows configuration change. Done means the repository clones and checks out successfully on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
developer-experience, operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.