Page MenuHomePhabricator

EnableFlow should fail gracefully (or, just work!) if the user tries to enable Flow on a page that doesn't exist
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Go to Special:EnableFlow
  2. Type in a page title that doesn't exist
  3. For the board description, enter anything you like
  4. Submit form

Expected:

  • Flow is enabled on the page, turning it into a Flow board

Actual:

  • An ugly error including an ugly backtrace is emitted to the user (see comment below for the backtrace)

Event Timeline

Deskana created this task.Jan 4 2016, 3:59 AM
Deskana raised the priority of this task from to Needs Triage.
Deskana updated the task description. (Show Details)
Deskana added a project: StructuredDiscussions.
Deskana added a subscriber: Deskana.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptJan 4 2016, 3:59 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript
Deskana renamed this task from EnableFlow should fail gracefully if the user tries to enable Flow on a page that doesn't exist to EnableFlow should fail gracefully (or, just work!) if the user tries to enable Flow on a page that doesn't exist.Jan 4 2016, 4:00 AM
Deskana set Security to None.

Looking at the code, there appears to be logic to prevent this kind of ugly error being spewed at the user, but I'm guessing it's never being reached because an exception is thrown due to the lack of content in the page.

@Deskana Could you please paste the error you're seeing. This scenario is supposed to work (and works in our test environment).

Deskana updated the task description. (Show Details)Jan 13 2016, 11:34 PM

@SBisson Sorry about that! It seems I failed to include one of the necessary steps to reproduce the bug. Let me update it, and paste the stack trace here.

Deskana updated the task description. (Show Details)Jan 13 2016, 11:37 PM

An error has occurred while processing HTML/wikitext conversion.

Return to Main Page.

[07e6739b] /wiki/Special:EnableFlow Flow\Exception\NoParserException from line 129 of /vagrant/mediawiki/extensions/Flow/includes/Conversion/Utils.php: Request to parsoid for 'wikitext' to 'html' conversion of content connected to title "Talk:ASIUFBIAUBFUI" failed: (curl error: 7)

Backtrace:

#0 /vagrant/mediawiki/extensions/Flow/includes/Conversion/Utils.php(48): Flow\Conversion\Utils::parsoid(string, string, string, Title)
#1 /vagrant/mediawiki/extensions/Flow/includes/Model/AbstractRevision.php(529): Flow\Conversion\Utils::convert(string, string, string, Title)
#2 /vagrant/mediawiki/extensions/Flow/includes/Model/Header.php(34): Flow\Model\AbstractRevision->setContent(string, string, Title)
#3 /vagrant/mediawiki/extensions/Flow/includes/Block/Header.php(160): Flow\Model\Header::create(Flow\Model\Workflow, User, string, string, string)
#4 /vagrant/mediawiki/extensions/Flow/includes/Block/Header.php(93): Flow\Block\HeaderBlock->validateFirstRevision()
#5 /vagrant/mediawiki/extensions/Flow/includes/Block/Block.php(215): Flow\Block\HeaderBlock->validate()
#6 /vagrant/mediawiki/extensions/Flow/includes/SubmissionHandler.php(111): Flow\Block\AbstractBlock->onSubmit(array)
#7 /vagrant/mediawiki/extensions/Flow/includes/WorkflowLoader.php(62): Flow\SubmissionHandler->handleSubmit(Flow\Model\Workflow, RequestContext, array, string, array)
#8 /vagrant/mediawiki/extensions/Flow/includes/Specials/SpecialEnableFlow.php(132): Flow\WorkflowLoader->handleSubmit(RequestContext, string, array)
#9 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(607): Flow\Specials\SpecialEnableFlow->onSubmit(array)
#10 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(504): HTMLForm->trySubmit()
#11 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(519): HTMLForm->tryAuthorizedSubmit()
#12 /vagrant/mediawiki/includes/specialpage/FormSpecialPage.php(154): HTMLForm->show()
#13 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(384): FormSpecialPage->execute(NULL)
#14 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(553): SpecialPage->run(NULL)
#15 /vagrant/mediawiki/includes/MediaWiki.php(280): SpecialPageFactory::executePath(Title, RequestContext)
#16 /vagrant/mediawiki/includes/MediaWiki.php(727): MediaWiki->performRequest()
#17 /vagrant/mediawiki/includes/MediaWiki.php(506): MediaWiki->main()
#18 /vagrant/mediawiki/index.php(43): MediaWiki->run()
#19 /var/www/w/index.php(5): include(string)
#20 {main}

@SBisson I updated the description with the actual steps needed to reproduce, and pasted the backtrace above. Hopefully that gives you what you need. Let me know if you need more details!

Deskana updated the task description. (Show Details)Jan 13 2016, 11:42 PM

Thanks @Deskana for the details. The stack trace is especially useful since I can't reproduce this error locally even with the exact same steps.

Which site is that on?

@SBisson This was on my local Vagrant instance. My copy of Flow is fairly recent, but probably not master. I'll update to master and try again later.

@SBisson This was on my local Vagrant instance. My copy of Flow is fairly recent, but probably not master. I'll update to master and try again later.

I'm not sure what curl error: 7 means but that really looks like a configuration issue. Make sure to enable the parsoid role in mw-vagrant.

Are you otherwise able to use Flow (create topics, posts, switch between wikitext and VE) or does it fail in similar ways everywhere?
It should be enabled by default on the Flow_test_talk namespace.

I explicitly enabled parsoid, and unfortunately the problem persists. As you guessed, it looks like it exists across Flow, because I also cannot create Flow posts. I'm also tried git-update to update to master, and the problem still persists. I don't know what's happening. :-/

I remember we had this issue where the parsoid configuration was completely broken but I would not expect if from a new mw-vagrant setup.
Any idea @Mattflaschen?

I also can't reproduce with Special:EnableFlow or otherwise. If you're still seeing this problem, please do (starting on command-line in Vagrant directory):

vagrant ssh
hhvmsh
var_export( Flow\Conversion\Utils::isParsoidConfigured() );
var_export( $wgVirtualRestConfig );

$method = new ReflectionMethod( "Flow\Conversion\Utils::getVRSObject" );
$method->setAccessible( true );
var_export( $method->invoke( null ) );

I get:

::1> var_export( Flow\Conversion\Utils::isParsoidConfigured() );
var_export( Flow\Conversion\Utils::isParsoidConfigured() );
true
::1> var_export( $wgVirtualRestConfig );
var_export( $wgVirtualRestConfig );
array (
  'modules' => 
  array (
    'parsoid' => 
    array (
      'url' => 'http://localhost:8000',
      'domain' => '127.0.0.1',
      'forwardCookies' => true,
      'restbaseCompat' => false,
    ),
    'restbase' => 
    array (
      'url' => 'http://localhost:7231',
      'domain' => '127.0.0.1',
      'forwardCookies' => true,
      'parsoidCompat' => false,
    ),
  ),
  'global' => 
  array (
    'timeout' => 360,
    'forwardCookies' => false,
    'HTTPProxy' => NULL,
    'domain' => 'http://127.0.0.1:8080',
  ),
)
::1> 

::1> $method = new ReflectionMethod( "Flow\Conversion\Utils::getVRSObject" );
$method = new ReflectionMethod( "Flow\Conversion\Utils::getVRSObject" );
::1> $method->setAccessible( true );
$method->setAccessible( true );
::1> var_export( $method->invoke( null ) );
var_export( $method->invoke( null ) );
ParsoidVirtualRESTService::__set_state(array(
  'params' => 
  array (
    'name' => 'parsoid',
    'url' => 'http://localhost:8000/',
    'prefix' => 'localhost',
    'domain' => '127.0.0.1',
    'forwardCookies' => false,
    'HTTPProxy' => NULL,
    'timeout' => 360,
    'restbaseCompat' => true,
  ),
))
jmatazzoni closed this task as Resolved.Apr 12 2016, 6:45 PM