Insert ?Livesearch? Macro does not work (TypeError: AJS.clone is not a function)
Asked by Arek Jarosiewicz:

Dear All, I am using Confluence version 7.1.0 and have noticed that Liveseach macro stopped working in recent version. Does any one have any idea whether its a bug or configuration issue ?

nl.avisi.confluence.plugins.numberedheadings:nh-macro-browser-fields.js:5 Uncaught TypeError: AJS.clone is not a function  
at Object.AJS.MacroBrowser.ParameterFields.enum (nl.avisi.confluence.plugins.numberedheadings:nh-macro-browser-fields.js:5)  
at v (com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js.js?locale=en-GB:75)  
at Object.\<anonymous\> (com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js.js?locale=en-GB:80)  
at Function.each (batch.js:33)  
at c.fn.init.each (batch.js:29)  
at Object.loadMacroInBrowser (com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js.js?locale=en-GB:80)  
at Object.successCallback \[as success\] (com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js.js?locale=en-GB:125)  
at c (batch.js:44)  
at Object.fireWith \[as resolveWith\] (batch.js:44)  
at u (batch.js:44)


Answers:
author: Shannon S
body: Hello Arek,

Thank you for contacting us about this.

Can you let me know what behavior you're experiencing with the LiveSearch macro?

The logs you provided haven't given me very many details. Would you be able to have a look at your [Confluence Server logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html) and provide me with the stack trace which occurs the moment you replicate the problem? Look for the line that starts with *ERROR* ending with *Caused By* and it should help us to get a better picture.

Regards,

Shannon

comments: author: Arek Jarosiewicz
body: Shannon I have attached a screen-shot below from which you can see that it stuck in an infinitive loading loop forever.

I have checked the console log and above error is displayed.

![Capture.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/75169iE958D71F042E81C2/image-size/large?v=v2&px=999 "Capture.JPG")


author: Shannon S
body: Arek,

Thank you for the screenshot.

Were you able to have a look at your server logs as well? I mentioned that the information you provided from the console doesn't have enough details to narrow down this issue. We will need to have a look at your server logs themselves to get a better idea of this issue.

Thank you for your help!

Regards,

Shannon


author: Arek Jarosiewicz
body: Here you go Shannon, I have performed the action at 11:54

2019-12-05 11:54:00,757 WARN \[Caesium-1-3\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:54:13,313 INFO \[read-only-transaction:thread-1\] \[atlassian.confluence.user.DefaultUserAccessor\] getUserNamesWithConfluenceAccess Found USE permission with no associated username or group: \[USECONFLUENCE,0,null,null,null\]  
2019-12-05 11:54:13,352 INFO \[http-nio-80-exec-237\] \[synchrony.service.http.SynchronyRequestExecutor\] execute Initiating request PUT <http://127.0.0.1:8091/synchrony/v1/data/Synchrony-3fa87942-9b75-38d9-9ad2-18a8f6d75461/confluence-39652517> HTTP/1.1 for 39652517  
2019-12-05 11:54:13,359 WARN \[http-nio-80-exec-237\] \[synchrony.service.http.SynchronyResponseHandler\] failed Synchrony external changes API call returned 401: {"type":"unauthorized-access","message":"Not authorized to access this resource."} content-id: 39652517 rev: null ancestor: null merges: {"confVersion":"28","trigger":"restored","type":"external"} generate-rev: true generate-reset: true  
-- space: 6619137 \| url: /plugins/editor-loader/editor.action \| page: 39652517 \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf) \| action: editor  
2019-12-05 11:54:13,360 WARN \[http-nio-80-exec-237\] \[plugins.synchrony.service.SynchronyContentService\] runRecoveryInTransaction Could not reconcile content for restored. ID: 39652517 Caused by: com.atlassian.confluence.plugins.synchrony.model.SynchronyException: UNKNOWN_ERROR  
-- space: 6619137 \| url: /plugins/editor-loader/editor.action \| page: 39652517 \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf) \| action: editor  
2019-12-05 11:54:13,362 WARN \[http-nio-80-exec-237\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
-\>\[null\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #212886192)  
-- space: 6619137 \| url: /plugins/editor-loader/editor.action \| page: 39652517 \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf) \| action: editor  
2019-12-05 11:54:13,419 INFO \[http-nio-80-exec-237\] \[synchrony.service.http.SynchronyRequestExecutor\] execute Initiating request PUT <http://127.0.0.1:8091/synchrony/v1/data/Synchrony-3fa87942-9b75-38d9-9ad2-18a8f6d75461/confluence-39652517> HTTP/1.1 for 39652517  
2019-12-05 11:54:13,424 WARN \[http-nio-80-exec-237\] \[synchrony.service.http.SynchronyResponseHandler\] failed Synchrony external changes API call returned 401: {"type":"unauthorized-access","message":"Not authorized to access this resource."} content-id: 39652517 rev: null ancestor: null merges: {"confVersion":"28","trigger":"restored","type":"external"} generate-rev: true generate-reset: true  
-- url: /plugins/editor-loader/editor.action \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf)  
2019-12-05 11:54:13,425 WARN \[http-nio-80-exec-237\] \[plugins.synchrony.service.SynchronyContentService\] runRecoveryInTransaction Could not reconcile content for restored. ID: 39652517 Caused by: com.atlassian.confluence.plugins.synchrony.model.SynchronyException: UNKNOWN_ERROR  
-- url: /plugins/editor-loader/editor.action \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf)  
2019-12-05 11:54:13,426 WARN \[http-nio-80-exec-237\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
-\>\[com.atlassian.confluence.pages.DefaultPageManager.createOrFindDraftFor\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #212886192)  
-- url: /plugins/editor-loader/editor.action \| traceId: 8dd99919becffd23 \| userName: alex.mchugh \| referer: [http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517\&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf](http://confluence.pebble.tv/pages/viewpage.action?pageId=39652517&preview=%2F39652517%2F39652524%2FDolphin_Orca+Compressed+IP+Output+Application+Note+V6.pdf)  
2019-12-05 11:54:30,756 WARN \[Caesium-1-2\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:55:00,758 WARN \[Caesium-1-2\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:55:02,426 ERROR \[http-nio-80-exec-173\] \[confluence.util.profiling.ProfilingSiteMeshFilter\] doFilter Application context has not been initialized:  
-- referer: [http://confluence.pebble.tv/pages/resumedraft.action?draftId=39649368\&draftShareId=5368c81e-61c7-4ef5-9e47-9f7c25bd1388\&](http://confluence.pebble.tv/pages/resumedraft.action?draftId=39649368&draftShareId=5368c81e-61c7-4ef5-9e47-9f7c25bd1388&) \| url: /pages/doeditpage.action \| traceId: 54ab2f5a521f9c52 \| userName: arek  
2019-12-05 11:55:30,758 WARN \[Caesium-1-1\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:56:00,760 WARN \[Caesium-1-1\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:56:30,759 WARN \[Caesium-1-2\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:57:00,760 WARN \[Caesium-1-3\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:57:30,759 WARN \[Caesium-1-2\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:58:00,354 WARN \[Caesium-1-1\] \[impl.schedule.caesium.JobRunnerWrapper\] runJob Scheduled job LaasPerformanceLoggingJob#LaasPerformanceLoggingJob completed unsuccessfully with response JobRunnerResponse\[runOutcome=ABORTED,message='LaaS performance logging is turned off'\]  
2019-12-05 11:58:00,765 WARN \[Caesium-1-4\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:58:30,761 WARN \[Caesium-1-3\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:59:00,764 WARN \[Caesium-1-1\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:59:30,764 WARN \[Caesium-1-1\] \[search.lucene.queue.JournalIndexTaskQueue\] lambda$processEntriesInternal$1 Failed to process edge index task for entry 'JournalEntry{id=661592, journalId=JournalIdentifier{journalName=edge_index}, creationDate=Tue Dec 03 15:38:12 GMT 2019, type=ADD_DOCUMENT, message={"edgeId":"62063085","userKey":"8a8280bd48c5ced20148e5cb32910003","targetId":62063085,"date":null,"typeKey":"blogpost.create"}}'  
java.lang.NullPointerException  
2019-12-05 11:59:54,955 INFO \[http-nio-80-exec-241\] \[synchrony.service.http.SynchronyRequestExecutor\] execute Initiating request PUT <http://127.0.0.1:8091/synchrony/v1/data/Synchrony-3fa87942-9b75-38d9-9ad2-18a8f6d75461/confluence-47055092> HTTP/1.1 for 47055092  
2019-12-05 11:59:55,061 INFO \[http-nio-80-exec-241\] \[synchrony.service.http.SynchronyRequestExecutor\] execute Initiating request PUT <http://127.0.0.1:8091/synchrony/v1/data/Synchrony-3fa87942-9b75-38d9-9ad2-18a8f6d75461/confluence-47055092> HTTP/1.1 for 47055150


author: Shannon S
body: Arek,

Thank you for providing those log details.

I've heard of a user with a similar issue, and it was caused by a 3rd-party add-on, such as [Numbered Headings](https://marketplace.atlassian.com/apps/16063/numbered-headings?hosting=server&tab=overview).

Could you confirm if you're using that same add-on? If so, does disabling it correct the issue?

You can also try disabling the other 3rd-party add-ons to see if any of them might be affecting your instance. To do this, [Enable Safe Mode](https://confluence.atlassian.com/upm/disabling-and-enabling-apps-273875716.html) in UPM.

Let me know if you have any trouble or questions about that.

Regards,

Shannon


author: Jeff Turner
body: Yes, this [happens](https://www.redradishtech.com/display/~jturner/2019/12/10/Confluence+Numbered+Headings+-+still+free) if you don't upgrade your Numbered Headings app. It is marked incompatible for a reason.


author: A B
body: I worked around this error given by NumberedHeadings by adding the following to custom HTML:

```
AJS.$(document).ready(function() {
  if (!AJS.clone)
    AJS.clone = e => { e = AJS.$(e); if (e.length) return AJS.$.clone(e); return AJS.$(); };
});
```

That allows us to still use the old free version without breaking any pages.


author: Lei Wang
body: <https://confluence.atlassian.com/confkb/confluence-macros-configuration-form-stuck-in-an-infinitive-loading-loop-1019407626.html>


author: Helena Hrdinov?
body: Hi Shannon,  

We had the same issue in Confluence version 7.3.1.  
Thanks a lot to your recommendation to disable add-on Numbered Heading.  
When we disabled this add-on, the macros have already started working. :-)  

Regards,  
Helena  

comments: author: Shannon S
body: Hi Helena,

That's great to hear! Thank you for letting me know the solution is still good for the latest versions of Confluence.

Take care, and have a pleasant week.

Shannon


author: Nikita Maksimov
body: Hello [@Arek Jarosiewicz](/t5/user/viewprofilepage/user-id/339330)

I have the same problem as you on Confluence 7.0.1 but with Code Block macro.

We have installed the Numbered Pages plugin about which Shannon writes. And indeed, disabling it helped solve the problem with rendering the plugin insertion window.

[@Shannon S](/t5/user/viewprofilepage/user-id/510046) thanks for your advice!

comments: author: Shannon S
body: Hi Nikita,

Thank you for your follow-up! Hopefully it can help others as well. :)

Regards,

Shannon


Tags: confluence-server

server