Skip to content

shared.sh: line 268: bin/cache/dart-sdk/bin/dart: No such file or directory #166568

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

Closed
ryanheise opened this issue Apr 4, 2025 · 19 comments
Closed
Labels
P3 Issues that are less important to the Flutter project r: invalid Issue is closed as not valid team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team workaround available There is a workaround available to overcome the issue

Comments

@ryanheise
Copy link

Steps to reproduce

  1. flutter xyz... (e.g. flutter analyze)

Basically, the flutter tool always fails with this error. How exactly did it get into this state? I'm not sure! I didn't do anything, I promise ;-)

I had it happen once before, and I also don't think I did anything specific to trigger it that time either. More info below.

Actual results

The error is in the title. But in addition to that error, the flutter installation was modified.

$ git diff
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index 67b77bd8cd..e57b2580ff 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-18b71d647a292a980abb405ac7d16fe1f0b20434
\ No newline at end of file
+e2359331b01726c2fd926ad0070a40e5f5d79080

So, the engine version was mysteriously changed, not at my request. I would have expected this file to track git, but obviously it's fetching an engine version automatically from elsewhere.

I can fix the issue by deleting the cache directory, reverting the changes back to git, and then the flutter tool will refetch everything and work. For a few days, at least.

Logs

Logs
$ git diff
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index 67b77bd8cd..e57b2580ff 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-18b71d647a292a980abb405ac7d16fe1f0b20434
\ No newline at end of file
+e2359331b01726c2fd926ad0070a40e5f5d79080

Flutter Doctor output

Doctor output
Same error again. It is not possible to run flutter doctor

flutter doctor gives the same error, but I have the latest version of Flutter as of a few days ago.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Apr 4, 2025
@darshankawar
Copy link
Member

@ryanheise
See if you are hitting #165390 or not which has been fixed already.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2025
@ryanheise
Copy link
Author

In my case, I wasn't using any Git hooks.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2025
@darshankawar
Copy link
Member

What flutter version are you on ? See if this helps further.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2025
@ryanheise
Copy link
Author

I already worked around the issue by deleting the cache directory so I can't test that workaround right now.

But this also means I can now run flutter doctor:

flutter doctor -v                                                                                                                                                                                                                              git:feature/playlist*
[✓] Flutter (Channel stable, 3.29.2, on Arch Linux 6.13.7-arch1-1, locale en_US.UTF-8) [180ms]
    • Flutter version 3.29.2 on channel stable at /home/ryan/opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c236373904 (3 weeks ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2.6s]
    • Android SDK at /home/ryan/opt/android-sdk
    • Platform android-35, build-tools 35.0.1
    • ANDROID_HOME = /home/ryan/opt/android-sdk
    • Java binary at: /home/ryan/opt/android-studio/jbr/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Chrome - develop for the web [113ms]
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop [206ms]
    • clang version 19.1.7
    • cmake version 3.31.6
    • ninja version 1.12.1
    • pkg-config version 2.3.0

[✓] Android Studio (version 2024.3) [111ms]
    • Android Studio at /home/ryan/opt/android-studio
    • Flutter plugin version 83.0.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] Connected device (2 available) [1,226ms]
    • Linux (desktop) • linux  • linux-x64      • Arch Linux 6.13.7-arch1-1
    • Chrome (web)    • chrome • web-javascript • Google Chrome 131.0.6778.139

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2025
@ryanheise
Copy link
Author

It happened again, so this time I deleted the cache directory and removed the .gn file according to what was suggested in the issue you linked me to. The flutter tool initially resumed working but then broke within a couple of minutes:

$ flutter pub get
Downloading Linux x64 Dart SDK from Flutter engine 18b71d647a292a980abb405ac7d16fe1f0b20434...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  206M  100  206M    0     0  6811k      0  0:00:31  0:00:31 --:--:-- 6265k
Building flutter tool...
Resolving dependencies... (2.2s)
Downloading packages...
Got dependencies.
Downloading Material fonts...                                      430ms
Downloading Gradle Wrapper...                                       38ms
Downloading package sky_engine...                                  135ms
Downloading package flutter_gpu...                                  45ms
Downloading flutter_patched_sdk tools...                           206ms
Downloading flutter_patched_sdk_product tools...                   224ms
Downloading linux-x64 tools...                                      4.8s
Downloading linux-x64/font-subset tools...                         392ms
Resolving dependencies...
Downloading packages...
--- omitting this part of the log ---
28 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

$ flutter analyze
Analyzing xyz...
No issues found! (ran in 0.5s)

-- after a couple of minutes --

$ flutter analyze
VM initialization failed: Invalid vm isolate snapshot seen

$ flutter --version
VM initialization failed: Invalid vm isolate snapshot seen

I ran the same workaround again and then it first gave the original error:

shared.sh: line 268: bin/cache/dart-sdk/bin/dart: No such file or directory

And then later started giving the second error:

VM initialization failed: Invalid vm isolate snapshot seen

@darshankawar
Copy link
Member

Keeping the issue open for team's tracking.

@darshankawar darshankawar added tool Affects the "flutter" command-line tool. See also t: labels. team-tool Owned by Flutter Tool team workaround available There is a workaround available to overcome the issue and removed in triage Presently being triaged by the triage team labels Apr 7, 2025
@bkonyi
Copy link
Contributor

bkonyi commented Apr 8, 2025

We've changed the model so that engine.version will no longer be committed, so this likely won't be an issue after the next release. I'm going to close this for now since there's a workaround, but if you continue to encounter this after the next stable release please let us know.

@bkonyi bkonyi closed this as completed Apr 8, 2025
@ryanheise
Copy link
Author

There IS a workaround? If so, I would appreciate if you could let me know. I have tried the previous suggestion above, but reported that it did not work. If I tried the wrong workaround, what is the correct workaround?

(I've been in the middle of publishing a just_audio release for 5 days, and have only partially published some parts of the release, which is an awkward situation. I can't complete the release because this issue is preventing me from using the flutter tool. I would appreciate if you could share with me what the workaround is and I will try it.)

@darshankawar darshankawar added the r: solved Issue is closed as solved label Apr 9, 2025
@bkonyi bkonyi reopened this Apr 9, 2025
@bkonyi
Copy link
Contributor

bkonyi commented Apr 9, 2025

Ah, sorry @ryanheise I missed your last comment.

Can you confirm which version (or Git revision) of Flutter you're currently on?

It sounds like your cache is getting corrupted somehow, but it's not clear exactly how/why. Can you confirm that bin/cache/dart-sdk/bin/dart is actually not present?

@bkonyi bkonyi added P3 Issues that are less important to the Flutter project triaged-tool Triaged by Flutter Tool team and removed r: solved Issue is closed as solved labels Apr 9, 2025
@ryanheise
Copy link
Author

Thanks, @bkonyi .

I can confirm that bin/cache/dart-sdk/bin/dart was not present on each occasion this happened. I'm on stable 3.29.2.

The only workaround so far that partially worked was to delete the cache and reset the engine id, then get the flutter tool to repopulate the cache, but the issue comes back again within a couple of minutes of usage. Based on that, I'm not sure how likely a recently cleaned and repopulated cache is to be corrupted.

Right now, the cache is in the freshly restored state, and I haven't touched it since. If you would like me to make the issue happen again in order to try something, I can probably do that (but it's getting late, so tomorrow morning).

Or, I could also try a git reset --hard; git clean -fd on the flutter repo if you think that's worth a go.

@bkonyi
Copy link
Contributor

bkonyi commented Apr 9, 2025

I'm glad that you're at least able to get back into a working state, even if it's temporary, by blowing away your cache.

@matanlurey, is the change to no longer commit engine.version in an existing beta branch? If so, @ryanheise would you be willing to try using the beta branch to see if that resolves the issue?

@ryanheise
Copy link
Author

