Laravel 8 - build failed in google app engine flexible environment

141 views
Skip to first unread message

Bilal Haidar

unread,
Jun 9, 2021, 3:11:59 PM6/9/21
to Google App Engine

Hello,
I have a Laravel PHP app with the following:

- app.yaml
```
runtime: php
env: flex

runtime_config:
document_root: public
whitelist_functions: proc_open
automatic_scaling:
min_num_instances: 1
max_num_instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
env_variables:
# See substitution variables for Google Cloud Build Trigger
```

- cloud_build.yaml
```
steps:
  - name: node:14.0.0
    entrypoint: npm
    args: ['install']
  - name: node:14.0.0
    entrypoint: npm
    args: ['run', 'prod']
  - name: 'gcr.io/cloud-builders/gcloud'
    args: ['app', 'deploy', '--project', '$PROJECT_ID', '-q', '$_GAE_PROMOTE', '-v', '$_GAE_VERSION']
timeout: '3600s'
```

- composer.json
```
"require": {
"php": "7.3.*",
...
}
```

When the Cloud Build Trigger runs, I get the following error:

```
Step #0: Digest: sha256:1f43a583e4c10b1758647be47b9fb5f9659227ef266978694acbb7981e4ee093
Step #0: [09-Jun-2021 19:06:00 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #0:
Step #0: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #0: [09-Jun-2021 19:06:00 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #0:
Step #0: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #0: [09-Jun-2021 19:06:00 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 174
Step #0:
Step #0: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 174
Step #0: [09-Jun-2021 19:06:00 UTC] PHP Fatal error: Uncaught Error: Unsupported operand types in /builder/src/Builder/GenFilesCommand.php:279
```

Alexis (Cloud Platform Support)

unread,
Jun 10, 2021, 10:56:09 AM6/10/21
to Google App Engine
Hi,

I think this may be a duplicate post? I see another post here[1] about the same thing

Please mark as resolved if it's for the same question, otherwise please elaborate if it's a different issue. This also helps the community to find the right solutions. Thank you.

Bilal Haidar

unread,
Jun 10, 2021, 11:35:37 AM6/10/21
to Google App Engine
Hi Alexis,

I believe it's a bug inside GenFilesCommand.php.

If the app.yaml file has an empty section for example:

env_variables:


There is no check for a null section in this case. I discovered that today after I was pulling my hair out! Now It works. But my app is giving 500 Server Error and I cannot see any log to help me or guide me know what's going on.

Can you help on this?
Reply all
Reply to author
Forward
0 new messages