Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to flutter <command> #368

Closed
3 of 4 tasks
btrautmann opened this issue Nov 12, 2021 · 18 comments
Closed
3 of 4 tasks

[BUG] Unable to flutter <command> #368

btrautmann opened this issue Nov 12, 2021 · 18 comments
Labels
bug Something isn't working

Comments

@btrautmann
Copy link

Before creating a bug report please make check the following

  • You have read our FAQ
  • If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • Run fvm doctor if possible and add the output to the issue.

fvm doctor:

No FVM config found:
/Users/brandontrautmann/src/mobile/flutter
Fvm will run the version in your PATH env: /Users/brandontrautmann/fvm/default/bin/flutter

Configured env paths:
___________________________________________________

Flutter:
/Users/brandontrautmann/fvm/default/bin/flutter

Dart:
/Users/brandontrautmann/fvm/default/bin/dart

FVM_HOME:
not set

Describe the bug
Running flutter <command> e.g flutter pub get fails with the following error:

Downloading Material fonts...                                      727ms
Downloading Material fonts...                                      500ms
Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip. Ensure you have network connectivity and then
try again.
Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum VF/LGEVR6qaggyU/Ekykeg==,
but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming that your network
connection is stable.

To Reproduce

  1. Install fvm 2.2.4 via:
tap "leoafarias/fvm"
brew "fvm"
  1. Attempt to flutter pub get

Expected behavior
flutter pub get should complete normally.

Logs

