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

Deleting some drafts causes 500 error #212

Closed
edwoodward opened this issue Mar 19, 2015 · 5 comments · Fixed by #222
Closed

Deleting some drafts causes 500 error #212

edwoodward opened this issue Mar 19, 2015 · 5 comments · Fixed by #222
Assignees

Comments

@edwoodward
Copy link
Member

I deleted some of the drafts in my workspace on dev.cnx.org. Some were successful, but others caused a 500 error. They should all delete.

A few links

@mmulich
Copy link
Member

mmulich commented Mar 19, 2015

Some info I've found out about these documents:

  1. All three pieces of content have both 'ew2' and 'ew3' as assigned and accepted authors.
  2. Looks like none of these documents exist in publishing/archive. All of them were created last year, so it's possible that we started with a fresh archive and abandoned the connected material in authoring.

I've been working with the first piece of content (c588fc82-e058-409e-a70d-0b7908e8dac3). So it does now exist in publishing. However, my attempts to delete as 'ew2' have been unsuccessful.

@rich-hart rich-hart assigned rich-hart and unassigned mmulich Mar 23, 2015
@rich-hart
Copy link
Contributor

Authoring Error Log

127.0.0.1 - - [19/Mar/2015:13:55:56 -0500] "GET /users/contents?authorID:ew2 HTTP/1.0" 200 - "http://dev.cnx.org/workspace" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
127.0.0.1 - - [19/Mar/2015:13:56:04 -0500] "DELETE /contents/14b3b55c-6141-41a7-84cb-472cd6e5b0ca%40draft/users/me HTTP/1.0" 200 - "http://dev.cnx.org/workspace" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
2015-03-19 13:56:04,640 INFO  [requests.packages.urllib3.connectionpool][Dummy-4] Starting new HTTP connection (1): localhost
2015-03-19 13:56:04,652 DEBUG [requests.packages.urllib3.connectionpool][Dummy-4] "GET /publications/43 HTTP/1.1" 200 4103
2015-03-19 13:56:04,795 INFO  [requests.packages.urllib3.connectionpool][Dummy-4] Starting new HTTP connection (1): localhost
2015-03-19 13:56:04,806 DEBUG [requests.packages.urllib3.connectionpool][Dummy-4] "GET /publications/515 HTTP/1.1" 500 110
127.0.0.1 - - [19/Mar/2015:13:56:04 -0500] "GET /users/contents?authorID:ew2 HTTP/1.0" 200 - "http://dev.cnx.org/workspace" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0"
2015-03-19 13:56:11,828 INFO  [requests.packages.urllib3.connectionpool][Dummy-2] Starting new HTTP connection (1): localhost
2015-03-19 13:56:11,842 DEBUG [requests.packages.urllib3.connectionpool][Dummy-2] "GET /contents/efdb0076-1f82-4ca3-b49a-46bb4ee26ebe/permissions HTTP/1.1" 404 152
2015-03-19 13:56:11,843 ERROR [waitress][Dummy-2] Exception when serving /contents/efdb0076-1f82-4ca3-b49a-46bb4ee26ebe@draft/users/me
Traceback (most recent call last):
  File "/opt/dev/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/channel.py", line 337, in service
    task.service()
  File "/opt/dev/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/task.py", line 173, in service
    self.execute()
  File "/opt/dev/local/lib/python2.7/site-packages/waitress-0.8.9-py2.7.egg/waitress/task.py", line 392, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/router.py", line 242, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/router.py", line 217, in invoke_subrequest
    response = handle_request(request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid_translogger-0.1-py2.7.egg/pyramid_translogger/__init__.py", line 119, in tween
    response = handler(request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 329, in attr_view
    return view(context, request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 305, in predicate_wrapper
    return view(context, request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/opt/dev/local/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/views.py", line 501, in _requestonly_view
    response = view(request)
  File "/opt/dev/cnx-authoring/cnxauthoring/views.py", line 48, in wrapper
    return function(request, *args, **kwargs)
  File "/opt/dev/cnx-authoring/cnxauthoring/views.py", line 56, in wrapper
    response = function(*args, **kwargs)
  File "/opt/dev/cnx-authoring/cnxauthoring/views.py", line 516, in delete_content
    delete_content_single(request, id, user_id=user_id)
  File "/opt/dev/cnx-authoring/cnxauthoring/views.py", line 476, in delete_content_single
    utils.declare_acl(content)
  File "/opt/dev/cnx-authoring/cnxauthoring/utils.py", line 384, in declare_acl
    raise PublishingError(response)
PublishingError: Publishing Error: 404 <html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  The resource could not be found.<br/><br/>



 </body>
</html>

@mmulich
Copy link
Member

mmulich commented Mar 31, 2015

I also have one of these pieces of content (created in December). http://dev.cnx.org/contents/[email protected]/Dev_Book_4

We may actually run into this issue on production if we ever do that "back out of a publish gone wrong" we talked about. I'm of the opinion that an empowered user could get out of this situation if they could "recover their content after a failed publication."

@rich-hart
Copy link
Contributor

@pumazi I was going to write an exception to ignore this error for publishing in this delete case, but I agree I think that your approach would be best.

@reedstrm
Copy link
Member

In general, yes, we need to recover. But this specific case, the user has asked to delete the draft. We should probably honor that regardless of what publishing thinks, since this only triggers if the last user with edit privs on this draft deletes.

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

Successfully merging a pull request may close this issue.

4 participants