You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vm-service crashes if path to flutter starts with two slashes (/) #7279
Flutter was working just fine a few weeks ago, however it appears to be broken on my system. I cleaned my existing install and re-cloned and installed flutter, but it seems to fail with the following problem:
Akshays-MacBook-Pro-2:~ akshaydashrath$ flutter doctor
Downloading Dart SDK 1.21.0...
#################################################################100.0%
Building flutter tool...
vm-service: Error: Unhandled exception:
Unsupported operation: Cannot extract a non-Windows file path from a
file URI with an authority
\#0 _SimpleUri._toFilePath (dart:core/uri.dart:4423)
\#1 _SimpleUri.toFilePath (dart:core/uri.dart:4417)
\#2 _loadFile (loader.dart:407:26)
\#3 _handleResourceRequest (loader.dart:510:5)
\#4 _processLoadRequest (loader.dart:941:7)
\#5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:148)
I've recently updated MacOS to 10.12.2 apart from that I can't identify any other changes I've made that could affect the system.
Tried a cache clean but that didn't work, however I did paste your code and it appears it's a PATH issue, which I don't understand, I'll go through my
Just as reference here's the output
//Users/akshaydashrath/sdk/flutter/bin/flutter: line 9: ../../bin/cache/dart-sdk/bin/pub: No such file or directory
instead of /Users/akshaydashrath/sdk/flutter/bin/flutter: line 9: ../../bin/cache/dart-sdk/bin/pub: No such file or directory
My apologies for wasting your time. I tried executing flutter directly from root of the SDK and it works, however I have no clue if the path is gone off why its being picked up by the terminal or why it stopped working all of a sudden. I'll do a bit more digging but I'm guessing its my machine.
Possibly two bugs. One being in dart:core path handling/url canonicalization. And second being a missing abspath call wherever we're handling the incoming flutter path.
changed the title [-]vm-service crashes if path to flutter has extra / in it[/-][+]vm-service crashes if path to flutter starts with two slashes (/)[/+]on Dec 19, 2016
Dart's main.cc is passing the script file command line argument directly to the URI parser. If this argument is supposed to be in URI format, then the bin/flutter script will need to convert the filesystem path.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
sethladd commentedon Dec 16, 2016
Related Dart SDK issue: dart-lang/sdk#28143
I will now upgrade my laptop's OS, because I <3 my users. :)
sethladd commentedon Dec 16, 2016
cc @akshaydashrath
sethladd commentedon Dec 16, 2016
I upgraded to 10.12.2 and
flutter doctorworks for me. Maybe the error only happens when we're downloading the Dart SDK?I deleted my flutter/bin/cache and reran
flutter doctorand it succeeded.sethladd commentedon Dec 16, 2016
@akshaydashrath
Can you please add the following to your $FLUTTER_HOME/bin/flutter script?
And copy the results to this issue.
Thanks!
akshaydashrath commentedon Dec 17, 2016
Hey Seth,
Tried a cache clean but that didn't work, however I did paste your code and it appears it's a PATH issue, which I don't understand, I'll go through my
Just as reference here's the output
ANDROID_HOME=/Users/akshaydashrath/Android/SDK Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.cgDXublCs1/Render BASH=/bin/bash BASH_ARGC=([0]="1") BASH_ARGV=([0]="doctor") BASH_LINENO=([0]="0") BASH_SOURCE=([0]="/Users/akshaydashrath/sdk/flutter/bin/flutter") BASH_VERSINFO=([0]="3" [1]="2" [2]="57" [3]="1" [4]="release" [5]="x86_64-apple-darwin16") BASH_VERSION='3.2.57(1)-release' DIRSTACK=() EUID=501 FLUTTER_HOME=/Users/akshaydashrath/sdk/flutter GOPATH=/Users/akshaydashrath/.go GROUPS=() HOME=/Users/akshaydashrath HOSTNAME=Akshays-MBP-2 HOSTTYPE=x86_64 IFS=$' \t\n' LANG=en_GB.UTF-8 LOGNAME=akshaydashrath MACHTYPE=x86_64-apple-darwin16 OPTERR=1 OPTIND=1 OSTYPE=darwin16 PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/akshaydashrath/Android/SDK/tools:/Users/akshaydashrath/Android/SDK/platform-tools:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/akshaydashrath/Android/SDK/tools:/Users/akshaydashrath/Android/SDK/platform-tools:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/akshaydashrath/Android/SDK/tools:/Users/akshaydashrath/Android/SDK/platform-tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/akshaydashrath/Android/SDK/build-tools/22.0.1/:/Users/akshaydashrath/sdk/appengine/bin/://Users/akshaydashrath/.go/bin://Users/akshaydashrath/sdk/flutter/bin:/Users/akshaydashrath/Android/SDK/build-tools/22.0.1/:/Users/akshaydashrath/sdk/appengine/bin/://Users/akshaydashrath/.go/bin:/Users/akshaydashrath/sdk/flutter/bin:/Users/akshaydashrath/Android/SDK/build-tools/22.0.1/:/Users/akshaydashrath/sdk/appengine/bin/://Users/akshaydashrath/.go/bin:/Users/akshaydashrath/sdk/flutter/bin PIPESTATUS=([0]="0") PPID=38745 PS4='+ ' PWD=/Users/akshaydashrath/sdk/flutter/bin SHELL=/bin/bash SHELLOPTS=braceexpand:errexit:hashall:interactive-comments SHLVL=2 SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.2uYhVU321X/Listeners TERM=xterm-256color TERM_PROGRAM=Apple_Terminal TERM_PROGRAM_VERSION=388 TERM_SESSION_ID=B31FF374-DC04-4AB5-B381-D8E2C36537A7 TMPDIR=/var/folders/lq/50s7k5p930z0619cl2khwk5r0000gn/T/ UID=501 USER=akshaydashrath XPC_FLAGS=0x0 XPC_SERVICE_NAME=0 _=-e __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x2 //Users/akshaydashrath/sdk/flutter/bin/flutter: line 9: ../../bin/cache/dart-sdk/bin/pub: No such file or directoryAs you see in the last line theres a
//Users/akshaydashrath/sdk/flutter/bin/flutter: line 9: ../../bin/cache/dart-sdk/bin/pub: No such file or directoryinstead of
/Users/akshaydashrath/sdk/flutter/bin/flutter: line 9: ../../bin/cache/dart-sdk/bin/pub: No such file or directoryMy apologies for wasting your time. I tried executing flutter directly from root of the SDK and it works, however I have no clue if the path is gone off why its being picked up by the terminal or why it stopped working all of a sudden. I'll do a bit more digging but I'm guessing its my machine.
akshaydashrath commentedon Dec 17, 2016
Also just as a reference this is my .bash_profile
export ANDROID_HOME=/Users/akshaydashrath/Android/SDK
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH:$ANDROID_HOME/build-tools/22.0.1/"
export PATH="$PATH:/Users/akshaydashrath/sdk/appengine/bin/"
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
export GOPATH=$HOME/.go
export PATH="$PATH:/$GOPATH/bin"
export FLUTTER_HOME=/Users/akshaydashrath/sdk/flutter
export PATH="$FLUTTER_HOME/bin:$PATH"
eseidelGoogle commentedon Dec 17, 2016
Lol. I was able to repro by changing my $PATH:
Now I'm adding //src/flutter/bin to my PATH instead of /src/flutter/bin and BAM:
@johnmccutchan
[-]Unable to run flutter doctor on Mac[/-][+]vm-service crashes if path to flutter has extra / in it[/+]eseidelGoogle commentedon Dec 17, 2016
Possibly two bugs. One being in dart:core path handling/url canonicalization. And second being a missing abspath call wherever we're handling the incoming
flutterpath.johnmccutchan commentedon Dec 19, 2016
I've reopened dart-lang/sdk#28143 for the VM side.
[-]vm-service crashes if path to flutter has extra / in it[/-][+]vm-service crashes if path to flutter starts with two slashes (/)[/+]jason-simmons commentedon Dec 19, 2016
This can be reproduced by running:
using an absolute path with two leading slashes.
Dart's Uri.parse() interprets the characters after the two slashes as the authority part of the URL, which seems accurate based on https://tools.ietf.org/html/rfc3986#section-3.3
As a result, _resolveScriptUri converts the snapshot path to a URI like:
which doesn't load.
Dart's main.cc is passing the script file command line argument directly to the URI parser. If this argument is supposed to be in URI format, then the bin/flutter script will need to convert the filesystem path.
Hixie commentedon Dec 19, 2016
Please disregard the IETF draft. The correct spec for URL parsing is https://url.spec.whatwg.org/.
Remove extra leading slashes in the flutter tool snapshot path
Remove extra leading slashes in the flutter tool snapshot path (#7291)
sethladd commentedon Dec 20, 2016
Thanks for the additional info and quick fix.
github-actions commentedon Sep 5, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.