[  +86 ms] executing: sysctl hw.optional.arm64
[  +18 ms] Exit code 1 from: sysctl hw.optional.arm64
[   +1 ms] sysctl: unknown oid 'hw.optional.arm64'
[   +8 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +10 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 18116933e77adc82f80866c928266a5b4f1ed645
[        ] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git tag --points-at 18116933e77adc82f80866c928266a5b4f1ed645
[  +20 ms] Exit code 0 from: git tag --points-at 18116933e77adc82f80866c928266a5b4f1ed645
[        ] 2.5.3
[  +12 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git rev-parse --abbrev-ref --symbolic @{u}
[  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git ls-remote --get-url origin
[   +9 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +118 ms] executing: [/Users/brandontrautmann/fvm/versions/2.5.3/] git rev-parse --abbrev-ref HEAD
[  +13 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[   +6 ms] executing: sw_vers -productName
[  +17 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[  +17 ms] Exit code 0 from: sw_vers -productVersion
[        ] 11.6
[        ] executing: sw_vers -buildVersion
[  +17 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 20G165
[  +67 ms] Downloading Material fonts...
[ +441 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip md5 hash: VF/LGEVR6qaggyU/Ekykeg==
[ +177 ms] Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
VF/LGEVR6qaggyU/Ekykeg==, but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming
that your network connection is stable.
[  +14 ms] Downloading Material fonts... (completed in 622ms)
[        ] Downloading Material fonts...
[ +293 ms] Content https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip md5 hash: VF/LGEVR6qaggyU/Ekykeg==
[ +142 ms] Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
VF/LGEVR6qaggyU/Ekykeg==, but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming
that your network connection is stable.
[   +1 ms] Downloading Material fonts... (completed in 437ms)
[        ] "flutter get" took 1,107ms.
[  +17 ms] Failed to download https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip. Ensure you have network connectivity
and then
           try again.
           Exception: Expected https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip to have md5 checksum
VF/LGEVR6qaggyU/Ekykeg==,
           but was rAJgFN+kv13pjIw42PmKmQ==. This may indicate a problem with your connection to the Flutter backend servers. Please re-try the download after confirming that your
network
           connection is stable.
[   +3 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      ArtifactUpdater._downloadArchive (package:flutter_tools/src/cache.dart:931:11)
           <asynchronous suspension>
           #2      CachedArtifact.update (package:flutter_tools/src/cache.dart:688:5)
           <asynchronous suspension>
           #3      Cache.updateAll (package:flutter_tools/src/cache.dart:557:9)
           <asynchronous suspension>
           #4      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1227:7)
           <asynchronous suspension>
           #5      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #8      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #13     main (package:flutter_tools/executable.dart:92:3)
           <asynchronous suspension>

Desktop (please complete the following information):

  • OS: MacOS 11.6
  • FVM Version: 2.2.4

Additional context

  • To attempt to isolate this issue to fvm, I pulled down the latest stable flutter SDK and executed pub get doing ~/path/to/flutter/sdk/bin/flutter pub get on the same project. This completed successfully.
  • Additionally, I'm able to curl the URL in the error output just fine:

curl -I https://storage.googleapis.com/flutter_infra_release/flutter/fonts/bd151aa3c2f7231344411a01dba4ef61b3cd56b2/fonts.zip :

HTTP/1.1 200 OK
X-GUploader-UploadID: ADPycdtp_XeV9hDpLGvUkNoRwSnZcaDzteO7qg9M2vyILJY9cdWJseO5R1rABZc8GoBvmMVKCuIDIKGGQzmsyX6lgiY
Expires: Fri, 12 Nov 2021 17:51:02 GMT
Date: Fri, 12 Nov 2021 16:51:02 GMT
Last-Modified: Tue, 16 Mar 2021 10:09:53 GMT
ETag: "545fcb184551eaa6a083253f124ca47a"
x-goog-generation: 1615889393432810
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 2197282
Content-Type: application/octet-stream
x-goog-hash: crc32c=D0+64g==
x-goog-hash: md5=VF/LGEVR6qaggyU/Ekykeg==
x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 2197282
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Type
Server: UploadServer
Age: 3517
Cache-Control: public, max-age=3600
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
@btrautmann btrautmann added the bug Something isn't working label Nov 12, 2021
@leoafarias
Copy link
Owner

@btrautmann is this issue happening consistently? I saw another problem but seemed like it was google servers.

@btrautmann
Copy link
Author

btrautmann commented Nov 12, 2021

@leoafarias yeah it's been happening since yesterday (well that's when we noticed it), and another coworker is experiencing the same after doing the above. We have a setup script that installs fvm and we've asked other teammates not to run it in fear of running into this 🙃

@leoafarias
Copy link
Owner

I saw another issue this morning when pulling google data but seems like it was a flutter backend hick up.

Is the problem still happening for you? Fvm just proxies the commands so not sure if it's fvm related.

@btrautmann
Copy link
Author

Yeah, I've been testing this all morning. I just tried moments ago with the same failure. flutter pub get in the standalone SDK completes without issue.

@btrautmann
Copy link
Author

I figured I'd open this just in case something came to your mind, but if you're pretty confident it isn't fvm I have no problem closing this to debug further.

@leoafarias
Copy link
Owner

I suggest removing the cached version in fvm and installing it again.

Maybe during the install the error happened and something got corrupted.

Will look out for it though. Thanks.

@btrautmann
Copy link
Author

I've tried completely getting rid of fvm via brew uninstall fvm and reinstalling, as well as installing it via dart pub global activate fvm and both have the same issue. I just now figured I should try doing a flutter create my-app in a different directory in case something about our project was the issue, but that also failed.

@leoafarias
Copy link
Owner

@btrautmann what I mentioned was the actual cached version of 2.5.3 cached by fvm and running again.

I will be on the lookout if there are any issues.

@btrautmann
Copy link
Author

btrautmann commented Nov 12, 2021

the actual cached version of 2.5.3 cached by fvm and running again.

@leoafarias where would that be?

@leoafarias
Copy link
Owner

If you installed stable fvm remove stable or if it was 2.5.3 directly just do fvm remove 2.5.3, and install it again with fvm install 2.5.3

@btrautmann
Copy link
Author

🤔 Is this expected?

flutter [main] % fvm remove 2.5.3                 
Building flutter tool...
2.5.3 is current configured as "global". Do you still would like to remove? Y/n: Y
Removing 2.5.3...
2.5.3 removed.
flutter [main] % fvm install 2.5.3
/Users/brandontrautmann/.pub-cache/bin/fvm: line 8: dart: command not found

@leoafarias
Copy link
Owner

🤔 Is this expected?

flutter [main] % fvm remove 2.5.3                 
Building flutter tool...
2.5.3 is current configured as "global". Do you still would like to remove? Y/n: Y
Removing 2.5.3...
2.5.3 removed.
flutter [main] % fvm install 2.5.3
/Users/brandontrautmann/.pub-cache/bin/fvm: line 8: dart: command not found

No idea what is going on here... this seems very weird, can I take a look at this setup script that you are running to install fvm

@leoafarias
Copy link
Owner

I believe this is related to the issue you are seeing here #352

I am curious to see the Dart path configuration also, is that an alias?

@btrautmann
Copy link
Author

FLUTTER_VERSION=2.5.3
COCOAPODS_VERSION=1.10.0

install_flutter() {
  set -e
  # we used to rely on a globally installed dart from homebrew in order to access fvm
  brew uninstall --force dart || true

  append_to_rcfile 'export PATH="$PATH:$HOME/fvm/default/bin"'
  export PATH="$PATH:$HOME/fvm/default/bin"

  # make sure that your shell can find global dart cli commands
  append_to_rcfile 'export PATH="$PATH:$HOME/.pub-cache/bin"'

  fvm install "$FLUTTER_VERSION"
  fvm global "$FLUTTER_VERSION"

  flutter config --enable-macos-desktop

  flutter doctor
  flutter precache --force --ios --android --macos
}

This is the interesting bit ☝️

@leoafarias
Copy link
Owner

Oh ok.. so that makes sense the warning was correct. The global configured version was the one running the command that is why you had the command not found after.

Not 100% sure what is happening here but looking through your initial error, it did say that there might be an issue with your connection, and I believe was probably more visible because of the precache.

I think that during the initial install something went corrupt because of the connection. So when you were running the global you were having issues.

@btrautmann
Copy link
Author

After chatting with a teammate, we are thinking this is likely related to an internal issue with our certs, and I'm going to close this until we discover otherwise.

@kuyazee
Copy link

kuyazee commented Nov 16, 2021

@btrautmann how do you run the append_to_rcfile when I run it, it just says command not found: append_to_rcfile for me

@btrautmann
Copy link
Author

@btrautmann how do you run the append_to_rcfile when I run it, it just says command not found: append_to_rcfile for me

Ah, sorry, that's just an internal helper that appends the content to the correct rc (bashrc or zshrc) file if not already present.

We've actually come to the conclusion that there's something going on with the flutter install itself, as installing via Github as detailed here fails for the same people. We've opened flutter/flutter#93739 as a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants