OpenChat icon indicating copy to clipboard operation
OpenChat copied to clipboard

Illuminate\Database\QueryException Error with make install.

Open etdds opened this issue 2 years ago • 2 comments

Hello,

I'm running into the following issue during make install when following the getting started guide.

docker-compose exec backend-server php artisan config:cache

   INFO  Configuration cached successfully.  

\033[1m=== Run backend server migrations ===\033[0m
docker-compose exec backend-server php artisan migrate --seed

   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [2002] Connection refused (Connection: mysql, SQL: select * from information_schema.tables where table_schema = openchat and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:793
    789▕         // If an exception occurs when attempting to run a query, we'll format the error
    790▕         // message to include the bindings with SQL, which will make this exception a
    791▕         // lot more helpful to the developer instead of just the database's errors.
    792▕         catch (Exception $e) {
  ➜ 793▕             throw new QueryException(
    794▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    795▕             );
    796▕         }
    797▕     }

      +38 vendor frames 

  39  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

make: *** [Makefile:35: install] Error 1

It looks like a duplicate of #77, however I'm not sure if it was resolved.

I'm using the latest main 7ecc508e6097b117dc7a0982808510e785b7d72e, on an Linux host 6.4.2-arch1-1 GNU/Linux

Any suggestions would be welcome.

etdds avatar Aug 26 '23 10:08 etdds

I've added wait time for the backend-server database, because the following commands to populate the database are not functioning as the database wasn't running yet on Docker. Edit your make file and copy-paste the concurrent code. Restart and try one more time, should be working properly.

@echo "$(COLOR_BOLD)=== Waiting for services to start (~60 seconds) ===$(COLOR_RESET)"
@sleep 60

neo-media avatar Aug 29 '23 00:08 neo-media

Thanks @neo-media you are right, sometimes the dependent services are not ready and that can cause the issue..

codebanesr avatar Sep 02 '23 13:09 codebanesr