-
Notifications
You must be signed in to change notification settings - Fork 97
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
Failure: Page already exists #1067
Comments
Enable Sphinx to run with a higher verbosity may provide more insights.
This very well may be the case. Confluence sometimes reports 500 errors which request from this extension may perform a generic retry or some special retry events. There is a use case where a title conflict should fallback to a page update. My random guess (from a fresh state) maybe that some page (maybe the large one you mentioned) is being published, accepted by Confluence but then the instance reports a 500-like error. An automatic retry is made:
Which will repeat the same request to create a "new" page instead of updating and Confluence reports the title already existing. The extension then retries for find the title that should exist to perform a page update, but maybe it fails to find it? This will in turn re-raise the original exception that a duplicate title exists.
There does not exist such a capability at this time. We can try to introduce something like this, but it might get a bit complex (e.g. if a page fails to publish, how to gracefully handle not publishing nested pages and attachment that could later fail as well). The extension is designed in a way where Sphinx can be re-run and only newer pages are updated. With respect to Confluence, there should be a hash check made on the page's metadata to verify if a new publish is warranted. However, this does not apply if you plan to do a fresh state each time. If the issue only occurs on one or a subset of "large" documents in the entire set, a workaround could be to run Sphinx twice -- once to publish most of the documents as normal and then re-run with only publishing the large one with a larger delay. Granted, not ideal.
In theory, page sizes are not a concern for the extension itself. It is just a matter of how Confluence handles it. This extension tries to handle various undocumented and unexpected states reported by Confluence instances, but the process of handling all the corner cases is less then ideal. If you can reproduce the error, running with |
Hi @jdknight thanks for your explanation. The wiping of the space was the hackish solution to avoid following errors which seem to pop up randomly (I cannot make out a pattern, at least). Only updating changed pages is preferable, orf course. The error that occurs randomly when not whiping the space is the following:
or
I am not sure what that means. My initial assumption was that changes take precedence over the current state which is why I am having a hard time why there can even be a conflict. Shouldn't the property simply be overwritten? After whiping the space, the apparent timing issue can occur which I tried to fix with the longer timeout. The clear downside is that the documentation is gone while the very slow publishing process is active. Would it be possible to query pages before retries to make sure that they are really not present? IMHO, it is sad that the confluence API is so unreliable to necessitate this but maybe this approach could remedy the situation. I am rerunning the publication on a freshly wiped space right now and will update this posts if I receive a more detailed error message. EDIT: Here's a failure that even occured with a freshly wiped space:
|
There appears to be a couple of error situations being mentioned here.
Properly-related issues have been a bit of a pain since their introduction in extension. The original Confluence API allowed content like page labels to be applied as part of a page update. Now that they need to be served by another (property) request, there have been some unexpected scenarios observed. For example, creating a new page and then wanting to publish a proper update for a page, Confluence may or may not have already created that property (either it being forced by design or maybe through some other marketplace addon). So, we attempt to put our property update and it may fail; which then we try to be nice by asking Confluence what it thinks it should be, make our changes with version bump and re-submit again. It appears to have been working with some success, but maybe your situation it is not. One thing I did notice is we only apply property retry events for all properties except an extension-specific one. I have updated the implementation to ensure all property updates attempt the crude retry attempt to see if it might prevent some publishing issues. If interested, you can try to install the development version of this extension to see if it helps.
My only other guess where this might be happening is a situation where a child page has the same title has a parent page and Confluence denies the child page publish since it would result in an invalid hierarchy. But I cannot recall what come from that investigation.
Yes... but properties (like pages/etc.) need to have a version increment to be accepted. So, if a proper entry was versioned 41, the next update needs to include a property with a version hint of 42. There might be another scenario where conflict events are triggered that I am not yet aware of.
Funny enough, we already do this in some fashion. While it was for another use case, if a new page update fails with a "title already exists" error, it should perform another page search and then do another update (e.g. 500 error on failure, retry event reports page exist, which gets caught in a re-check if the page exists with a name search, and if found, retry the page update). Although, I guess for this error case, this might result in the large/troubled page being attempted to be published twice... but I do not immediately see any reported output that shows that is happening.
There is not much this extension can do for this use case. It appears that either the chance of this publish event occurred during limited availability event for Confluence Cloud or that you may have been publishing in a proxy environment which the proxy was not playing nice. There is a maximum of three attempts made here for the 500-series error. With that in mind, I have introduced two new configuration options
I appreciate the additional logs and content. It does help give a more detailed picture of where some areas in the code are having trouble. Instead of, which what I assume you logged with
However, no worries if not desired/possible. |
Hi all,
as my usage of this nice tool intensifies, I have stumbled across another issue that I cannot seem to fix. When I push my documentation to confluence, I receive the following error:
While the response is relatively clear, it unfortunately does not tell me which page resulted in this error. Additionally, I am a bit confused how this can be because:
Is there some way to further investigate? Also, being able to skip pages with errors and continue would already help a lot. I have almost 10k pages about configuration files and the one failing is around number 3k leading to a situation in which 7k configs remain undocumented. Is this possible?
Update:
I have actually spent the time watching the publishing process to figure out which page is to blame. The page in question is also 800kb in size and therefore the biggest one I have. Is it possible that this is a problem? It is always this page that seems to cause the issue. It is interesting that there is a retry before and then it states that the page already exists. Is it possible that the first attempt actually succeeds and then the retry fails?
Update 2:
After increasing the time out to a minute, my documentation is correctly being published again. This leads me to believe that there is some issue with the retry being initiated even though the primary request ends up succeeding. The other issue is that this completely cancels the publishing process as a whole
The text was updated successfully, but these errors were encountered: