Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Code Block Macro Hanging, how to resolve?

James Rinkevich October 7, 2019

Code Block Macro will spin  (hang) when invoked explicitly such as by clicking the edit button. Partial work-arounds are available using {code

3 answers

0 votes
Tom Svaleklev October 30, 2019

We have exactly the same problem with the Code Block macro only. Please advise as we are not able to use it at all.

Confluence version: 6.15.6

Tom Svaleklev October 30, 2019

We spotted the problem in our case and it had to do with a totally different plug-in we are using named Linchpin Events. An upgrade was available and once applied our problems went away.

Very unclear why Linchpin Events was in play at all on our offending page(s) where the Code Block macro was used, but no macros from Linchpin? 

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2019

Tom,

Thank you for letting us know about that. It could be that there's something running in the background from Linchpin Events that is causing this. I would also recommend contacting Linchpin to see if this is a known issue on their end.

Let me know if you have any trouble.

Regards,

Shannon

Tom Svaleklev October 30, 2019

I have informed Linchpin (Seibert Media)

Like Shannon S likes this
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2019

Tom,

Thank you for confirming that! Take care, and have a pleasant rest of your week.

Regards,

Shannon

Tom Svaleklev October 31, 2019

Linchpin fed back and confirmed that their patch that we applied was a bug fix of this exact case so they were aware.

Like Shannon S likes this
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 1, 2019

Tom,

That's great, thank you so much for the update!

Have a pleasant weekend.

Regards,

Shannon

0 votes
James Rinkevich October 17, 2019

Entered:  https://getsupport.atlassian.com/servicedesk/customer/portal/14/CSP-261735
This is a short week. We had Columbus day on Moday and tomorrow, our 5-4-9 Friday off, however, I entered this through my gmail account so I could see it when I wasn't at wasn't at work given we're on GMT-0700 aka PDT (Los Angeles time zone). 

James Rinkevich October 17, 2019
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2019

Hi James,

Thank you for confirming that.

I see my colleague replied to you before I had a chance to update the case with your details. Feel free to reply there with a copy of your HAR file and Support zip. I want to be able to confirm that you are indeed encountering the issue in the bug.

Thank you for your help.

Regards,

Shannon

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2019

Hi @James Rinkevich,

I see that your case with the support team is about to timeout since we haven't heard from you recently with a copy of your HAR file and support zip. You'll want to reply in the next day or so to avoid that happening! Let me know if you're having any trouble uploading files to the support portal.

Regards,

Shannon

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 9, 2019

Hello James,

Welcome to Atlassian Community. It's nice to meet you.

You'll want to have a look at your Confluence Server logs as well as what's going on in the Developer Tools > Network console of your browser. This should tell you what it's hanging on.

You can feel free to share any messages you encounter there, as well as which version of Confluence you are running, and I can help you to determine the issue.

Regards,

Shannon

James Rinkevich October 9, 2019

OK looked at the server logs nothing was there but the developer tools have a failure to load plugin from http://server:port/<rest of plugin url> and I'm certain the server does not respond to http: as that is considered an insecure protocol.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 10, 2019

James, 

Can you verify that your base URL isn't set to the http version? It seems odd that the code macro would try to be accessing your site from that protocol.

Regards,

Shannon

James Rinkevich October 10, 2019

looking at the Confluence administration page, Under CONFIGURATION in the general administration section the Server Base URL is set to https://<server_confluence_host_name>:<port> 
Also under administration in system information it shows the same Server Base URL

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2019

Thank you, James.

I suspect you might be running into this bug:

  • CONFSERVER-57934 Adding panel,excerpt,warning,note,tip or info macro to the page in edit mode will trigger mixed content action in browser

Specifically, it mentions the info, etc. macros, but it has affected other macros, such as the code block macro. This would depend on your version of Confluence, but it's been affecting the latest versions.

There's a workaround you can apply that has helped some users listed on the ticket. Could you give that a try and let me know if corrects the issue? If not, I would ask that you can record the behaviour into a HAR File so we can have a deeper look.

Regards,

Shannon

James Rinkevich October 11, 2019

I tried to load the java script but either I did not load it in the proper area or it didn't work. BTW this happens in both IE11/Win10 and Chrome.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2019

James,

Can you let me know where you added the javascript, and your exact version of Confluence?

Regards,

Shannon

James Rinkevich October 15, 2019

1. I tried adding the script on the page where I was using the code block macro. Should I have added it to the Custom HTML on the Look and feel tab of the administration page
2. We have Confluence v7.01 installed.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 16, 2019

Hi James,

The workaround says that it should be added in the Custom HTML section.

Workaround

Some users have found the below custom HTML resolves the issue in Chrome:

Copy text/code below into BODY section of Configuration --> Custom HTML

<script type="text/javascript">
  function fixFrameContent(frameContent, broken_url_prefix) {
    var replaced = false;
    // Replace broken img src urls
    frameContent.find("img").each(function(index) {
      var srcUrl = AJS.$(this).attr("src");
      if (srcUrl.toLowerCase().startsWith(broken_url_prefix)) {
        var srcNewUrl = srcUrl.substring(broken_url_prefix.length);
        AJS.$(this).attr("src", srcNewUrl);
        replaced=true;
      };
    });  // each img
     
    // Replace broken tables for macro - background img url is broken
    // Iterate over all relevant tables to check background-image URL
    frameContent.find("table.wysiwyg-macro").each(function(index) {
      AJS.log(AJS.$(this));
      var bgiRaw = AJS.$(this).css("background-image");
      if (!bgiRaw) return true;  // nothing to do, continue with next element
      // remove 'url(...)' around the content
      var bgiUrlMatch = bgiRaw.match(/url\(["']?(.*)["']?\)/);
      if (!bgiUrlMatch) return true;  // nothing to do, continue with next element
      var bgiUrl = bgiUrlMatch[1];
      if (bgiUrl.toLowerCase().startsWith(broken_url_prefix

Can you give that a try and let me know how it goes?

Regards,

Shannon

James Rinkevich October 16, 2019

This didn't work. still get 400 errors that lead to code block macro spinning/hanging.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2019

James,

Thank you for trying the workaround and confirming that it's not effective in your situation.

I'd like to raise a ticket for you in support, but I wasn't able to find a license associated with your email address. Could you confirm with me if you have a valid license currently?

Regards,

Shannon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events