Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

How do I recover my content after a failed publication? #190

Open
mmulich opened this issue Jan 22, 2015 · 3 comments
Open

How do I recover my content after a failed publication? #190

mmulich opened this issue Jan 22, 2015 · 3 comments
Labels

Comments

@mmulich
Copy link
Member

mmulich commented Jan 22, 2015

This is possible two issues, but I'm more concerned with recovering my content.

The issue is that I've attempted to put an link to another page in a page within my book. And the content ends up in a "Failed/Error" state that I can't fix as a user.

| Book With Issue (BWI)
|- Page One (PO)
|- Page Two (PT)

To reproduce,

  1. Create a book with two pages (as shown above).
  2. Publish the book.
  3. Copy the link to PO.
  4. Edit PT to include the link to PO
    *. (For good measure add a keyword to the book so that it is edited as well.)
  5. Publish

The workspace now shows the state as "Failed/Error". If you grab the publication id and look at the publishing response you'll see the error is an InvalidReference. For example:

{
state: "Failed/Error",
messages: [
{
xpath: "/div/p[5]/span/a",
code: 20,
publication_id: 748,
value: "http://dev.cnx.org/contents/f12b4c7a-73b5-472e-88db-3c7cd026c942@1/Gomvr",
epub_filename: null,
pending_document_id: 1114,
pending_ident_hash: "583344b8-c7f6-47c7-a9ac-a66e6b50e4bd@2",
type: "InvalidReference",
message: "Invalid reference at '/div/p[5]/span/a'."
}
],
publication: "748"
}

This error is probably valid since I don't think publishing knows about any other domains besides cnx.org and legacy.cnx.org. That will require further investigation within cnx-publishing and the reference resolution code.

This issue needs to answer the questions How do I recover my content? now that it is in a broken state.

@mmulich mmulich added the bug label Jan 22, 2015
@karenc
Copy link
Member

karenc commented Jan 23, 2015

I don't think this is a problem in authoring. See this test, if there's a publication error, you can save again and authoring will reset the status to "draft" and then you can try publishing again.

@rich-hart
Copy link
Contributor

I think that the updated reference to Karen's test is this link

@mmulich
Copy link
Member Author

mmulich commented Mar 24, 2015

I tried using this method of PUT to recover. It didn't work out for me. But I'm likely doing something wrong.

>>> cookies = dict(session="<session-info-from-request>")
>>> id = '3ad7cf08-a3eb-4f95-b32a-b9faf25141e9'
>>> url = 'http://localhost:8080/contents/{}@draft.json'.format(id)
>>> import requests, json
>>> resp = requests.get(url, cookies=cookies)
>>> resp
<Response [200]>
>>> data = resp.json()
>>> resp = requests.put(url, data=json.dumps(data), cookies=cookies)
>>> resp
<Response [200]>

Upon returning to the content in the browser, it strangely still wants to pull from the published version, which doesn't exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants