Issue with deploying a Laravel App to Cloud Foundry on IBM Cloud

I’m trying to deploy a basic Laravel application to Cloud Foundry on IBM Cloud. Below you can see the output after I ran ibmcloud cf push:

Invoking 'cf push'...

Pushing from manifest to org ***** / space dev as *****...
Using manifest file *****manifest.yml
Getting app info...
Updating app with these attributes...
  name:                testproject
  path:                *****
  buildpacks:
    https://github.com/cloudfoundry/php-buildpack.git#v4.4.13
  disk quota:          1G
  health check type:   port
  instances:           1
  memory:              64M
  stack:               cflinuxfs3
  env:
    APP_DEBUG
    CF_STAGING_TIMEOUT
    CF_STARTUP_TIMEOUT
  routes:
    testproject.us-south.cf.appdomain.cloud

Updating app testproject...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
 8.35 MiB / 8.35 MiB [==========================================================] 100.00% 5s

Waiting for API to complete processing files...

Staging app and tracing logs...
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd creating container for instance cacf5821-7867-496a-8ace-b6ef71835d24
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd successfully created container for instance cacf5821-7867-496a-8ace-b6ef71835d24
   Downloading build artifacts cache...
   Downloading app package...
   Downloaded build artifacts cache (217B)
   Downloaded app package (12.1M)
   -------> Buildpack version 4.4.13
   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.5
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php7_7.4.5_linux_x64_cflinuxfs3_c0055c53.tgz] to [/tmp]
   The extension 'mcrypt' is not provided by this buildpack.
   Downloaded [https://buildpacks.cloudfoundry.org/dependencies/php/php7_7.4.5_linux_x64_cflinuxfs3_c0055c53.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   2738      0 --:--:-- --:--:-- --:--:--  2754
   Loading composer repositories with package information
   Installing dependencies from lock file
   Package operations: 0 installs, 0 updates, 37 removals
     - Removing webmozart/assert (1.9.1)
     - Removing theseer/tokenizer (1.2.0)
     - Removing sebastian/version (2.0.1)
     - Removing sebastian/type (1.1.3)
     - Removing sebastian/resource-operations (2.0.1)
     - Removing sebastian/recursion-context (3.0.0)
     - Removing sebastian/object-reflector (1.1.1)
     - Removing sebastian/object-enumerator (3.0.3)
     - Removing sebastian/global-state (3.0.0)
     - Removing sebastian/exporter (3.1.2)
     - Removing sebastian/environment (4.2.3)
     - Removing sebastian/diff (3.0.2)
     - Removing sebastian/comparator (3.0.2)
     - Removing sebastian/code-unit-reverse-lookup (1.0.1)
     - Removing scrivo/highlight.php (v9.18.1.1)
     - Removing phpunit/phpunit (8.5.8)
     - Removing phpunit/php-token-stream (3.1.1)
     - Removing phpunit/php-timer (2.1.2)
     - Removing phpunit/php-text-template (1.2.1)
     - Removing phpunit/php-file-iterator (2.0.2)
     - Removing phpunit/php-code-coverage (7.0.10)
     - Removing phpspec/prophecy (1.11.1)
     - Removing phpdocumentor/type-resolver (1.3.0)
     - Removing phpdocumentor/reflection-docblock (5.2.0)
     - Removing phpdocumentor/reflection-common (2.2.0)
     - Removing phar-io/version (2.0.1)
     - Removing phar-io/manifest (1.0.3)
     - Removing nunomaduro/collision (v4.2.0)
     - Removing myclabs/deep-copy (1.10.1)
     - Removing mockery/mockery (1.4.1)
     - Removing hamcrest/hamcrest-php (v2.0.1)
     - Removing fzaninotto/faker (v1.9.1)
     - Removing filp/whoops (2.7.3)
     - Removing facade/ignition-contracts (1.0.1)
     - Removing facade/ignition (2.3.4)
     - Removing facade/flare-client-php (1.3.4)
     - Removing doctrine/instantiator (1.3.1)
   Generating optimized autoload files

     [RuntimeException]
     Could not scan for classes inside "database/seeds" 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/a299fb3027da6b25566e06badf712812/scripts/compile.py", line 59, in <module>
       .from_build_pack('lib/additional_commands')
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/lib/build_pack_utils/builder.py", line 212, in extensions
       process_extension(path, ctx, 'compile', process, args=[self])
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/lib/build_pack_utils/utils.py", line 69, in process_extension
       success(getattr(extn, to_call)(*args))
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/extensions/composer/extension.py", line 444, in compile
       return composer.compile(install)
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/lib/extension_helpers.py", line 154, in compile
       self._compile(install)
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/extensions/composer/extension.py", line 196, in _compile
       self.run()
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/extensions/composer/extension.py", line 343, in run
       *self._ctx['COMPOSER_INSTALL_OPTIONS'])
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/extensions/composer/extension.py", line 390, in run
       shell=True)
     File "/tmp/buildpackdownloads/a299fb3027da6b25566e06badf712812/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 0x7f60ea7ac930>' returned non-zero exit status 1
   Failed to compile droplet: Failed to run finalize script: exit status 1
   Exit status 223
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd stopping instance cacf5821-7867-496a-8ace-b6ef71835d24
   Cell 87626c63-eae1-42ff-a4fb-785ef79934bd destroying container for instance cacf5821-7867-496a-8ace-b6ef71835d24
Error staging application: App staging failed in the buildpack compile phase
FAILED

Here is my composer.json file:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5",
        "fideloper/proxy": "^4.2",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3",
        "laravel/framework": "^7.22.2",
        "laravel/tinker": "^2.0"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fzaninotto/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.1",
        "phpunit/phpunit": "^8.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r "file_exists('.env') || copy('.env.example', '.env');""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Here is my .pb-config/options.json file:

{
    "PHP_VERSION": "{PHP_70_LATEST}",
    "COMPOSER_VENDOR_DIR": "vendor",
    "WEBDIR": "public"
}

Here is my manifest.yml file:

---
 applications:
 - name: testproject
   memory: 64M
   buildpacks: [ https://github.com/cloudfoundry/php-buildpack.git#v4.4.13 ]
   random-route: true
   env:
     APP_DEBUG: false
     CF_STAGING_TIMEOUT: 15
     CF_STARTUP_TIMEOUT: 15

I want to point out that the directory database/seeds exists and it contains file DatabaseSeeder.php.

This is my first time with Cloud Foundry and IBM Cloud. Any help is greatly appreciated!

Go to Source
Author: RCRalph