notes icon indicating copy to clipboard operation
notes copied to clipboard

DOMException: Node.insertBefore: Child to insert before is not a child of this node

Open akn01 opened this issue 2 years ago • 6 comments

Steps to reproduce

  1. Open the Notes tab.
  2. Click on "new note".

Expected behaviour

A new note should be generated and displayed.

Actual behaviour

The new note is not displayed. The interface no longer responds. When I reload the site, the new note appears. If I first select a category and then create the new note, the problem does not occur.

The console in Firexfox shows the following:

DOMException: Node.insertBefore: Child to insert before is not a child of this node insertBefore https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 m https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 b https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 w https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 w https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 Wa https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _update https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 r https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 get https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 run https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 Dr https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 On https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 xn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 promise callback*wn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 On https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 Er https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 update https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 notify https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 20144 https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 updateNote https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _ https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 commit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 commit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _withCommit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 commit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 commit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _ https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 A https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 promise callback*A https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 onNewNote https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 yn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 n https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 yn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 $emit https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 click https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 yn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 n https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 click https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 yn https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 n https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _wrapper https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 ia https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 St https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 oa https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _ https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 Wa https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _update https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 r https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 get https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 e https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 mount https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 $mount https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 init https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 h https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 Wa https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 _update https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 r https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 get https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 e https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 mount https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 $mount https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 init https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 h https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 f https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 h https://sample.com/apps/notes/js/notes-main.js?v=d434a9d7-0:2 notes-main.js:2:2455595

and then:

DOMException: Node.insertBefore: Child to insert before is not a child of this node VueJS 21 updateNote notes.js:156 _ vuex.esm.js:844 commit vuex.esm.js:466 commit vuex.esm.js:465 _withCommit vuex.esm.js:624 commit vuex.esm.js:464 commit vuex.esm.js:409 _ NotesService.js:212 A NotesService.js:198 promise callback*A NotesService.js:197 onNewNote App.vue:232 VueJS 4 click index.module.js:2 VueJS 2 click index.module.js:2 VueJS 33 vue.runtime.esm.js:3049:16

Server

  • Notes app version: 4.9.1
  • Nextcloud version: Nextcloud Hub 6 (27.1.5)
  • OS: debian 12.4
  • Web server: Apache/2.4.57 (Debian)
  • PHP version: PHP 8.2.7
  • Database: MariaDB 10.11.4-MariaDB-1~deb12u1 Debian 12

Nextcloud configuration:

{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "192.168.0.15", "sample.com" ], "overwriteprotocol": "https", "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "27.1.5.1", "overwrite.cli.url": "http:\/\/192.168.0.15", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "memcache.local": "\\OC\\Memcache\\APCu", "default_phone_region": "DE", "memcache.locking": "\\OC\\Memcache\\APCu", "maintenance": false, "updater.release.channel": "stable", "loglevel": 2 } }

Client

  • Browser: Firefox 120.0.1
  • OS: Windows 10 Pro 22H2

Log files

{"reqId":"teBFtCV2bCSABfSAW8m5","level":3,"time":"2023-12-20T15:29:19+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"John Doe","app":"notes","method":"GET","url":"/index.php/apps/notes/notes/1302","message":"Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0","version":"27.1.5.1","exception":{"Exception":"OCA\\Notes\\Service\\NoteDoesNotExistException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/notes/lib/Service/NotesService.php","line":73,"function":"getFileById","class":"OCA\\Notes\\Service\\NotesService","type":"::"},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php","line":138,"function":"get","class":"OCA\\Notes\\Service\\NotesService","type":"->"},{"file":"/var/www/nextcloud/apps/notes/lib/Service/Util.php","line":26,"function":"OCA\\Notes\\Controller\\{closure}","class":"OCA\\Notes\\Controller\\NotesController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/Helper.php","line":140,"function":"retryIfLocked","class":"OCA\\Notes\\Service\\Util","type":"::"},{"file":"/var/www/nextcloud/apps/notes/lib/Controller/NotesController.php","line":137,"function":"handleErrorResponse","class":"OCA\\Notes\\Controller\\Helper","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"get","class":"OCA\\Notes\\Controller\\NotesController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1068,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":38,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/notes/lib/Service/NotesService.php","Line":219,"message":"Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException","exception":[],"CustomMessage":"Controller failed with OCA\\Notes\\Service\\NoteDoesNotExistException"},"id":"658308663d1e2"}

Additions

I downgraded to notes app version 4.8.1 and everything works as expected, apart from that: After deletion of a note an exclamation mark icon appears on the right in the note-container content division element. The console in Firefox says:

Uncaught TypeError: this.note is null refreshNote NotePlain.vue:325

akn01 avatar Dec 20 '23 15:12 akn01

This bug persists in NC 28.0.1 and Notes 4.9.2. In Firefox all management operations on notes are broken: after renaming, categorizing or deleting any note the GUI freezes and only becomes responsive again afer page reload. This behavoir is accompanied by DOMExceptions as described in the issue variating by the operation currently failing Child to insert before is not a child of this node, The node to be removed is not a child of this node etc.

hatelamers avatar Jan 18 '24 16:01 hatelamers

Downgrading to 4.8.1 unfortunately only "repairs" freezing after creating and deleting notes (different JS errors are logged like TypeError above, but UI remains usable).

hatelamers avatar Jan 18 '24 16:01 hatelamers

We encounter exactly the same issue with Nextcloud Enterprise 26.0.10 and Notes 4.9.2. But as far as I know it only affects one user. If I can assist with this issue in any way just tell me.

hyperlink-skylight avatar Jan 26 '24 11:01 hyperlink-skylight

Still have the same problem with nextcloud 28.0.3 and notes 4.9.4

I tried to enclose it a bit and I guess it is somehow related to labels. Normally, all of my nodes have assigned labels, This is why it triggers every time for me.

The observed behavior is, that creating a node will trigger "DOMException: Node.insertBefore: Child to insert before is not a child of this node" if it is the first node without a label. If I create a second note and the previous new note still does not have a label, it works fine. If I assign a label and create a new note after, the error triggers again.

The same happens when I delete a note. Everthing works fine, until I delete the last note without a label. Then the error "DOMException: Node.removeChild: The node to be removed is not a child of this node" will be triggered.

So my guess is, that it is somehow related to the visualization of categories with the first (new) or last (deleted) note.

as described in issue https://github.com/nextcloud/notes/issues/1188 , a pagereload will show that the creation or deletion of a note was succesful

HolgerHees avatar Mar 30 '24 15:03 HolgerHees

is this ticket waiting on more info regarding the bug or a developer to implement the fix?

modernNeo avatar May 20 '24 04:05 modernNeo

Adding to this that if you have the Notes page open in a Chromium browser and Firefox at the same time, this bug goes away and Firefox works normally

cordlord avatar Jun 14 '24 13:06 cordlord

Are any of you seeing this since v4.10.1 was released? That contains the fix from #1322 for a similar issue (#1298).

joshtrichards avatar Aug 08 '24 12:08 joshtrichards

works for me with the latest version. :-)

HolgerHees avatar Aug 09 '24 12:08 HolgerHees