Closed Bug 1002040 Opened 11 years ago Closed 10 years ago

[Page move][traceback] Problem moving fr/JavaScript to fr/Web/JavaScript

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect, P1)

x86
macOS

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: teoli, Unassigned)

Details

(Whiteboard: [traceback])

During our locasprint, I took the task in putting all the French JavaScript articles in a single hierarchy; this was a difficult task as some articles weren't connected correctly to them, to their translation parent and were scattered over 3 (!) hierarchy.

The good news is: it worked (I did more than 200 page moves) :-)
The bad news is: the final move (~250 pages) from fr/JavaScript to fr/Web/JavaScript fails.

I get this e-mail:

 Page move failed.

        Move was requested for document with slug JavaScript in locale fr,
        but could not be completed. The following error was raised:

        Revision.based_on must be None or refer to a revision of the default-language document. It was [en-US] junk #104061: 
<h2 id="About_this_Reference" name="About_this_Re

It likely is the production data that is incorrect, but I can't understand the error.

Assigning to James as he's the most likely person to be able to diagnose the problem.
Assignee: nobody → jbennett
Severity: normal → major
The problem is not that page move is busted, it's that one of the pages is busted, and page move correctly refused to move it :)

The fix is going to be finding the bad page and fixing it before attempting to move.
Assignee: jbennett → nobody
No longer blocks: 971681
(In reply to James Bennett [:ubernostrum] from comment #1)
> The problem is not that page move is busted, it's that one of the pages is
> busted, and page move correctly refused to move it :)
> 
> The fix is going to be finding the bad page and fixing it before attempting
> to move.

True, however we have a hard time finding which page is busted.
Maybe, improving the error message in the e-mail could help ;)
For example by saying exactly which page is busted :) and why it is busted would be avery nice bonus point.
Yep, I spent about 3 hours trying to find the busted page without success (I cleaned a lot, but no luck).

There are 2 problems: 1. Helping us finding which page is busted so we can perform the move 2. Improving error messages so that we can do it ourselves in the future.

I had no doubt that the page move was working well. I'm using so much without a glitch these days that I started to really trust it.

James, what can we do to success in point 1) in the future. The <h2> was implying something about "About" pages ("A propos"), but all looks ok when I look in the admin panel for such pages.
https://github.com/mozilla/kuma/pull/2357

This pull request, when it lands, will provide more informative error messages (including which child page the move failed on, and the full exception raised).

Figuring out what went wrong with the move that prompted this bug is probably just going to be a matter of either (A) hunting for it in the admin, or (B) waiting for that commit to land, re-trying the move and seeing what it tells you :)
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/a72683584fa8ee1a4349fe2289e0bb34c84cd9b1
Bug 1002040: Provide more informative page-move errors.

This tweaks the error handling in page move so that when the move
fails on a child (or grandchild, etc.) of the page being moved, the
generated error message will contain the ID, locale and slug of the
document the move failed on, as well as the type of exception it
raised and the original error message for diagnostic purposes.

https://github.com/mozilla/kuma/commit/5b7fc633c4d0a2f0a1828702b0216ae6b89f4324
Merge pull request #2357 from ubernostrum/page-move-error-1002040

Bug 1002040: Provide more informative page-move errors.
The merge is helpful! We know now the page triggering the failure.

The cause is not obvious though (which is a good thing as I performed point A in comment 4!), any help here?

" Diagnostic info:

        
                Failure occurred while attempting to move document
                with id 2843.

                That document can be viewed at:

                https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference

                The exception raised was:

                Exception type: <type 'exceptions.UnicodeDecodeError'>

                Exception message: 'ascii' codec can't decode byte 0xc3 in position 102: ordinal not in range(128)
"
I can't find this one in the New Relic error logs.
Priority: -- → P1
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/2bda2ddd1b58f2e3892f82bdc1bcb3b342d6389f
Bug 1002040: Expand the page-move error mail a bit more.

This adds the full traceback of the exception to the error, so that
less-easy things like character-encoding problems can be traced more
effectively.

https://github.com/mozilla/kuma/commit/346bd47655a083c9474954f2f9f64e75a00b21a2
Merge pull request #2363 from ubernostrum/page-move-error-1002040

Bug 1002040: Expand the page-move error mail a bit more.
James: thanks for the nice error messages, they were already useful in several other cases :-)

For this case, we know have the full traceback:
Full traceback:

Traceback (most recent call last):
  File "/data/www/developer.mozilla.org/kuma/apps/wiki/models.py", line 1497, in _move_tree
    child._move_tree('/'.join([new_slug, child_title]), user)
  File "/data/www/developer.mozilla.org/kuma/apps/wiki/models.py", line 1527, in _move_tree
    'traceback': traceback.format_exc(e)}
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 102: ordinal not in range(128)
Summary: [Page move] Problem moving fr/JavaScript to fr/Web/JavaScript → [Page move][traceback] Problem moving fr/JavaScript to fr/Web/JavaScript
Whiteboard: [traceback]
We finally understood which page was the problem (thanks to Florian and the new messages) and we deleted it. After a few more trials (with nice clear messages), we were able to finally perform the move.

\o/
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.