Cannot edit pages created via copy single page API

Yeah, there are many sites still supporting the legacy page format. I don’t honestly know how this all works under the hood except that there are two data formats now, and they do not 100% intersect in features, and they get translated to and from one another in various contexts.

It’s also very possible that these issues are unrelated to what we had seen before.

Re: Posts hidden. I don’t know what happened the system account decided 4 posts were from new users even though they weren’t. One of my posts was hidden as well.

It wasn’t a manual decision to hide them. Looks like they have all been restored since then.

Update: @michael-k triggered the new user spam threshhold by posting the url to his heroku descriptor in multiple threads and multiple replies.

This new user tried to create multiple posts with links to the same domain. All posts from this user that include links should be reviewed. See the newuser_spam_host_threshold site setting.

2 Likes

Just to be clear the problem posted on this page is not because we’re copying a page from the old editor to the new editor correct? @michael-k seemed to indicate that he’s not using the older editor in his last reply.

@rwhitbeck that’s correct. I create a page using the editor, copy the page using the API, then try to edit the copied page using the same editor. I’m not sure how to determine the version of the editor. Attached is a screenshot of the editor incase that helps.

I just started fiddling with this to see if I could reproduce it. After a very brief attempt to replicate it using an admin user, I have not yet seen the same problem. On my second test, however, I found that both a basic image macro and the viewpdf macro from the original page failed to copy effectively:

Input page:

Output page:

And here are the before and after storage formats of each page:

Input:

<p>This is an image:</p>
<ac:image ac:align="center" ac:layout="center" ac:original-height="667" ac:original-width="500">
  <ri:attachment ri:filename="keep-crom.jpg" ri:version-at-save="1" />
</ac:image>
<p>This is a pdf:</p>
<p class="media-group">
  <ac:structured-macro ac:name="view-file" ac:schema-version="1" ac:macro-id="11ad8069-ea60-4998-9556-47637a794905">
    <ac:parameter ac:name="name">
      <ri:attachment ri:filename="thecozyapron.com-Pan Seared Salmon for When the Simplest Things Just Make You Happy.pdf" ri:version-at-save="1" />
    </ac:parameter>
  </ac:structured-macro>
</p>
<p>This is an inlined pdf:</p>
<ac:structured-macro ac:name="viewpdf" ac:schema-version="1" data-layout="default" ac:macro-id="22225768-66c1-405f-b7b0-6b64e1c94913">
  <ac:parameter ac:name="name">
    <ri:attachment ri:filename="thecozyapron.com-Pan Seared Salmon for When the Simplest Things Just Make You Happy.pdf" ri:version-at-save="1" />
  </ac:parameter>
</ac:structured-macro>

Output:

<p>This is an image:</p>
<ac:image ac:align="center" ac:layout="center" ac:original-height="667" ac:original-width="500">
  <ri:attachment ri:filename="keep-crom.jpg" ri:version-at-save="1">
    <ri:page ri:space-key="CG" ri:content-title="[ADF] Attachments" ri:version-at-save="1" />
  </ri:attachment>
</ac:image>
<p>This is a pdf:</p>
<p class="media-group">
  <ac:structured-macro ac:name="view-file" ac:schema-version="1" ac:macro-id="16b61a64-23cf-40b6-9e6f-7843c0447982">
    <ac:parameter ac:name="name">
      <ri:attachment ri:filename="thecozyapron.com-Pan Seared Salmon for When the Simplest Things Just Make You Happy.pdf" ri:version-at-save="1">
        <ri:page ri:space-key="CG" ri:content-title="[ADF] Attachments" ri:version-at-save="1" />
      </ri:attachment>
    </ac:parameter>
  </ac:structured-macro>
</p>
<p>This is an inlined pdf:</p>
<ac:structured-macro ac:name="viewpdf" ac:schema-version="1" data-layout="default" ac:macro-id="22225768-66c1-405f-b7b0-6b64e1c94913">
  <ac:parameter ac:name="name">
    <ri:attachment ri:filename="thecozyapron.com-Pan Seared Salmon for When the Simplest Things Just Make You Happy.pdf" />
  </ac:parameter>
</ac:structured-macro>

@rwhitbeck

This morning we have a case of this problem (the original post, with permissions being broken on the copied page) being reported by a customer using our Copy Page Tree app, which uses the Copy Page Hierarchy REST API under the covers.

This is suddenly a much more urgent issue for us as it’s affecting app customers. How can we escalate quickly? We will be digging in and trying to get reproducer details. I will open a critical incident post if necessary.

1 Like

I’ve reached out to @BobBergman directly to understand more about their customers issues in a more private setting.

I’ll circle back here with any updates.

@rwhitbeck any updates on fixing this issue? I’m holding off launching a new marketplace app as it will undoubtedly lead to bug reports and bad reviews.

@BobBergman have you figured out any workarounds for the time being that I might be able use?

@michael-k We haven’t gotten to the bottom of it yet, but we have connected our customer with Atlassian for further investigation. I don’t think they’ve determined anything yet. AFAIK neither we nor Atlassian have been able to reproduce this problem. If this is a development instance of Confluence you are using that you could add me to as a user, I’d be interested in trying to reproduce it there. That’s a big ask though and I totally understand if you don’t want to do that. If not, perhaps you could invite Ralph to your instance and let him take a stab at reproducing it there. Either way, it might help validate the problem and gather better diagnostics?

@rwhitbeck I know I sort of hijacked the original post in some of my comments above, but I am wondering if anyone has taken a look at the other problems with the single page copy API’s handling of attachments that I pointed out above?

I am also running into this issue. The browser console in the editor gives me an error like this: com.atlassian.confluence.api.service.exceptions.No… find content with ID 1458241870 and status draft.

The error only occurs with some pages, not with others. The only pattern that I can see is that it seems to be that it only occurs when copying pages that were created a while ago. I am unable to reproduce it with newly created pages. I cannot see any other patterns, some of the broken pages don’t even have any content or attachments at all.

2 Likes

@michael-k @candid We just had another customer report this to us. The only new piece of information I have is that the customer is using a free version of Confluence, which I personally have not yet tested with. I don’t suppose you two are using the free Confluence, are you? Seems like a long shot, just following the slim lead there.

1 Like

@BobBergman @candid the bug occurs on all pages in my confluence development instance which is free and happens to have the “old” style navigation. That’s the only discerning factor I’ve been able to glean. The problem does not occur on my freshly minted paid instance of confluence which has the “newer” style navigation.

@candid on the copied pages with the problem, when I try to edit them I also see an error in the brower console matching what you described.

2 Likes

I’m on the standard plan, but it’s a developer instance.

Strangely, shortly after I could reliably reproduce the issue and reported it here, it does not seem to happen anymore. Even copies that I previously couldn’t edit have now become editable. I’m not sure if I’m doing something differently now or if it’s still reproducible with other pages that I haven’t discovered yet.

1 Like

One of our customers that reported it is using a regular paid instance of Confluence, so I guess the “free” connection is debunked.

We also received this info:

I refreshed, logged out and back in, I also tried from another machine that I had never used to sign in with Confluence but I still got the message.

The only way I got to make changes to the pages was by clearing cookies several times logging in and out several times and the system allowed to make changes.

Not sure what the current status of this issue is, but we also had a customer report the exact problem reported by @michael-k.

Context
The current version of our app Scroll Documents for Confluence uses the ‘CopyPageHierarchy’ API.

@rwhitbeck any insight?

@rwhitbeck this issue with the copy single page api continues. My app is being reviewed and the reviewer is encounterung an error editing one of the pages copied with the api. They are getting the following error which is exactly what I was seeing in the browser Javascript console and it also matches the error reported by @candid

PUT
{instance_url}wiki/rest/api/content/462028801/?status=draft&action=publish

{"statusCode":404,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.NotFoundException: null"}

Here’s my marketplace service desk ticket
https://ecosystem.atlassian.net/servicedesk/customer/portal/9/AMKTHELP-23184

We still hear reports of this from time to time as well using the copy page hierarchy API. We recently had a customer uninstall one of our apps because of it.

Could we at least get an issue opened with Confluence that we could point customers to?

I’ve reengaged the engineering team on this again.

When we helped @BobBergman and his customer it was discovered that they didn’t use the copyPermissions property as set to true. Once they did that they we’re no longer having problems and the ticket was closed.

However looking at your original post it looks like you are using copyPermissions.

This thread has also been hijacked a few times and it’s become difficult to follow.

The problem you’re reporting now is the same as the first post in the thread correct?

We’ve had reports of it happening regardless of the value of the copyPermissions input. The only thing I have heard that sometimes helps is to log out, clear browser caches, and log in again.