If I test beta, I couldn't actually use it to publish just_audio, since I need to ensure that it passes just_audio's tests on stable. I'm also not sure I'd be certain whether the issue is resolved because it seems it can strike at any time. It may help to know what triggers it, then I could specifically test that action before and after switching channels.

@ryanheise
Copy link
Author

It crashed when switching to beta, running from flutter/bin:

bin ➤ git status -s
bin ➤ git clean -fd
bin ➤ flutter channel beta
Downloading Linux x64 Dart SDK from Flutter engine 18b71d647a292a980abb405ac7d16fe1f0b20434...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  206M  100  206M    0     0  5571k      0  0:00:37  0:00:37 --:--:-- 6525k
Building flutter tool...
Resolving dependencies... (2.0s)
Downloading packages...
Got dependencies.
Downloading Material fonts...                                      928ms
Downloading Gradle Wrapper...                                       73ms
Downloading package sky_engine...                                  267ms
Downloading package flutter_gpu...                                  56ms
Downloading flutter_patched_sdk tools...                           697ms
Downloading flutter_patched_sdk_product tools...                   650ms
Downloading linux-x64 tools...                                      7.5s
Downloading linux-x64/font-subset tools...                         770ms
Switching to flutter channel 'beta'...

Upgrading engine...
Downloading Dart SDK from Flutter engine 91ed51e05c68efdbddf642735f164fc914358cff...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0  198M    0  165k    0     0   139k      0  0:24:19  0:00:01  0:24:18  139k
  1  198M    1 3280k    0     0  1510k      0  0:02:14  0:00:02  0:02:12 1510k
  3  198M    3 7725k    0     0  2436k      0  0:01:23  0:00:03  0:01:20 2436k
  5  198M    5 11.4M    0     0  2810k      0  0:01:12  0:00:04  0:01:08 2809k
  7  198M    7 15.0M    0     0  2976k      0  0:01:08  0:00:05  0:01:03 3084k
 10  198M   10 20.5M    0     0  3406k      0  0:00:59  0:00:06  0:00:53 4183k
 13  198M   13 26.7M    0     0  3812k      0  0:00:53  0:00:07  0:00:46 4810k
 15  198M   15 31.0M    0     0  3896k      0  0:00:52  0:00:08  0:00:44 4822k
 18  198M   18 36.0M    0     0  4019k      0  0:00:50  0:00:09  0:00:41 5029k
 20  198M   20 40.4M    0     0  4067k      0  0:00:50  0:00:10  0:00:40 5196k
 21  198M   21 43.2M    0     0  3961k      0  0:00:51  0:00:11  0:00:40 4647k
 24  198M   24 49.0M    0     0  4128k      0  0:00:49  0:00:12  0:00:37 4581k
 27  198M   27 55.5M    0     0  4321k      0  0:00:47  0:00:13  0:00:34 5015k
 31  198M   31 62.9M    0     0  4549k      0  0:00:44  0:00:14  0:00:30 5522k
 34  198M   34 68.0M    0     0  4590k      0  0:00:44  0:00:15  0:00:29 5654k
 36  198M   36 71.6M    0     0  4515k      0  0:00:45  0:00:16  0:00:29 5735k
 37  198M   37 75.3M    0     0  4493k      0  0:00:45  0:00:17  0:00:28 5382k
 39  198M   39 78.8M    0     0  4441k      0  0:00:45  0:00:18  0:00:27 4756k
 43  198M   43 85.7M    0     0  4578k      0  0:00:44  0:00:19  0:00:25 4659k
 46  198M   46 92.1M    0     0  4674k      0  0:00:43  0:00:20  0:00:23 4927k
 49  198M   49 99.4M    0     0  4808k      0  0:00:42  0:00:21  0:00:21 5776k
 54  198M   54  108M    0     0  5010k      0  0:00:40  0:00:22  0:00:18 6787k
 57  198M   57  114M    0     0  5077k      0  0:00:40  0:00:23  0:00:17 7390k
 60  198M   60  120M    0     0  5086k      0  0:00:40  0:00:24  0:00:16 7036k
 62  198M   62  125M    0     0  5091k      0  0:00:40  0:00:25  0:00:15 6779k
 65  198M   65  130M    0     0  5092k      0  0:00:40  0:00:26  0:00:14 6292k
 67  198M   67  134M    0     0  5078k      0  0:00:40  0:00:27  0:00:13 5377k
 70  198M   70  140M    0     0  5095k      0  0:00:39  0:00:28  0:00:11 5177k
 73  198M   73  146M    0     0  5131k      0  0:00:39  0:00:29  0:00:10 5349k
 76  198M   76  153M    0     0  5197k      0  0:00:39  0:00:30  0:00:09 5731k
 80  198M   80  159M    0     0  5233k      0  0:00:38  0:00:31  0:00:07 5969k
 82  198M   82  164M    0     0  5247k      0  0:00:38  0:00:32  0:00:06 6169k
 85  198M   85  170M    0     0  5253k      0  0:00:38  0:00:33  0:00:05 6147k
 87  198M   87  174M    0     0  5210k      0  0:00:39  0:00:34  0:00:05 5660k
 90  198M   90  179M    0     0  5235k      0  0:00:38  0:00:35  0:00:03 5463k
 91  198M   91  182M    0     0  5173k      0  0:00:39  0:00:36  0:00:03 4803k
 94  198M   94  187M    0     0  5160k      0  0:00:39  0:00:37  0:00:02 4595k
 96  198M   96  192M    0     0  5153k      0  0:00:39  0:00:38  0:00:01 4488k
 98  198M   98  196M    0     0  5135k      0  0:00:39  0:00:39 --:--:-- 4613k
100  198M  100  198M    0     0  5144k      0  0:00:39  0:00:39 --:--:-- 4425k
Building flutter tool...

===== CRASH =====
si_signo=Bus error(7), si_code=BUS_ADRERR(2), si_addr=0x7d895120f360
version=3.7.2 (stable) (Tue Mar 11 04:27:50 2025 -0700) on "linux_x64"
pid=75254, thread=76486, isolate_group=main(0x57214e9be0e0), isolate=main(0x57214e9bb760)
os=linux, arch=x64, comp=no, sim=no
isolate_instructions=7d8951092000, vm_instructions=57214d3a3d20
fp=7d894937e588, sp=7d894937e4a8, pc=7d895120f360
[1]    75254 bus error (core dumped)  flutter channel beta

@ryanheise
Copy link
Author

That crash was probably because the last active beta version was quite old. I ignored the crash and ran flutter upgrade, and so far the issue hasn't arisen.

@bkonyi
Copy link
Contributor

bkonyi commented Apr 10, 2025

Thanks for trying out the beta channel for us! It's good to know there hasn't been any issues so far.

@ryanheise
Copy link
Author

However, is there a workaround for stable that you can advise? As mentioned, I need to work on stable.

@bkonyi
Copy link
Contributor

bkonyi commented Apr 14, 2025

However, is there a workaround for stable that you can advise? As mentioned, I need to work on stable.

I think the only workaround would be to patch the relevant change from beta onto your stable branch, but I'm not sure what's the relevant change. Maybe @matanlurey can help here?

@ryanheise
Copy link
Author

It's OK for now, I use this script to temporarily fix things each time it happens:

#!/bin/bash
cd $FLUTTER_HOME/bin/cache
rmdir dart-sdk
mv dart-sdk.old dart-sdk
git reset --hard

@matanlurey
Copy link
Contributor

There is nothing I can imagine we're changing at this point for older releases.

If you still see issues in the latest stable (3.32+) please file a new issue. Thanks!

@matanlurey matanlurey closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2025
@darshankawar darshankawar added the r: invalid Issue is closed as not valid label May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Issues that are less important to the Flutter project r: invalid Issue is closed as not valid team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels. triaged-tool Triaged by Flutter Tool team workaround available There is a workaround available to overcome the issue
Projects
None yet
Development

No branches or pull requests

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy