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

Errors regarding nested transactions #484

Closed
kbullaughey opened this issue May 11, 2017 · 40 comments · Fixed by #505
Closed

Errors regarding nested transactions #484

kbullaughey opened this issue May 11, 2017 · 40 comments · Fixed by #505

Comments

@kbullaughey
Copy link

I've started to observe hard-to-reproduce errors of the form:

Error: Cannot start a nested transaction

Which seem to come from an assert statement introduced in PR #444 in file:

`packages/@glimmer/runtime/lib/environment.ts`

I've only noticed this on my production Ember app which is hard to debug given the call stack of the error just goes up backburner/runloop chain and never touches my own code.

The errors often occur a handful at a time.

Anyone have thoughts on where to dig to either reproduce or resolve such errors?

@Kilowhisky
Copy link

My app is also doing this only in production mode but at the moment i'm only observing it in IE11 users.

image

User agent string: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

I have my app report JS errors in production to me and one single user is generating 200+ errors per minute.

@kbullaughey
Copy link
Author

I've also only observed it in production, but also on macs:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8

It seems to always occur after an error like this:

NotFoundError (DOM Exception 8): The object can not be found here.

That occurs when something is trying to removeChild.

@Kilowhisky
Copy link

Kilowhisky commented May 12, 2017

Actually now i'm seeing more users throwing the error in various browsers. I'm going to have to roll back until this gets sorted. (130k errors and counting...)

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

I still can't reproduce the error but the explanation from @kbullaughey does seem plausible as all my errors are occurring within a page that holds a google map that i have integrated into ember and google maps likes to move DOM nodes around. (As far as i know i got that all sorted with the initial glimmer 2.0 release though..)

@Kilowhisky
Copy link

Also here are some sample stack dumps.

Stack: Error: Cannot start a nested transaction
    at Object.o [as assert] (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:8583)
    at n.e.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:8:15520)
    at n.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:11:23239)
    at t.e._renderRoots (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:9722)
    at t.e._renderRootsTransaction (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10219)
    at t.e._revalidate (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10753)
    at invokeWithOnError (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19325)
    at s.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19768)
    at l.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20530)
    at d.end (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20875)
Stack: Error: Cannot start a nested transaction
    at Object.o [as assert] (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:8583)
    at n.e.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:8:15520)
    at n.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:11:23239)
    at t.e._renderRoots (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:9722)
    at t.e._renderRootsTransaction (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10219)
    at t.e._revalidate (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10753)
    at invokeWithOnError (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19325)
    at s.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19768)
    at l.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20530)
    at d.end (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20875)
    at d.run (https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:21947)
Stack: o@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:8583
rn</e.prototype.begin@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:8:15518
R</n.prototype.begin@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:11:23221
_</e.prototype._renderRoots@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:9720
_</e.prototype._renderRootsTransaction@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10214
_</e.prototype._revalidate@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10748
invokeWithOnError@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19323
flush@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19768
flush@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20528
end@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20873
run@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:21942
join@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:22062
f@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:6553
_trigger@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:21130
end@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:21005
h/e._autorun<@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:18115
Stack: o@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:8583
rn</e.prototype.begin@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:8:15518
R</n.prototype.begin@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:11:23221
_</e.prototype._renderRoots@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:9720
_</e.prototype._renderRootsTransaction@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10214
_</e.prototype._revalidate@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:12:10748
invokeWithOnError@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19323
flush@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:19768
flush@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20528
end@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:20873
run@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:21942
_runExpiredTimers@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:25687
d/this._boundRunExpiredTimers@https://new.skyrouter.com/skyrouter3/assets/vendor-75e894a905a0f9ee0293f5c600189e7a.js:9:17917

@elwayman02
Copy link

I'm seeing similar errors, but reproducible locally as well. Here's my stacktrace:

core.js:65 Error: Cannot start a nested transaction
    at Object.debugAssert [as assert] (emberapp.js:1806)
    at Environment.begin (emberapp.js:1651)
    at Environment.begin (emberapp.js:11857)
    at InteractiveRenderer._renderRoots (emberapp.js:14564)
    at InteractiveRenderer._renderRootsTransaction (emberapp.js:14631)
    at InteractiveRenderer._revalidate (emberapp.js:14670)
    at invokeWithOnError (emberapp.js:2505)
    at Queue.flush (emberapp.js:2564)
    at DeferredActionQueues.flush (emberapp.js:2688)
    at Backburner.end (emberapp.js:2758)

@RobIsHere
Copy link

I get that in the most current chrome.

@nerdyworm
Copy link

I'm seeing quite a few of these as well.

From our error tracking, it looks like this is triggered when something rendering throws an exception. The app then becomes completely unusable without a page refresh :/

@stefanpenner
Copy link
Contributor

When I have ran into this, it has been a red herring of sorts. Basically some other error occurs during render, putting the VM into a bad state, which results in this error.

So although glimmer also needs to address being able to recover correctly, you may want to look for other errors in the console and address them. (my example was someone trying to use nodeList.forEach on IE edge, yours is likely different)

@stefanpenner
Copy link
Contributor

My guess is if

this.transaction.commit();
throws, then never resets the transition, and all subsequent renders will fail.

@stefanpenner
Copy link
Contributor

hypothetical fix: #505 (i need to actually write tests and confirm, so don't get too exited yet)

stefanpenner added a commit that referenced this issue May 24, 2017
* ensure running `commit` always clears the current transaction
* if we begin a transaction with an existing transaction warn, commit it, then start begin the next.
@rwjblue
Copy link
Member

rwjblue commented May 24, 2017

Any errors thrown during rendering will leave the transactions in a bad state, and therefore you would have these Cannot start a nested transaction errors when another transaction is started. This is obviously not ideal and I think we should continue iterating on @stefanpenner's plans in #505. The internals of how Glimmer handles errors thrown during transactions hasn't really changed in quite some time (likely since 2.10 when "Glimmer 2" was introduced).

I suspect that the reason these issues are cropping up more often recently is due to a bug that existed in Ember 2.13.0. In Ember 2.13.0 any Ember.assert invocations that were ran during production builds would actually still continue to throw errors (the same as in development builds).

Can those of you affected ensure you are updated to Ember 2.13.2, monitor these errors and report back?

@indieNik
Copy link

I guess in my case, this is the error:

ember.debug.js:19822 Assertion Failed: An action named 'valuechanged' was not found in (generated post controller)
Error
    at assert (http://localhost:4200/assets/vendor.js:18616:13)
    at Object.assert (http://localhost:4200/assets/vendor.js:18829:34)
    at makeClosureAction (http://localhost:4200/assets/vendor.js:22776:21)
    at exports.default (http://localhost:4200/assets/vendor.js:22703:12)
    at CompiledHelper.evaluate (http://localhost:4200/assets/vendor.js:11781:17580)
    at CompiledNamedArgs.evaluate (http://localhost:4200/assets/vendor.js:11684:9089)
    at CompiledArgs.evaluate (http://localhost:4200/assets/vendor.js:11684:12486)
    at http://localhost:4200/assets/vendor.js:11684:14736
    at AppendOpcodes.evaluate (http://localhost:4200/assets/vendor.js:11683:2168)
    at VM.next (http://localhost:4200/assets/vendor.js:11938:872)

which causes the nested transaction Error

ember.debug.js:19822 Error: Cannot start a nested transaction
    at Object.debugAssert [as assert] (ember.debug.js:1502)
    at Environment.begin (ember.debug.js:1347)
    at Environment.begin (ember.debug.js:11541)
    at InteractiveRenderer._renderRoots (ember.debug.js:14250)
    at InteractiveRenderer._renderRootsTransaction (ember.debug.js:14317)
    at InteractiveRenderer._revalidate (ember.debug.js:14356)
    at invokeWithOnError (ember.debug.js:2201)
    at Queue.flush (ember.debug.js:2260)
    at DeferredActionQueues.flush (ember.debug.js:2384)
    at Backburner.end (ember.debug.js:2454)

Versions:

$ ember -v
ember-cli: 2.11.0
node: 6.9.5
os: win32 x64

Dependencies:

"broccoli-asset-rev": "^2.4.5",
    "ember-ajax": "^2.4.1",
    "ember-cli": "2.11.0",
    "ember-cli-app-version": "^2.0.0",
    "ember-cli-babel": "^5.1.7",
    "ember-cli-dependency-checker": "^1.3.0",
    "ember-cli-fastboot": "1.0.0-beta.19",
    "ember-cli-htmlbars": "^1.1.1",
    "ember-cli-htmlbars-inline-precompile": "^0.3.3",
    "ember-cli-inject-live-reload": "^1.4.1",
    "ember-cli-jshint": "^2.0.1",
    "ember-cli-materialize": "0.22.0-beta.0",
    "ember-cli-qunit": "^3.0.1",
    "ember-cli-release": "^0.2.9",
    "ember-cli-sass": "5.3.1",
    "ember-cli-shims": "^1.0.2",
    "ember-cli-simditor": "0.0.7",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-test-loader": "^1.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-cli-windows-addon": "^1.3.1",
    "ember-composability": "0.3.7",
    "ember-data": "^2.11.0",
    "ember-disqus": "0.2.1",
    "ember-export-application-global": "^1.0.5",
    "ember-keyboard": "1.0.3",
    "ember-load-initializers": "^0.6.0",
    "ember-material-design-icons-shim": "0.1.10",
    "ember-materialize-shim": "0.2.3",
    "ember-modal-dialog": "0.8.8",
    "ember-new-computed": "1.0.3",
    "ember-offline": "0.1.0",
    "ember-radio-button": "1.0.7",
    "ember-resolver": "^2.0.3",
    "ember-service-worker": "0.6.1",
    "ember-service-worker-asset-cache": "0.6.0",
    "ember-service-worker-cache-fallback": "0.6.0",
    "ember-service-worker-index": "0.6.1",
    "ember-source": "^2.11.0",
    "ember-truth-helpers": "1.2.0",
    "ember-web-app": "1.1.0",
    "ember-web-app-rename": "1.0.0",
    "ember-welcome-page": "^2.0.2",
    "emberfire": "github:firebase/emberfire#master",
    "loader.js": "^4.0.10",
    "torii": "0.8.1"

@jonathanhudak
Copy link

@rwjblue I tried using Ember 2.13.2 as you suggested but am still see the following errors with our app. In my case I only see these errors when using ember.prod.js or ember.min.js. I do not see them when using ember.js or ember.debug.js.

TypeError: Cannot read property '__container__' of undefined
    at Class.get (ember.prod.js:3556)
    at replaceObserversAndListeners (ember.prod.js:21869)
    at applyMixin (ember.prod.js:21927)
    at MixinPrototype.applyPartial (ember.prod.js:22162)
    at Function.proto (ember.prod.js:37511)
    at new Class (ember.prod.js:37391)
    at Function._ClassMixinProps.create (ember.prod.js:37671)
    at FactoryManager.create (ember.prod.js:3699)
    at CurlyComponentManager.create (ember.prod.js:14474)
    at ember.prod.js:1093

Error: Cannot start a nested transaction
    at Object.debugAssert [as assert] (ember.prod.js:1491)
    at Environment.begin (ember.prod.js:1336)
    at Environment.begin (ember.prod.js:11353)
    at InteractiveRenderer._renderRoots (ember.prod.js:13968)
    at InteractiveRenderer._renderRootsTransaction (ember.prod.js:14035)
    at InteractiveRenderer._revalidate (ember.prod.js:14074)
    at invokeWithOnError (ember.prod.js:2190)
    at Queue.flush (ember.prod.js:2249)
    at DeferredActionQueues.flush (ember.prod.js:2373)
    at Backburner.end (ember.prod.js:2443)

@RobIsHere
Copy link

For me to have rendering continue without the need to reload the browser like proposed above would be a dream and enough.

It's pretty clear that we didn't see this anymore after fixing remaining addon upgrade errors. So basically any error triggers this imho.

We can keep our code always working of course 😬 But there's always the one thing that slips through the net. This is where glimmer can shine and show some resilience.

stefanpenner added a commit that referenced this issue May 25, 2017
* ensure running `commit` always clears the current transaction
* if we begin a transaction with an existing transaction warn, commit it, then start begin the next.
stefanpenner added a commit that referenced this issue May 25, 2017
* ensure running `commit` always clears the current transaction
* if we begin a transaction with an existing transaction warn, commit it, then start begin the next.
stefanpenner added a commit that referenced this issue May 25, 2017
* ensure running `commit` always clears the current transaction
* if we begin a transaction with an existing transaction warn, commit it, then start begin the next.
@stefanpenner
Copy link
Contributor

I suspect that the reason these issues are cropping up more often recently is due to a bug that existed in Ember 2.13.0. In Ember 2.13.0 any Ember.assert invocations that were ran during production builds would actually still continue to throw errors (the same as in development builds).

ya ^^ is the reason, we will release a new ember without this assertion.

stefanpenner added a commit that referenced this issue May 25, 2017
[BUGFIX #484] ensure transactions are always.
@Kilowhisky
Copy link

Kilowhisky commented Sep 14, 2017

Well i started getting them again after the 2.15.0 upgrade from 2.14.0. This time it appears mostly on IE11 machines.

Stack: Error: a glimmer transaction was begun, but one already exists. You may have a nested transaction
   at e.assert (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2320:80)
   at e.prototype.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2227:422)
   at i.prototype.begin (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2784:227)
   at e.prototype._renderRoots (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2916:8)
   at e.prototype._renderRootsTransaction (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2921:5)
   at e.prototype._revalidate (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2923:332)
   at e.prototype.invokeWithOnError (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2353:248)
   at e.prototype.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2340:155)
   at e.prototype.flush (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2356:6)
   at e.prototype.end (https://new.skyrouter.com/skyrouter3/assets/vendor-e5d14d4de58dff7211302bb31553233a.js:2364:5)

I'm at 900 errors and counting as people start using the new version. Not looking good.

EDIT:
60k errors.... but no ones complaining yet... So i'm just going to suppress the message then. I haven't been able to replicate it locally yet.

@Kilowhisky
Copy link

This is happening in the following browser:

: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

@lifeart
Copy link
Contributor

lifeart commented Sep 25, 2017

Same error for me
Chromium Version 60.0.3112.78 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)

image

  "devDependencies": {
    "ember-cli": "~2.15.0-beta.2",
    "ember-source": "~2.15.0-beta.2"
  }

@pjcarly
Copy link

pjcarly commented Oct 2, 2017

Getting the same error in 2.15, after downgrading to 2.14 the error went away

@omairvaiyani
Copy link

Same issue here in 2.16.0

@albertpak
Copy link

got this error in IE11 and also on v2.16.0

@supremebeing7
Copy link

Getting the error

a glimmer transaction was begun, but one already exists. You may have a nested transaction

with 2.16.2. This happening with IE 11 as well as a few different versions of Chrome, 58.0.3029.110 and 62.0.3202.94 (latest).

I'm only seeing this in our airbrake logs and haven't even been able to reproduce it, which is extra frustrating. It does seem to happen in batches of about 8-12 errors for one session over the course of ~1 minute.

@maxvoltage
Copy link

Seeing the same error
"ember-cli": "~2.16.2",
"ember-source": "~2.16.2"

@danilovaz
Copy link

Seeing the same error here:

"ember-cli": "~2.17.1",
"ember-source": "~2.17.0"

@thec0keman
Copy link

We're seeing a lot of these in our logs, and like mentioned above they tend to happen in batches for a single browser session. However, we have not been seeing other errors for those sessions.

Also, while I have seen this error throw when something else fails (especially in dev), it doesn't tend to throw repeatedly like we are seeing in our logs.

Is it possible this is just noise? Given the frequency of the errors, I would have expected to hear back from our customers, but we haven't received any feedback about the page failing to render. (But maybe we just have really patient customers!)

@isaacaskew
Copy link

isaacaskew commented Dec 29, 2017

Also getting this issue:

a glimmer transaction was begun, but one already exists. You may have a nested transaction

"ember-cli": "2.17.0",
"ember-source": "2.17.0"

Using Chrome 63.0.3239.84

@rinoldsimon
Copy link

Even getting this error in ember-cli: 2.18.0

util.js:62 Uncaught Error: a glimmer transaction was begun, but one already exists. You may have a nested transaction
    at debugAssert (util.js:62)
    at Environment.begin (runtime.js:6380)
    at Environment.begin (environment.js:252)
    at InteractiveRenderer._renderRoots (renderer.js:270)
    at InteractiveRenderer._renderRootsTransaction (renderer.js:323)
    at InteractiveRenderer._revalidate (renderer.js:360)
    at invoke (backburner.js:258)
    at Queue.flush (backburner.js:151)
    at DeferredActionQueues.flush (backburner.js:329)
    at Backburner.end (backburner.js:462)

@neilptel
Copy link

neilptel commented Jan 19, 2018

Just reporting that issue has appeared again. Even in local builds. Error occurs when trying to perform any transaction immediately after any other error occurs, i.e Prev transaction didn't complete due to js error.

ember -v

ember-cli: 2.18.0
node: 9.4.0
os: linux x64

Pkg versions

    "ember-cli": "~2.18.0",
    "ember-cli-app-version": "^3.0.0",
    "ember-data": "~2.11.0",
    "ember-source": "~2.18.0",

Error:

util.js:62 Uncaught Error: a glimmer transaction was begun, but one already exists. You may have a nested transaction
    at debugAssert (util.js:62)
    at Environment.begin (runtime.js:6380)
    at Environment.begin (environment.js:252)
    at InteractiveRenderer._renderRoots (renderer.js:270)
    at InteractiveRenderer._renderRootsTransaction (renderer.js:323)
    at InteractiveRenderer._revalidate (renderer.js:360)
    at invoke (backburner.js:258)
    at Queue.flush (backburner.js:151)
    at DeferredActionQueues.flush (backburner.js:329)
    at Backburner.end (backburner.js:462)```

@phammers
Copy link

We're seeing this issue in 2.18 as well. Is there any update on this issue? We want to get our app up to the latest LTS candidate.

@rwjblue
Copy link
Member

rwjblue commented Jan 22, 2018

A concrete reproduction would be very helpful here...

@neilptel
Copy link

neilptel commented Jan 22, 2018

I created jsbin here . I tried using same jsbin with older ember releases and seems it started from ember 2.15.0. Any help would be appreciated.

@rwjblue
Copy link
Member

rwjblue commented Jan 22, 2018

Ember 2.15 updated versions of glimmer-vm, which is why things changed in that version.

FWIW, we are getting ready to update glimmer-vm to latest again on Ember master branch (targeting 3.1)...

@GavinJoyce
Copy link
Contributor

GavinJoyce commented Jan 25, 2018

@rwjblue here's one reproduction of the issue:

https://ember-twiddle.com/784e904b6ec59dbcb454b1c17ed237d8?openFiles=templates.application.hbs%2C

screen shot 2018-01-25 at 09 38 28

@GavinJoyce
Copy link
Contributor

GavinJoyce commented Jan 25, 2018

A more general reproduction:

export default Component.extend({
  init() {
    this._super(...arguments);
    throw 'a little exception';
  }
});

https://ember-twiddle.com/d64ffa7e42703cc42f1ff829eeb0328c?openFiles=templates.application.hbs%2C

This has the side effect of producing two runtime exceptions:

screen shot 2018-01-25 at 12 00 02

Uncaught TypeError: Cannot read property 'getAttribute' of undefined is due to the rendered root not having a result:

screen shot 2018-01-25 at 12 01 51

@rwjblue
Copy link
Member

rwjblue commented Jan 25, 2018

@GavinJoyce - Thank you for the simple reproduction! I have submitted emberjs/ember.js#16174 with (previously failing) tests for the specific scenario you provide and the fix.

@rwjblue
Copy link
Member

rwjblue commented Jan 25, 2018

@GavinJoyce - Also, FWIW, I think that second error you were seeing:

Uncaught TypeError: Cannot read property 'getAttribute' of undefined is due to the rendered root not having a result

Is actually from the ember-inspector here, and would only happen if you had it open. Definitely still something to fix, but its a different beast...

@rwjblue
Copy link
Member

rwjblue commented Jan 25, 2018

There may still be more scenarios that will trigger this issue, if there are lets open a new issue with a specific reproduction. Given a reproduction (like @GavinJoyce did in #484 (comment)) it should be straightforward to address the various scenarios that come up...

@hoIIer
Copy link

hoIIer commented Mar 6, 2018

getting this error in 3.0.0-beta.1 when I navigate between sibling routes

@rwjblue
Copy link
Member

rwjblue commented Mar 6, 2018

In all known cases of this message, an error from user land code is thrown before the “nested transaction” error.

As mentioned in the prior comment, please report a new issue with a reproduction. At this point (with Ember 3.0) we really need to know where the user land errors are still being thrown that isn’t already handled properly by the recovery mechanisms in place...

@hoIIer
Copy link

hoIIer commented Mar 6, 2018

ill try to find out, I didnt see any other errors in console other than a string of this same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.