Difference between revisions of "MediaWiki Visual Editor Parsoid 404 Error"

no edit summary
 
Line 1: Line 1:
<div class="mw-parser-output"><div class="mw-parser-output">...OK, sometimes one can get so wrapped up in the complexities of an issue the simple basic things are missed.  And in this instance, among all the really good technical suggestions I read for correcting the issue, no one ever broached the below simple idea idea.
<div class="mw-parser-output"><div class="mw-parser-output">(and Curl Error 7, related to STUNNEL and HTTPS)
...OK, sometimes one can get so wrapped up in the complexities of an issue the simple basic things are missed.  And in this instance, among all the really good technical suggestions I read for correcting the issue, no one ever broached the below simple idea idea.


== The Issue ==
==The Issue==
I had successfully installed MediaWiki, an additional [[mediawikiwiki:Extension:WYSIWYG|WYSIWYG editor]], and as a final step I wanted to also configure the [[mediawikiwiki:VisualEditor|Visual Editor]].  To do that, one also needs to install the [[mediawikiwiki:Parsoid|Parsoid]] service (daemon, well in CentOS 7, they seem to now favor the term service) and get them 'talking' together.  So I did.  I got the Parsoid service working, and...
I had successfully installed MediaWiki, an additional [[mediawikiwiki:Extension:WYSIWYG|WYSIWYG editor]], and as a final step I wanted to also configure the [[mediawikiwiki:VisualEditor|Visual Editor]].  To do that, one also needs to install the [[mediawikiwiki:Parsoid|Parsoid]] service (daemon, well in CentOS 7, they seem to now favor the term service) and get them 'talking' together.  So I did.  I got the Parsoid service working, and...


Line 12: Line 13:
Anyway, I got the Parsoid service installed and working (tested it in all the methods recommended), but it just would not 'talk' with the MediaWiki site.  It kept coming up with a 404 (not found) error.  Nothing I did made a dent in the issue. Plus there were different suggestions from different sites that had radically different configurations settings that on the surface would seem to suggest there was no way one of these methods ever actually worked.  But I tried them anyway to no success.  After I got everything working (spoiler alert), I chalked this part of the adventure up to different versions of the Visual Editor, Parsoid, and different 'flavors' of linux.  
Anyway, I got the Parsoid service installed and working (tested it in all the methods recommended), but it just would not 'talk' with the MediaWiki site.  It kept coming up with a 404 (not found) error.  Nothing I did made a dent in the issue. Plus there were different suggestions from different sites that had radically different configurations settings that on the surface would seem to suggest there was no way one of these methods ever actually worked.  But I tried them anyway to no success.  After I got everything working (spoiler alert), I chalked this part of the adventure up to different versions of the Visual Editor, Parsoid, and different 'flavors' of linux.  


== The Research ==
==The Research==
And so I googled what I wrote as the title to this page; [[mediawikiwiki:Topic:Sz4ld1giul6g7igp|mediawiki visual editor parsoid 404 error]], and started there.  As I mentioned earlier, there were a lot of good suggestions on how to fix it, but nothing worked for me.
And so I googled what I wrote as the title to this page; [[mediawikiwiki:Topic:Sz4ld1giul6g7igp|mediawiki visual editor parsoid 404 error]], and started there.  As I mentioned earlier, there were a lot of good suggestions on how to fix it, but nothing worked for me.


== The Solution ==
==The Solution==
</div> Well, it really isn't a solution per se, but rather a suggestion in the form of a question.&nbsp; <div class="mw-parser-output">
</div> Well, it really isn't a solution per se, but rather a suggestion in the form of a question.&nbsp; <div class="mw-parser-output">
== The Question ==
==The Question==


Have you checked your apache / HTTPD configuration?
Have you checked your apache / HTTPD configuration?


== The Solution (continued) ==
==The Solution (continued)==
</div> I hadn't. And it turns out that was the issue. It had nothing to do with the MediaWiki or Parsoid configuration at all.  Specifically I had a simple typo in my httpd.conf file (I'm using CentOS 7.4, so the location and name of your Apache / HTTPD configuration file may vary. It may even be in multiple files.) that allowed me to view any page on the site, but didn't allow for editing with the Visual Editor.  As near as I could figure out it has something to do with absolute and relative paths.  But for the life of me I couldn't figure out how anything had worked at all with that typo, so I gave up on the 'why' and just fixed it.
</div> I hadn't. And it turns out that was the issue. It had nothing to do with the MediaWiki or Parsoid configuration at all.  Specifically I had a simple typo in my httpd.conf file (I'm using CentOS 7.4, so the location and name of your Apache / HTTPD configuration file may vary. It may even be in multiple files.) that allowed me to view any page on the site, but didn't allow for editing with the Visual Editor.  As near as I could figure out it has something to do with absolute and relative paths.  But for the life of me I couldn't figure out how anything had worked at all with that typo, so I gave up on the 'why' and just fixed it.


Line 27: Line 28:
<div class="mw-parser-output">
<div class="mw-parser-output">
<div class="mw-parser-output">
<div class="mw-parser-output">
== My configuration ==
==My configuration==


For my config.yaml (Parsoid service configuration) file, just two lines;
For my config.yaml (Parsoid service configuration) file, just two lines;
Line 75: Line 76:
</div>
</div>


== The Conclusion ==
==The Conclusion==
And then everything worked.
And then everything worked.


Sorry if you were looking for some really detailed instructions or a summary on all the stuff I learned, but my intent was to just share my story and solution.  Hopefully it helps someone.
Sorry if you were looking for some really detailed instructions or a summary on all the stuff I learned, but my intent was to just share my story and solution.  Hopefully it helps someone.


== Final Thoughts ==
==Final Thoughts==
One other item I ran into was logging for the Parsoid service.  At the stage where I was trying to get that service working I figured I'd just check the log files.  A large number of sites referred to the log file location at /var/log/parsoid/parsoid.log, but that didn't exist for me.  Long story short, I went down the logging rabbit hole for about an hour and ended up giving up as I could never get the service to actually log anything.  So if anyone has a 'how to' on that, specifically for CentOS, please write something on that subject.  Thanks in advance.
One other item I ran into was logging for the Parsoid service.  At the stage where I was trying to get that service working I figured I'd just check the log files.  A large number of sites referred to the log file location at /var/log/parsoid/parsoid.log, but that didn't exist for me.  Long story short, I went down the logging rabbit hole for about an hour and ended up giving up as I could never get the service to actually log anything.  So if anyone has a 'how to' on that, specifically for CentOS, please write something on that subject.  Thanks in advance.
</div>
</div>
== STUNNEL & HTTPS ==
Remember, for Wiki sites that use SSL;
For STUNNEL Configuration (/etc/stunnel) if using an intermediate certificate (like StarField from Godaddy) the Server.crt file and intermediary certificat file need to be combined into the same file, with the Server.crt at the beginning and the intermediary certifate(s) at the end.
Test to make sure Parsoid is working on SSL (IE, is STUNNEL running): https://WhatEverURL:8143 (or whatever STUNNEL port)
If it doesn't work, also check Parsoid by going to: http://WhatEverURL:8000 (8000 is the default) (Make sure HTTPD doesn't automatically redirect to HTTPS for this test)