bazaar icon indicating copy to clipboard operation
bazaar copied to clipboard

weird connection reset error

Open luceos opened this issue 8 years ago • 7 comments

@ibrahimk157 reports having issues with bazaar, the error triggered is:

{
  "errors": [
    {
      "code": 500,
      "title": "Internal server error",
      "detail": "LogicException: Lost connection and no reconnector available. in /home/u542484920/public_html/forum/vendor/illuminate/database/Connection.php:715\nStack trace:\n#0 /home/u542484920/public_html/forum/vendor/illuminate/database/Connection.php(684): Illuminate\\Database\\Connection->reconnect()\n#1 /home/u542484920/public_html/forum/vendor/illuminate/database/Connection.php(624): Illuminate\\Database\\Connection->tryAgainIfCausedByLostConnection(Object(Illuminate\\Database\\QueryException), 'select exists(s...', Array, Object(Closure))\n#2 /home/u542484920/public_html/forum/vendor/illuminate/database/Connection.php(324): Illuminate\\Database\\Connection->run('select exists(s...', Array, Object(Closure))\n#3 /home/u542484920/public_html/forum/vendor/illuminate/database/Query/Builder.php(1637): Illuminate\\Database\\Connection->select('select exists(s...', Array, true)\n#4 /home/u542484920/public_html/forum/vendor/flarum/core/src/Settings/DatabaseSettingsRepository.php(43): Illuminate\\Database\\Query\\Builder->exists()\n#5 /home/u542484920/public_html/forum/vendor/flarum/core/src/Settings/MemoryCacheSettingsRepository.php(52): Flarum\\Settings\\DatabaseSettingsRepository->set('flagrow.bazaar....', 1)\n#6 /home/u542484920/public_html/forum/vendor/flagrow/bazaar/src/Search/FlagrowApi.php(99): Flarum\\Settings\\MemoryCacheSettingsRepository->set('flagrow.bazaar....', 1)\n#7 /home/u542484920/public_html/forum/vendor/guzzlehttp/promises/src/FulfilledPromise.php(39): Flagrow\\Bazaar\\Search\\FlagrowApi->Flagrow\\Bazaar\\Search\\{closure}(Object(GuzzleHttp\\Psr7\\Response))\n#8 

luceos avatar Apr 28 '17 13:04 luceos

This has been most likely a memory issue.

luceos avatar May 08 '17 06:05 luceos

@Luceos but how come it used to work like a charm before? It used to work perfectly until i updated to the version with the update feature.

ibrahimk157 avatar May 08 '17 11:05 ibrahimk157

Updating is a very lengthy process, we will explore new ways of reducing memory usage and process duration in the future. We already have some ideas how to do so, but that will be a bit more far-reaching in what we do to change the Flarum install.

luceos avatar May 08 '17 12:05 luceos

@Luceos it's not the updating of extensions that's not working (in fact, I haven't even tried using the update feature yet) .... it's the installation of extensions.... it used to always work but ever since the bazaar version that contains the extension update feature, even the extensions that successfully installed previously now give this same exact error if i try install them again (yes, i did remove them for the purpose of testing... but I removed them through ssh)

ibrahimk157 avatar May 08 '17 14:05 ibrahimk157

I have no idea what could trigger this error, but here are a few leads:

Laravel sets a database reconnect strategy (https://github.com/laravel/framework/blob/v5.1.38/src/Illuminate/Database/DatabaseManager.php#L195) but Flarum does not (https://github.com/flarum/core/blob/v0.1.0-beta.6/src/Database/DatabaseServiceProvider.php) so any database timeout will cause this exception (thrown here https://github.com/laravel/framework/blob/v5.1.38/src/Illuminate/Database/Connection.php#L715)

Not found any useful Stackoverflow thread so far, this exception probably never happens with a real Laravel application given it has a reconnector. Maybe adding a reconnector to Flarum could prevent such issue to happen again.

clarkwinkelmann avatar May 11 '17 15:05 clarkwinkelmann

We could temporarily do this ourselves and PR against core to patch this.

luceos avatar May 11 '17 18:05 luceos

@Luceos Can't wait!!!

ibrahimk157 avatar May 12 '17 05:05 ibrahimk157