fvm
fvm copied to clipboard
[BUG]Extremely Slow and Failing fvm install Command
Before creating a bug report please make check the following
- [x] You have read our FAQ
- [x] If you have used flutter. Please install correctly, run
pub cache repair
. Close the terminal and try again. - [x] If you are on Windows. Make sure you are running the terminal as
administrator
or withdeveloper
permissions. - [x] Run
fvm doctor
if possible and add the output to the issue.
fvm doctor
FVM Version: 2.4.1
___________________________________________________
FVM config found:
___________________________________________________
Project: radio_qth_map
Directory: /home/numa08/src/github.com/covelline/radio_qth_map/app/radio_qth_map
Version: 3.16.4
Project Flavor: None selected
___________________________________________________
Version is currently cached locally.
Cache Path: /home/numa08/fvm/versions/3.16.4
Channel: false
SDK Version: 3.16.4
IDE Links
VSCode: .fvm/flutter_sdk
Android Studio: /home/numa08/src/github.com/covelline/radio_qth_map/app/radio_qth_map/.fvm/flutter_sdk
Configured env paths:
___________________________________________________
Flutter:
Dart:
/home/linuxbrew/.linuxbrew/bin/dart
FVM_HOME:
not set
Describe the bug
When using the fvm install command to clone Flutter, I am experiencing significantly slow download speeds for the source code. Here is a copy from the terminal, indicating speeds around 80 ~ 200 KiB/s.
To troubleshoot the issue, I attempted the following:
- Manual Git Clone: I executed git clone [email protected]:flutter/flutter.git -b 3.16.4. This process worked fine with speeds around 10 MiB/s, indicating no issues with cloning speed.
- Using Process.start: Realizing that the git execution is ultimately handled by Dart's Process.start, I wrote and executed the following code to measure the speed .
import 'dart:io';
void main() async {
final p = await Process.start(
'git',
['clone',
'[email protected]:flutter/flutter.git',
'-b',
'3.16.4',
],
runInShell: true,
mode: ProcessStartMode.inheritStdio
);
}
The result was similar to the first test, with cloning speeds of about 10 MiB/s.
- Testing with git.dart Used Internally by FVM: To see if the issue lies within git.dart, which is used internally by FVM, I wrote and executed the following code to measure the speed .
import 'package:test_app/test_app.dart' as test_app;
import 'package:git/git.dart';
void main(List<String> arguments) async {
await runGit(
[
'clone',
'--progress',
'-c',
'advice.detachedHead=false',
'-b',
'3.16.4',
'[email protected]:flutter/flutter.git',
],
echoOutput: true,
);
}
Like the second test, it confirmed sufficient speeds.
It seems the issue might be within FVM's internal implementation or the command-line options being executed. I am unsure of how to resolve this but would appreciate guidance on further steps for a detailed investigation.
To Reproduce Steps to reproduce the behavior:
- Go to terminal..
- Run
fvm use stable
... - Check...
- See error
Expected behavior A clear and concise description of what you expected to happen.
I expect the cloning process to complete at speeds comparable to the standard git command, typically in the range of several tens of MiB/s.
Logs
Please provide the verbose logs by running --verbose
after the command.
fvm install --verbose
Flutter "3.16.4" is not installed.
Installing version: 3.16.4...
Cloning into '/home/numa08/fvm/versions/3.16.4'...
remote: Enumerating objects: 485131, done.
remote: Counting objects: 100% (41909/41909), done.
remote: Compressing objects: 100% (1593/1593), done.
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 4595 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
[ 2m 41.448s] Cloning into '/home/numa08/fvm/versions/3.16.4'...
remote: Enumerating objects: 485131, done.
remote: Counting objects: 100% (41909/41909), done.
remote: Compressing objects: 100% (1593/1593), done.
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 4595 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
[ 2m 41.449s] Internal Error: Could not git clone 3.16.4
Could not install 3.16.4
Please run command with --verbose if you want more information
Desktop (please complete the following information):
- OS: Ubuntu (WSL2)
- FVM Version 2.4.1
- If Windows: Which Powershell are you using?
Additional context Add any other context about the problem here.
I considered the possibility of using the --filter=tree:0 option in the clone command to only clone necessary information.
I'm facing this issue as well! How do we solve it? I'd try the manual method you said and report back
Thank you for your comment.
I also tried cloning manually. The command I used is as follows.
cd $HOME/fvm/versions
git clone [email protected]:flutter/flutter.git -b 3.16.4 --filter=tree:0 ./3.16.4
# and go your project directory that is managed by fvm
fvm use
facing same issue
I am facing same issue with -filter=tree command as well
Maybe this was a hick up on git? if not can you do the same command on version 3.0 beta 5?
github is also slow ... can be an issue. !!!
but i am trying to clone using
git clone [email protected]:flutter/flutter.git -b 3.16.5 --filter=tree:0 ./3.16.5
but it doesn't consider it as a clean setup and delete the folder and its content @leoafarias
I got it working with this --filter=tree command
Be aware of any command that does partial clones, as flutter tooling is tightly dependent on the clone itself and can cause weird issue due to release channel detection and feature flags
I had same problem.
[64] % fvm doctor
No FVM config found:
/Users/yao
Fvm will run the version in your PATH env: /Users/yao/fvm/versions/stable/bin/flutter
Configured env paths:
___________________________________________________
Flutter:
/Users/yao/fvm/versions/stable/bin/flutter
Dart:
/opt/homebrew/bin/dart
FVM_HOME:
not set
i'm facing the same issue, my internet connection is good everything is downloading with the speed of 5mb/s on browser but when i run 'fvm install' then speed is 50, 100, 200, 400 kb/s and then it suddenly stops, please solve this issue.
When you have an issue like this, can you run the clone command through git? This seems to be a git issue, as fvm
is running the clone command behind the scenes. Also, I suggest using version 3.0.0 beta, as it does some optimizations behind the scenes.
I was able to install it by changing my git settings.
$ git config --global http.postBuffer 52428800
$ git config --global core.compression 0
@leoafarias I am facing issue on latest fvm version as well. How to utilize the Git mirroring for faster cloning?
It should already be enabled. Can you try to clone outside of fvm to see if it's an issue with fvm itself?
Anyone with a working solution for this problem ?
@BrianRigii can you run outside of FVM to see if there is a difference in speed?
still the same issue
Sorry, guys. I'm not sure what to do here. The information is not clear on whether it was a Git hiccup or if it's happening internally...