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

Error running in Docker #125

Open
adrianblynch opened this issue Aug 8, 2024 · 1 comment
Open

Error running in Docker #125

adrianblynch opened this issue Aug 8, 2024 · 1 comment

Comments

@adrianblynch
Copy link

Hi.

I am running a Laravel app in Docker. When starting the extension I get a number of errors.

app_db is the Docker service name.

The errors are all of the same type, namely:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known

The full log is below.

Any thoughts on how to fix this?

VS Code: 1.92.0
Extension: v0.6.6
Logs:

2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense Started...
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: HTTP Routes
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Views paths
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Configs
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Translation namespaces
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Middlewares
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Application Models
2024-08-08 11:58:22.066 [info] Laravel Extra Intellisense command started: Auth Data
2024-08-08 11:58:22.067 [info] Laravel Extra Intellisense command started: Eloquent Attributes and Relations
2024-08-08 11:58:22.067 [info] Laravel Extra Intellisense command started: Custom Blade Directives
2024-08-08 11:58:23.730 [error] Laravel Extra Intellisense Error:
 Views paths
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Core/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Core/Providers/AppServiceProvider.php:54
      App\Core\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.730 [error] Laravel Extra Intellisense Error:
 Auth Data
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.730 [error] Laravel Extra Intellisense Error:
 Translation namespaces
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.731 [error] Laravel Extra Intellisense Error:
 Configs
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.731 [error] Laravel Extra Intellisense Error:
 Application Models
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.731 [error] Laravel Extra Intellisense Error:
 Custom Blade Directives
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.731 [error] Laravel Extra Intellisense Error:
 HTTP Routes
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.731 [error] Laravel Extra Intellisense Error:
 Eloquent Attributes and Relations
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
2024-08-08 11:58:23.732 [error] Laravel Extra Intellisense Error:
 Middlewares
   PDOException 
  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for app_db failed: nodename nor servname provided, or not known
  at [internal]:0
      1▕
      �[2m+9 vendor frames �[22m
  10  app/Providers/AppServiceProvider.php:141
      Illuminate\Database\Connection::getDoctrineConnection()
  11  app/Providers/AppServiceProvider.php:54
      App\Providers\AppServiceProvider::addDbalTypes()
@khaled-sadek
Copy link

check LaravelExtraIntellisense.phpCommand. it should be docker compose exec -w /var/www/html app_container_name php -r "{code}"
Don't forget to replace app_container_name with your Docker service name of the app itself

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

2 participants