我正在使用 Laravel,不知何故它停止工作了。 我已经搜索过这个错误,但还没有找到任何解决方案; 我不断收到此错误
[ErrorException]
fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:ssl3_write_pending:bad write retry
有人可以帮我吗?
代码不是问题,它读取 X 行,然后只是说它找不到我在该行上放置的内容,无论它是否存在。
And I follow "Gebruiker aanmaken" # FeatureContext::clickLink()
Then I should see "Nieuwe gebruiker aanmaken" # FeatureContext::assertPageContainsText()
And I fill in "Voornaam" with "Jesse" # FeatureContext::fillField()
And I fill in "Achternaam" with "Bessem" # FeatureContext::fillField()
And I fill in "E-Mailadres" with "[email protected]" # FeatureContext::fillField()
And I fill in "Functie" with "Eigenaar" # FeatureContext::fillField()
And I fill in "Geboortedatum" with "14-07-1994" # FeatureContext::fillField()
And I click on submit button "Aanmaken" # FeatureContext::iClickOnSubmitButton()
Then I should not see "Nieuwe gebruiker aanmaken" # FeatureContext::assertPageNotContainsText()
And I should see "Jesse" # FeatureContext::assertPageContainsText()
And I should see "Bessem" # FeatureContext::assertPageContainsText()
The text "Bessem" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)
And I should see "[email protected]" # FeatureContext::assertPageContainsText()
And I should see "Eigenaar" # FeatureContext::assertPageContainsText()
And I should see "14-07-1994" # FeatureContext::assertPageContainsText()
And I should see "Er is een e-mail verstuurd naar [email protected]" # FeatureContext::assertPageContainsText()
[ErrorException]
fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409F07F:SSL routines:ssl3_write_pending:bad write retry
这就是错误发生的确切方式,我知道我应该看到姓氏,当我手动执行此操作时,我可以看到姓氏,但不知何故它被卡住并抛出该错误,如果我删除该行请参阅杰西它会在 see bessem 上成功,并在下一个电子邮件中抛出错误
最后经过更多挖掘
ErrorException in StreamBuffer.php line 232:
fwrite(): SSL: Broken pipe
in StreamBuffer.php line 232
at HandleExceptions->handleError('2', 'fwrite(): SSL: Broken pipe', '/home/vagrant/aag/code/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', '232', array('bytes' => 'QUIT ', 'bytesToWrite' => '6', 'totalBytesWritten' => '0'))
at fwrite(resource, 'QUIT ') in StreamBuffer.php line 232
我仍然不知道问题的根源,
好的,那么如果人们在开发环境中使用 behat 会遇到类似的问题。 不要像我一样,不要使用 SMTP,而是在 .env 文件中使用日志作为 MAil_DRIVER,
尝试在 fwrite() 之前添加 sleep(5)。 之后应该就可以正常工作了。
如果您想让它更高级一点,您可以尝试检查 SSL_Write 是否返回 SSL_ERROR_WANT_WRITE 或 SSL_ERROR_WANT_READ,并再次使用相同的参数重复调用 SSL_write。