Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illuminate\Database\QueryException Error with make install. #152

Open
etdds opened this issue Aug 26, 2023 · 2 comments
Open

Illuminate\Database\QueryException Error with make install. #152

etdds opened this issue Aug 26, 2023 · 2 comments

Comments

@etdds
Copy link

etdds commented Aug 26, 2023

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.

@neo-media
Copy link

neo-media commented Aug 29, 2023

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

@codebanesr
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants