PHP Fatal error: Uncaught Error: Unsupported operand types in /builder/src/Builder/GenFilesCommand.php:279

115 views
Skip to first unread message

Bilal Haidar

unread,
Jun 9, 2021, 6:44:25 AM6/9/21
to Google App Engine

Hello,
Today, while trying to deploy my Laravel PHP app on Google Cloud Build using App Engine Flex, I faced some errors:

This is the app.yaml file:

```
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 'qa'
```

Step #1:
Step #1: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #1:
Step #1: Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #1: [09-Jun-2021 10:17:41 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #1: [09-Jun-2021 10:17:41 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 232
Step #1: [09-Jun-2021 10:17:41 UTC] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /builder/src/Builder/GenFilesCommand.php on line 174
Step #1: [09-Jun-2021 10:17:41 UTC] PHP Fatal error: Uncaught Error: Unsupported operand types in /builder/src/Builder/GenFilesCommand.php:279
Step #1: Stack trace:
Step #1: #0 /builder/src/Builder/GenFilesCommand.php(163): Google\Cloud\Runtimes\Builder\GenFilesCommand->createDockerfile('gcr.io/google-a...')
Step #1: #1 /builder/vendor/symfony/console/Command/Command.php(255): Google\Cloud\Runtimes\Builder\GenFilesCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #1: #2 /builder/vendor/symfony/console/Application.php(987): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #1: #3 /builder/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Google\Cloud\Runtimes\Builder\GenFilesCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Step #1: #4 /builder/vendor/symfony/console/Application.php(148): Symfony\Component\Conso in /builder/src/Builder/GenFilesCommand.php on line 279

Angel (Google Cloud Platform Support)

unread,
Jun 10, 2021, 9:46:15 AM6/10/21
to Google App Engine
Hello,

I ran your app.yaml file but I was unable to reproduce your issue. I was, however, able to deploy Laravel in App Engine Flex with PHP following this guide [1].

Please try following these steps.

Kind regards,
Angel

Bilal Haidar

unread,
Jun 10, 2021, 10:36:33 AM6/10/21
to Google App Engine
Hello Angel,

I was able to find the source of the issue. I had a section inside the app,yaml as follows:

env_variables:

This was interpreted as null. Hence, the issues above!

However, now the cloud build is okay, but I get 500 Server Error. I don't even get any logs to know what is going on!

This is the URL [1].

Regards
Bilal

Daniel Gomez Bellido

unread,
Jun 11, 2021, 6:03:55 AM6/11/21
to Google App Engine
Hello, 

I tried the URL and I didn't find any errors, I get 200 response and get to the login page succesfully. Do you still have any errors?

Regards
Daniel

Bilal Haidar

unread,
Jun 11, 2021, 6:04:51 AM6/11/21
to Google App Engine
It's working now! However, I filed a bug here: https://github.com/GoogleCloudPlatform/php-docker/issues/534

Thanks
Reply all
Reply to author
Forward
0 new messages