cloudfoundry / php-buildpack

A Cloud Foundry Buildpack for PHP.
Apache License 2.0
142 stars 342 forks source link

Can't deploy laravel app using php buildpack #359

Closed dahider2 closed 3 years ago

dahider2 commented 4 years ago

Hello,

I am trying to deploy with git a laravel app on IBM cloud but getting following error:

[RuntimeException]                                                                            
     Could not scan for classes inside "database" which does not appear to be a file nor a folder  

Here is my manifest file

applications:
- name: fret-expressv2
  memory: 128M
  buildpacks:
    - https://github.com/cloudfoundry/php-buildpack
  env:
    APP_DEBUG: true
    CF_STAGING_TIMEOUT: 15
    CF_STARTUP_TIMEOUT: 15

Here is options.json file

{
    "WEBDIR": "public",
 }

log output

Using manifest file /home/pipeline/717729bf-0db2-4a7e-898a-424c433d931b/manifest.yml
Getting app info...
Updating app with these attributes...
  name:                fret-expressv2
  path:                /home/pipeline/717729bf-0db2-4a7e-898a-424c433d931b
  buildpacks:
    https://github.com/cloudfoundry/php-buildpack
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              128M
  stack:               cflinuxfs3
  env:
    APP_DEBUG
    CF_STAGING_TIMEOUT
    CF_STARTUP_TIMEOUT

  routes:
    fret-expressv2.eu-gb.mybluemix.net

Updating app fret-expressv2...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...

 0 B / 1.00 MiB    0.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00%
 1.00 MiB / 1.00 MiB  100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Cell e4eb1323-6734-49f0-9d69-c2dbd4a1bc71 creating container for instance 0fdd0c53-cccb-4f11-8cd6-4ede702b03d4
   Cell e4eb1323-6734-49f0-9d69-c2dbd4a1bc71 successfully created container for instance 0fdd0c53-cccb-4f11-8cd6-4ede702b03d4
   Downloading app package...
   Downloaded app package (3.6M)
   -------> Buildpack version 4.4.16
   Installing HTTPD
   HTTPD 2.4.43
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/httpd/httpd_2.4.43_linux_x64_cflinuxfs3_59c67ff8.tgz] to [/tmp]
   Installing PHP
   PHP 7.4.6
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php7_7.4.6_linux_x64_cflinuxfs3_23b012f9.tgz] to [/tmp]
   The extension 'mcrypt' is not provided by this buildpack.
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php7_7.4.6_linux_x64_cflinuxfs3_23b012f9.tgz] to [/tmp]
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/composer/composer_1.10.5_linux_noarch_any-stack_a1f79ebd.phar] to [/tmp]
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
   100   482  100   482    0     0   2200      0 --:--:-- --:--:-- --:--:--  2190
   100   482  100   482    0     0   2171      0 --:--:-- --:--:-- --:--:--  2161
   Loading composer repositories with package information
   Installing dependencies from lock file
   Package operations: 64 installs, 0 updates, 0 removals
     - Installing symfony/polyfill-ctype (v1.17.0): Downloading (100%)
     - Installing phpoption/phpoption (1.7.4): Downloading (100%)
     - Installing vlucas/phpdotenv (v3.6.6): Downloading (100%)
     - Installing symfony/css-selector (v5.1.0): Downloading (100%)
     - Installing tijsverkoyen/css-to-inline-styles (2.2.2): Downloading (100%)
     - Installing symfony/polyfill-php80 (v1.17.0): Downloading (100%)
     - Installing symfony/polyfill-php72 (v1.17.0): Downloading (100%)
     - Installing symfony/polyfill-mbstring (v1.17.0): Downloading (100%)
     - Installing symfony/var-dumper (v4.4.9): Downloading (100%)
     - Installing symfony/routing (v4.4.9): Downloading (100%)
     - Installing symfony/process (v4.4.9): Downloading (100%)
     - Installing symfony/polyfill-php73 (v1.17.0): Downloading (100%)
     - Installing symfony/polyfill-intl-idn (v1.17.0): Downloading (100%)
     - Installing symfony/mime (v5.1.0): Downloading (100%)
     - Installing symfony/http-foundation (v4.4.9): Downloading (100%)
     - Installing symfony/event-dispatcher-contracts (v1.1.7): Downloading (100%)
     - Installing symfony/event-dispatcher (v4.4.9): Downloading (100%)
     - Installing psr/log (1.1.3): Downloading (100%)
     - Installing symfony/debug (v4.4.9): Downloading (100%)
     - Installing symfony/error-handler (v4.4.9): Downloading (100%)
     - Installing symfony/http-kernel (v4.4.9): Downloading (100%)
     - Installing symfony/finder (v4.4.9): Downloading (100%)
     - Installing psr/container (1.0.0): Downloading (100%)
     - Installing symfony/service-contracts (v2.1.2): Downloading (100%)
     - Installing symfony/console (v4.4.9): Downloading (100%)
     - Installing symfony/polyfill-iconv (v1.17.0): Downloading (100%)
     - Installing doctrine/lexer (1.2.1): Downloading (100%)
     - Installing egulias/email-validator (2.1.17): Downloading (100%)
     - Installing swiftmailer/swiftmailer (v6.2.3): Downloading (100%)
     - Installing paragonie/random_compat (v9.99.99): Downloading (100%)
     - Installing ramsey/uuid (3.9.3): Downloading (100%)
     - Installing psr/simple-cache (1.0.1): Downloading (100%)
     - Installing opis/closure (3.5.4): Downloading (100%)
     - Installing symfony/translation-contracts (v2.1.2): Downloading (100%)
     - Installing symfony/translation (v4.4.9): Downloading (100%)
     - Installing nesbot/carbon (2.35.0): Downloading (100%)
     - Installing monolog/monolog (2.1.0): Downloading (100%)
     - Installing league/flysystem (1.0.69): Downloading (100%)
     - Installing league/commonmark (1.4.3): Downloading (100%)
     - Installing dragonmantank/cron-expression (v2.3.0): Downloading (100%)
     - Installing doctrine/inflector (2.0.3): Downloading (100%)
     - Installing laravel/framework (v6.18.18): Downloading (100%)
     - Installing sabberworm/php-css-parser (8.3.1): Downloading (100%)
     - Installing phenx/php-svg-lib (v0.3.3): Downloading (100%)
     - Installing phenx/php-font-lib (0.5.2): Downloading (100%)
     - Installing dompdf/dompdf (v0.8.5): Downloading (100%)
     - Installing barryvdh/laravel-dompdf (v0.8.6): Downloading (100%)
     - Installing doctrine/event-manager (1.1.0): Downloading (100%)
     - Installing doctrine/cache (1.10.1): Downloading (100%)
     - Installing doctrine/dbal (2.10.2): Downloading (100%)
     - Installing fideloper/proxy (4.3.0): Downloading (100%)
     - Installing ralouphie/getallheaders (3.0.3): Downloading (100%)
     - Installing psr/http-message (1.0.1): Downloading (100%)
     - Installing guzzlehttp/psr7 (1.6.1): Downloading (100%)
     - Installing intervention/image (2.5.1): Downloading (100%)
     - Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
     - Installing jenssegers/date (v3.5.0): Downloading (100%)
     - Installing nikic/php-parser (v4.5.0): Downloading (100%)
     - Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
     - Installing dnoegel/php-xdg-base-dir (v0.1.1): Downloading (100%)
     - Installing psy/psysh (v0.9.12): Downloading (100%)
     - Installing laravel/tinker (v1.0.10): Downloading (100%)
     - Installing laravelcollective/html (v6.1.2): Downloading (100%)
     - Installing spatie/laravel-permission (3.13.0): Downloading (100%)
   Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
   Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
   Generating optimized autoload files

     [RuntimeException]                                                                            
     Could not scan for classes inside "database" which does not appear to be a file nor a folder  

   install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
   -----> Composer command failed
   Traceback (most recent call last):
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/scripts/compile.py", line 59, in <module>
       .from_build_pack('lib/additional_commands')
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/lib/build_pack_utils/builder.py", line 212, in extensions
       process_extension(path, ctx, 'compile', process, args=[self])
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/lib/build_pack_utils/utils.py", line 69, in process_extension
       success(getattr(extn, to_call)(*args))
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/extensions/composer/extension.py", line 444, in compile
       return composer.compile(install)
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/lib/extension_helpers.py", line 154, in compile
       self._compile(install)
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/extensions/composer/extension.py", line 196, in _compile
       self.run()
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/extensions/composer/extension.py", line 343, in run
       *self._ctx['COMPOSER_INSTALL_OPTIONS'])
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/extensions/composer/extension.py", line 390, in run
       shell=True)
     File "/tmp/buildpackdownloads/3f0c03c7602ee67512337b56bc424f4b/lib/build_pack_utils/runner.py", line 109, in stream_output
       raise CalledProcessError(retcode, cmd)
   build_pack_utils.runner.CalledProcessError: Command '<open file '<fdopen>', mode 'w' at 0x7f8f6a3a2930>' returned non-zero exit status 1
   Failed to compile droplet: Failed to run finalize script: exit status 1
   Exit status 223
   Cell e4eb1323-6734-49f0-9d69-c2dbd4a1bc71 stopping instance 0fdd0c53-cccb-4f11-8cd6-4ede702b03d4
   Cell e4eb1323-6734-49f0-9d69-c2dbd4a1bc71 destroying container for instance 0fdd0c53-cccb-4f11-8cd6-4ede702b03d4
Error staging application: App staging failed in the buildpack compile phase
FAILED

Finished: FAILED

Thank you for your help

cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/173231621

The labels on this github issue will be updated when the story is started.

ForestEckhardt commented 3 years ago

I am unable to reproduce this myself but from a cursory Google search it would appear the program is looking for the presence of a database file at the project root. If you could provide us with an app that we can use to reproduce this behavior we would be happy to look into this a bit further.

sophiewigmore commented 3 years ago

@dahider2 I am closing this issue due to inactivity. Please feel free to reopen it if this is still an issue for you!