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

Detect when pub-cache seems corrupted? #1045

Closed
DartBot opened this issue Jun 5, 2015 · 1 comment
Closed

Detect when pub-cache seems corrupted? #1045

DartBot opened this issue Jun 5, 2015 · 1 comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="96" height="96"hspace="10"> Issue by sigmundch
Originally opened as dart-lang/sdk#19958


Not sure if there is anything we can do, but recently I've heard of several users, and I myself got into a situation where my pub-cache got corrupted.

Today I was running pub build and got this odd error:
Loading source assets...
Loading polymer/src/build/mirrors_remover, observe and smoke/src/default_transformer transformers... (1.1s)Uncaught Error: Failure getting http://localhost:57723/packages/path/path.dart: 404 Not Found
Stack Trace:

­0 _asyncLoadError (dart:_builtin:337)

­1 _httpGet.<anonymous closure>.<anonymous closure> (dart:_builtin:128)

­2 _RootZone.runGuarded (dart:async/zone.dart:1015)

­3 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:393)

­4 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402)

­5 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)

­6 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:94)

­7 _handleDone (dart:async/stream_pipe.dart:162)

­8 _RootZone.runGuarded (dart:async/zone.dart:1015)

­9 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:393)

­10 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402)

­11 _DelayedDone.perform (dart:async/stream_impl.dart:617)

­12 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:714)

­13 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:674)

­14 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)

­15 _asyncRunCallback (dart:async/schedule_microtask.dart:32)

­16 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:126)

Loading polymer/src/build/mirrors_remover, observe and smoke/src/default_transformer transformers... (1.1s)
'Unhandled exception:
Failure getting http://localhost:57723/packages/path/path.dart: 404 Not Found

­0 _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:826)

­1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)

­2 _asyncRunCallback (dart:async/schedule_microtask.dart:32)

­3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:126)'

dart:isolate-patch/isolate_patch.dart 256 Isolate.spawnUri
/mnt/data/b/build/slave/dart-editor-linux-dev/build/dart/sdk/lib/_internal/pub/lib/src/dart.dart 179 _isolateBuffer
dart:isolate-patch/isolate_patch.dart 219 _startIsolate.isolateStartHandler
dart:isolat

So it took me a while to realize what the problem was. Looking at my cache, only the 'lib/' directories were deleted, so it could be that this is the result of a bug in a transformer or something else.

I am creating this bug to see if we can determine when corruption happens, and provide better diagnostics. One idea would be to check for timestamps and compare to the time when that cache entry was populated: in my case the 'lib' folder said it was modified. I search for my history logs and the only thing that run around that time was a build.py command from the Dart repo, which I doubt was what disturbed my cache, but who knows.

Another idea is to do this check before & after a pub-build command, so we can at least report if a transformer is misbehaving.

Thoughts?

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


It looks like this corruption is being caused by tools incorrectly following package symlinks when recursively deleting files. Since we're planning on removing symlinks entirely (issue #727), I don't think it makes sense to put much effort into this.


Added NotPlanned label.

@DartBot DartBot added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) closed-not-planned Closed as we don't intend to take action on the reported issue labels Jun 5, 2015
@DartBot DartBot closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant