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

Added project initializability check in docker-entrypoint.sh #719

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

7-zete-7
Copy link
Contributor

Currently, if there are errors that prevent the project from initializing correctly, the php container console shows a database connection error (see #718).

With this PR, I propose adding a check to ensure that the project can be initialized before checking the database connection. This will allow you to see a specific error in the php container console.

@7-zete-7
Copy link
Contributor Author

So far I've come up with the idea to use version retrieval.

When using the version retrieval command

bin/console -V
It will output either project version information
Symfony 6.4.16 (env: dev, debug: true)
Or error information
ParseError {#2236
  #message: "syntax error, unexpected identifier "p", expecting "function""
  #code: 0
  #file: "./src/SomethingBroken.php"
  #line: 23
  trace: {
    ./src/SomethingBroken.php:23 {
      Composer\Autoload\{closure}^
      › {
      ›     p rivate string $foobar;
      ›
    }
    ./vendor/composer/ClassLoader.php:427 { …}
    ./vendor/symfony/error-handler/DebugClassLoader.php:300 { …}
    Symfony\Component\ErrorHandler\DebugClassLoader->loadClass() {}
    ./vendor/symfony/config/Resource/ClassExistenceResource.php:76 { …}
    ./vendor/symfony/dependency-injection/ContainerBuilder.php:361 { …}
    ./vendor/symfony/dependency-injection/Loader/FileLoader.php:293 { …}
    ./vendor/symfony/dependency-injection/Loader/FileLoader.php:121 { …}
    ./vendor/symfony/dependency-injection/Loader/YamlFileLoader.php:706 { …}
    ./vendor/symfony/dependency-injection/Loader/YamlFileLoader.php:254 { …}
    ./vendor/symfony/dependency-injection/Loader/YamlFileLoader.php:177 { …}
    ./vendor/symfony/dependency-injection/Loader/YamlFileLoader.php:133 { …}
    ./vendor/symfony/config/Loader/FileLoader.php:167 { …}
    ./vendor/symfony/config/Loader/FileLoader.php:98 { …}
    ./vendor/symfony/dependency-injection/Loader/FileLoader.php:70 { …}
    ./vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php:64 { …}
    ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:57 { …}
    ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:190 { …}
    ./vendor/symfony/dependency-injection/Loader/ClosureLoader.php:36 { …}
    ./vendor/symfony/config/Loader/DelegatingLoader.php:37 { …}
    ./vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php:146 { …}
    ./vendor/symfony/http-kernel/Kernel.php:616 { …}
    ./vendor/symfony/http-kernel/Kernel.php:505 { …}
    ./vendor/symfony/http-kernel/Kernel.php:771 { …}
    ./vendor/symfony/http-kernel/Kernel.php:126 { …}
    ./src/Kernel.php:82 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:190 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:72 { …}
    ./vendor/symfony/console/Application.php:175 { …}
    ./vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php:49 { …}
    ./vendor/autoload_runtime.php:29 { …}
    ./bin/console:15 { …}
  }
}

@maxhelias maxhelias merged commit 6707f3d into dunglas:main Jan 15, 2025
2 checks passed
@7-zete-7 7-zete-7 deleted the patch-1 branch January 15, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants